New upstream version 3.6.4
authorGert Wollny <gewo@debian.org>
Sat, 1 Dec 2018 18:53:46 +0000 (19:53 +0100)
committerGert Wollny <gewo@debian.org>
Sat, 1 Dec 2018 18:53:46 +0000 (19:53 +0100)
801 files changed:
ANNOUNCE
CMake/3rdparty.cmake
CMake/CTest/CTestCustomAndroid.cmake.in
CMake/CTest/CTestCustomWine.cmake.in
CMake/CTest/dcmtkCTestMacros.cmake
CMake/CTest/dcmtkCTestRun.cmake.in
CMake/CTest/dcmtkCTestRunAndroid.cmake.in
CMake/CTest/dcmtkCTestRunExhaustive.cmake
CMake/CTest/dcmtkCTestRunWine.cmake.in
CMake/CheckCMakeCommandExists.cmake
CMake/CheckFunctionWithHeaderExists.cmake
CMake/DCMTKConfig.cmake.in
CMake/FindCharset.cmake
CMake/FindICONV.cmake [deleted file]
CMake/FindICU.cmake
CMake/FindIconv.cmake [new file with mode: 0644]
CMake/FindSndfile.cmake
CMake/FindWrap.cmake
CMake/GenerateCMakeExports.cmake
CMake/GenerateDCMTKConfigure.cmake
CMake/dcmtkAfterModules.cmake
CMake/dcmtkMacros.cmake
CMake/dcmtkPrepare.cmake
CMake/dcmtkTryCompile.cmake
CMake/dcmtkTryRun.cmake
CMake/dcmtkUseAndroidSDK.cmake
CMake/dcmtkUseWine.cmake
CMake/osconfig.h.in
CMakeLists.txt
COPYRIGHT
INSTALL
VERSION
config/CMakeLists.txt
config/aclocal.m4
config/configure
config/configure.in
config/docs/CMakeLists.txt
config/docs/macros.txt
config/include/dcmtk/config/osconfig.h.in
config/rootconf
config/tests/iconv.cc [new file with mode: 0644]
config/tests/lciconv.cc [new file with mode: 0644]
dcmdata/CMakeLists.txt
dcmdata/apps/CMakeLists.txt
dcmdata/apps/Makefile.dep
dcmdata/apps/Makefile.in
dcmdata/apps/cda2dcm.cc [new file with mode: 0755]
dcmdata/apps/dcmconv.cc
dcmdata/apps/dcmcrle.cc
dcmdata/apps/dcmdump.cc
dcmdata/apps/mdfdsman.cc
dcmdata/apps/pdf2dcm.cc
dcmdata/apps/stl2dcm.cc [new file with mode: 0755]
dcmdata/data/CMakeLists.txt
dcmdata/data/dicom.dic
dcmdata/docs/CMakeLists.txt
dcmdata/docs/cda2dcm.man [new file with mode: 0644]
dcmdata/docs/datadict.txt
dcmdata/docs/dcmcrle.man
dcmdata/docs/dcmdata.dox
dcmdata/docs/pdf2dcm.man
dcmdata/docs/stl2dcm.man [new file with mode: 0644]
dcmdata/include/CMakeLists.txt
dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
dcmdata/include/dcmtk/dcmdata/dcbytstr.h
dcmdata/include/dcmtk/dcmdata/dccodec.h
dcmdata/include/dcmtk/dcmdata/dcdatset.h
dcmdata/include/dcmtk/dcmdata/dcdeftag.h
dcmdata/include/dcmtk/dcmdata/dcdict.h
dcmdata/include/dcmtk/dcmdata/dcdirrec.h
dcmdata/include/dcmtk/dcmdata/dcelem.h
dcmdata/include/dcmtk/dcmdata/dcencdoc.h [new file with mode: 0755]
dcmdata/include/dcmtk/dcmdata/dcfilefo.h
dcmdata/include/dcmtk/dcmdata/dcistrma.h
dcmdata/include/dcmtk/dcmdata/dcistrmf.h
dcmdata/include/dcmtk/dcmdata/dcistrmz.h
dcmdata/include/dcmtk/dcmdata/dcitem.h
dcmdata/include/dcmtk/dcmdata/dcjson.h
dcmdata/include/dcmtk/dcmdata/dcmatch.h
dcmdata/include/dcmtk/dcmdata/dcmetinf.h
dcmdata/include/dcmtk/dcmdata/dcobject.h
dcmdata/include/dcmtk/dcmdata/dcostrmz.h
dcmdata/include/dcmtk/dcmdata/dcpixel.h
dcmdata/include/dcmtk/dcmdata/dcpixseq.h
dcmdata/include/dcmtk/dcmdata/dcpxitem.h
dcmdata/include/dcmtk/dcmdata/dcsequen.h
dcmdata/include/dcmtk/dcmdata/dctagkey.h
dcmdata/include/dcmtk/dcmdata/dcuid.h
dcmdata/include/dcmtk/dcmdata/dcvr.h
dcmdata/include/dcmtk/dcmdata/dcvrat.h
dcmdata/include/dcmtk/dcmdata/dcvrda.h
dcmdata/include/dcmtk/dcmdata/dcvrdt.h
dcmdata/include/dcmtk/dcmdata/dcvrfd.h
dcmdata/include/dcmtk/dcmdata/dcvrfl.h
dcmdata/include/dcmtk/dcmdata/dcvrlt.h
dcmdata/include/dcmtk/dcmdata/dcvrobow.h
dcmdata/include/dcmtk/dcmdata/dcvrsl.h
dcmdata/include/dcmtk/dcmdata/dcvrss.h
dcmdata/include/dcmtk/dcmdata/dcvrst.h
dcmdata/include/dcmtk/dcmdata/dcvrtm.h
dcmdata/include/dcmtk/dcmdata/dcvrul.h
dcmdata/include/dcmtk/dcmdata/dcvrur.h
dcmdata/include/dcmtk/dcmdata/dcvrus.h
dcmdata/include/dcmtk/dcmdata/dcvrut.h
dcmdata/include/dcmtk/dcmdata/dcxfer.h
dcmdata/include/dcmtk/dcmdata/vrscan.h
dcmdata/libi2d/Makefile.dep
dcmdata/libsrc/CMakeLists.txt
dcmdata/libsrc/Makefile.dep
dcmdata/libsrc/Makefile.in
dcmdata/libsrc/cmdlnarg.cc
dcmdata/libsrc/dcbytstr.cc
dcmdata/libsrc/dcdatset.cc
dcmdata/libsrc/dcddirif.cc
dcmdata/libsrc/dcdicent.cc
dcmdata/libsrc/dcdict.cc
dcmdata/libsrc/dcdictbi.cc
dcmdata/libsrc/dcdirrec.cc
dcmdata/libsrc/dcelem.cc
dcmdata/libsrc/dcencdoc.cc [new file with mode: 0644]
dcmdata/libsrc/dcfilefo.cc
dcmdata/libsrc/dcitem.cc
dcmdata/libsrc/dcmatch.cc
dcmdata/libsrc/dcmetinf.cc
dcmdata/libsrc/dcpath.cc
dcmdata/libsrc/dcpixel.cc
dcmdata/libsrc/dcpxitem.cc
dcmdata/libsrc/dcrleccd.cc
dcmdata/libsrc/dcsequen.cc
dcmdata/libsrc/dctag.cc
dcmdata/libsrc/dctagkey.cc
dcmdata/libsrc/dcuid.cc
dcmdata/libsrc/dcvr.cc
dcmdata/libsrc/dcvrat.cc
dcmdata/libsrc/dcvrda.cc
dcmdata/libsrc/dcvrdt.cc
dcmdata/libsrc/dcvrfd.cc
dcmdata/libsrc/dcvrfl.cc
dcmdata/libsrc/dcvris.cc
dcmdata/libsrc/dcvrlt.cc
dcmdata/libsrc/dcvrobow.cc
dcmdata/libsrc/dcvrod.cc
dcmdata/libsrc/dcvrof.cc
dcmdata/libsrc/dcvrol.cc
dcmdata/libsrc/dcvrpobw.cc
dcmdata/libsrc/dcvrsl.cc
dcmdata/libsrc/dcvrss.cc
dcmdata/libsrc/dcvrst.cc
dcmdata/libsrc/dcvrtm.cc
dcmdata/libsrc/dcvrul.cc
dcmdata/libsrc/dcvrur.cc
dcmdata/libsrc/dcvrus.cc
dcmdata/libsrc/dcvrut.cc
dcmdata/libsrc/dcxfer.cc
dcmdata/libsrc/mkdeftag.cc
dcmdata/libsrc/mkdictbi.cc
dcmdata/libsrc/vrscan.cc
dcmdata/libsrc/vrscani.h
dcmdata/libsrc/vrscanl.c
dcmdata/libsrc/vrscanl.h
dcmdata/tests/Makefile.dep
dcmdata/tests/tdict.cc
dcmdata/tests/tmatch.cc
dcmdata/tests/tnewdcme.cc
dcmdata/tests/tpread.cc
dcmdata/tests/tvrcomp.cc
dcmdata/tests/tvrol.cc
dcmdata/tests/tvrui.cc
dcmfg/CMakeLists.txt
dcmfg/include/CMakeLists.txt
dcmfg/include/dcmtk/dcmfg/fgbase.h
dcmfg/include/dcmtk/dcmfg/fginterface.h
dcmfg/include/dcmtk/dcmfg/fgtypes.h
dcmfg/include/dcmtk/dcmfg/stackinterface.h
dcmfg/libsrc/Makefile.dep
dcmfg/libsrc/fgbase.cc
dcmfg/libsrc/fgderimg.cc
dcmfg/libsrc/fgfracon.cc
dcmfg/libsrc/fgframeanatomy.cc
dcmfg/libsrc/fgframevoilut.cc
dcmfg/libsrc/fgimagedatatype.cc
dcmfg/libsrc/fginterface.cc
dcmfg/libsrc/fgparametricmapframetype.cc
dcmfg/libsrc/fgpixeltransform.cc
dcmfg/libsrc/fgpixmsr.cc
dcmfg/libsrc/fgplanor.cc
dcmfg/libsrc/fgplanorvol.cc
dcmfg/libsrc/fgplanpo.cc
dcmfg/libsrc/fgplanposvol.cc
dcmfg/libsrc/fgrealworldvaluemapping.cc
dcmfg/libsrc/fgseg.cc
dcmfg/libsrc/fgusimagedescription.cc
dcmfg/libsrc/stackinterface.cc
dcmimage/CMakeLists.txt
dcmimage/apps/CMakeLists.txt
dcmimage/apps/Makefile.dep
dcmimage/apps/Makefile.in
dcmimage/apps/dcm2pnm.cc
dcmimage/apps/dcmicmp.cc [new file with mode: 0644]
dcmimage/apps/dcmquant.cc
dcmimage/apps/dcmscale.cc
dcmimage/docs/dcmicmp.man [new file with mode: 0644]
dcmimage/include/CMakeLists.txt
dcmimage/include/dcmtk/dcmimage/dcmicmph.h [new file with mode: 0644]
dcmimage/include/dcmtk/dcmimage/dipipng.h
dcmimage/include/dcmtk/dcmimage/dipitiff.h
dcmimage/include/dcmtk/dcmimage/diqttype.h
dcmimage/libsrc/CMakeLists.txt
dcmimage/libsrc/Makefile.dep
dcmimage/libsrc/Makefile.in
dcmimage/libsrc/dcmicmph.cc [new file with mode: 0644]
dcmimage/libsrc/dicoimg.cc
dcmimgle/CMakeLists.txt
dcmimgle/apps/CMakeLists.txt
dcmimgle/apps/Makefile.dep
dcmimgle/data/CMakeLists.txt
dcmimgle/include/CMakeLists.txt
dcmimgle/include/dcmtk/dcmimgle/dimoopxt.h
dcmimgle/include/dcmtk/dcmimgle/diobjcou.h
dcmimgle/include/dcmtk/dcmimgle/diovpln.h
dcmimgle/include/dcmtk/dcmimgle/diutils.h
dcmimgle/libsrc/Makefile.dep
dcmimgle/libsrc/didocu.cc
dcmimgle/libsrc/diimage.cc
dcmimgle/libsrc/dimoimg.cc
dcmimgle/libsrc/dimomod.cc
dcmimgle/libsrc/diovlay.cc
dcmimgle/libsrc/diovpln.cc
dcmiod/CMakeLists.txt
dcmiod/include/CMakeLists.txt
dcmiod/include/dcmtk/dcmiod/cielabutil.h
dcmiod/include/dcmtk/dcmiod/iodimage.h
dcmiod/include/dcmtk/dcmiod/iodrules.h
dcmiod/include/dcmtk/dcmiod/iodutil.h
dcmiod/include/dcmtk/dcmiod/modequipment.h
dcmiod/include/dcmtk/dcmiod/modmultiframefg.h
dcmiod/libsrc/Makefile.dep
dcmiod/libsrc/cielabutil.cc
dcmiod/libsrc/iodcontentitemmacro.cc
dcmiod/libsrc/iodmacro.cc
dcmiod/libsrc/iodreferences.cc
dcmiod/libsrc/iodutil.cc
dcmiod/libsrc/modcommoninstanceref.cc
dcmiod/libsrc/modenhequipment.cc
dcmiod/libsrc/modenhusseries.cc
dcmiod/libsrc/modequipment.cc
dcmiod/libsrc/modgeneralseries.cc
dcmiod/libsrc/modgeneralstudy.cc
dcmiod/libsrc/modmultiframedimension.cc
dcmiod/libsrc/modmultiframefg.cc
dcmiod/tests/Makefile.dep
dcmiod/tests/tcielabutil.cc
dcmjpeg/CMakeLists.txt
dcmjpeg/apps/CMakeLists.txt
dcmjpeg/apps/Makefile.dep
dcmjpeg/apps/dcmcjpeg.cc
dcmjpeg/apps/dcmdjpeg.cc
dcmjpeg/docs/dcmcjpeg.man
dcmjpeg/docs/dcmdjpeg.man
dcmjpeg/docs/dcmj2pnm.man
dcmjpeg/docs/dcmjpeg.dox
dcmjpeg/include/CMakeLists.txt
dcmjpeg/include/dcmtk/dcmjpeg/djcparam.h
dcmjpeg/include/dcmtk/dcmjpeg/djdecode.h
dcmjpeg/include/dcmtk/dcmjpeg/djencode.h
dcmjpeg/include/dcmtk/dcmjpeg/djutils.h
dcmjpeg/libijg12/jcpred.c
dcmjpeg/libijg12/jcscale.c
dcmjpeg/libijg12/jcshuff.c
dcmjpeg/libijg12/jdct12.h
dcmjpeg/libijg12/jdmarker.c
dcmjpeg/libijg12/jdpred.c
dcmjpeg/libijg12/jdscale.c
dcmjpeg/libijg12/jidctred.c
dcmjpeg/libijg12/jquant2.c
dcmjpeg/libijg16/Makefile.dep
dcmjpeg/libijg16/jccolor.c
dcmjpeg/libijg16/jcpred.c
dcmjpeg/libijg16/jcscale.c
dcmjpeg/libijg16/jcshuff.c
dcmjpeg/libijg16/jdct16.h
dcmjpeg/libijg16/jdhuff.c
dcmjpeg/libijg16/jdhuff16.h
dcmjpeg/libijg16/jdlhuff.c
dcmjpeg/libijg16/jdmarker.c
dcmjpeg/libijg16/jdmerge.c
dcmjpeg/libijg16/jdphuff.c
dcmjpeg/libijg16/jdpred.c
dcmjpeg/libijg16/jdscale.c
dcmjpeg/libijg16/jdshuff.c
dcmjpeg/libijg16/jidctred.c
dcmjpeg/libijg16/jpeglib16.h
dcmjpeg/libijg16/jquant2.c
dcmjpeg/libijg8/jcpred.c
dcmjpeg/libijg8/jcscale.c
dcmjpeg/libijg8/jcshuff.c
dcmjpeg/libijg8/jdct8.h
dcmjpeg/libijg8/jdmarker.c
dcmjpeg/libijg8/jdpred.c
dcmjpeg/libijg8/jdscale.c
dcmjpeg/libijg8/jidctred.c
dcmjpeg/libijg8/jquant2.c
dcmjpeg/libsrc/CMakeLists.txt
dcmjpeg/libsrc/Makefile.dep
dcmjpeg/libsrc/djcodecd.cc
dcmjpeg/libsrc/djcodece.cc
dcmjpeg/libsrc/djcparam.cc
dcmjpeg/libsrc/djdecode.cc
dcmjpeg/libsrc/djdijg16.cc
dcmjpeg/libsrc/djeijg12.cc
dcmjpeg/libsrc/djeijg16.cc
dcmjpeg/libsrc/djeijg8.cc
dcmjpeg/libsrc/djencode.cc
dcmjpeg/libsrc/djutils.cc
dcmjpls/CMakeLists.txt
dcmjpls/apps/CMakeLists.txt
dcmjpls/apps/Makefile.dep
dcmjpls/docs/dcmcjpls.man
dcmjpls/include/CMakeLists.txt
dcmjpls/include/dcmtk/dcmjpls/djlsutil.h
dcmjpls/libcharls/CMakeLists.txt
dcmjpls/libsrc/CMakeLists.txt
dcmjpls/libsrc/Makefile.dep
dcmjpls/libsrc/djcodecd.cc
dcmjpls/libsrc/djcodece.cc
dcmnet/CMakeLists.txt
dcmnet/apps/CMakeLists.txt
dcmnet/apps/Makefile.dep
dcmnet/apps/dcmrecv.cc
dcmnet/apps/dcmsend.cc
dcmnet/apps/echoscu.cc
dcmnet/apps/findscu.cc
dcmnet/apps/movescu.cc
dcmnet/apps/storescp.cc
dcmnet/apps/storescu.cc
dcmnet/docs/CMakeLists.txt
dcmnet/docs/dcmsend.man
dcmnet/docs/echoscu.man
dcmnet/docs/findscu.man
dcmnet/docs/getscu.man
dcmnet/docs/movescu.man
dcmnet/docs/storescp.man
dcmnet/docs/storescu.man
dcmnet/etc/CMakeLists.txt
dcmnet/etc/storescp.cfg
dcmnet/etc/storescu.cfg
dcmnet/include/CMakeLists.txt
dcmnet/include/dcmtk/dcmnet/assoc.h
dcmnet/include/dcmtk/dcmnet/cond.h
dcmnet/include/dcmtk/dcmnet/dcmlayer.h
dcmnet/include/dcmtk/dcmnet/dcmtrans.h
dcmnet/include/dcmtk/dcmnet/dcuserid.h
dcmnet/include/dcmtk/dcmnet/dfindscu.h
dcmnet/include/dcmtk/dcmnet/dicom.h
dcmnet/include/dcmtk/dcmnet/dimse.h
dcmnet/include/dcmtk/dcmnet/diutil.h
dcmnet/include/dcmtk/dcmnet/dstorscu.h
dcmnet/include/dcmtk/dcmnet/dul.h
dcmnet/include/dcmtk/dcmnet/scp.h
dcmnet/include/dcmtk/dcmnet/scppool.h
dcmnet/libsrc/Makefile.dep
dcmnet/libsrc/assoc.cc
dcmnet/libsrc/cond.cc
dcmnet/libsrc/dccftsmp.cc
dcmnet/libsrc/dcmlayer.cc
dcmnet/libsrc/dcmtrans.cc
dcmnet/libsrc/dcompat.cc
dcmnet/libsrc/dcuserid.cc
dcmnet/libsrc/dfindscu.cc
dcmnet/libsrc/dimcmd.cc
dcmnet/libsrc/dimecho.cc
dcmnet/libsrc/dimfind.cc
dcmnet/libsrc/dimget.cc
dcmnet/libsrc/dimmove.cc
dcmnet/libsrc/dimstore.cc
dcmnet/libsrc/diutil.cc
dcmnet/libsrc/dul.cc
dcmnet/libsrc/dulconst.cc
dcmnet/libsrc/dulfsm.cc
dcmnet/libsrc/dulparse.cc
dcmnet/libsrc/dulpres.cc
dcmnet/libsrc/dwrap.c
dcmnet/libsrc/scp.cc
dcmnet/libsrc/scu.cc
dcmnet/tests/Makefile.dep
dcmpmap/CMakeLists.txt
dcmpmap/docs/dcmpmap.dox
dcmpmap/include/CMakeLists.txt
dcmpmap/include/dcmtk/dcmpmap/dpmparametricmapiod.h
dcmpmap/libsrc/Makefile.dep
dcmpmap/libsrc/dpmmodparametricmapseries.cc
dcmpmap/libsrc/dpmparametricmapbase.cc
dcmpmap/libsrc/dpmparametricmapiod.cc
dcmpstat/CMakeLists.txt
dcmpstat/apps/CMakeLists.txt
dcmpstat/apps/Makefile.dep
dcmpstat/apps/dcmmklut.cc
dcmpstat/apps/dcmp2pgm.cc
dcmpstat/apps/dcmprscp.cc
dcmpstat/apps/dcmprscu.cc
dcmpstat/apps/dcmpschk.cc
dcmpstat/apps/dcmpsmk.cc
dcmpstat/apps/dcmpsrcv.cc
dcmpstat/apps/dcmpssnd.cc
dcmpstat/data/CMakeLists.txt
dcmpstat/etc/CMakeLists.txt
dcmpstat/etc/dcmpstat.cfg
dcmpstat/etc/printers.cfg
dcmpstat/include/CMakeLists.txt
dcmpstat/include/dcmtk/dcmpstat/dviface.h
dcmpstat/include/dcmtk/dcmpstat/dvpscf.h
dcmpstat/include/dcmtk/dcmpstat/dvpsdef.h
dcmpstat/include/dcmtk/dcmpstat/dvpsmsg.h
dcmpstat/include/dcmtk/dcmpstat/dvsighdl.h
dcmpstat/libsrc/Makefile.dep
dcmpstat/libsrc/dcmpstat.cc
dcmpstat/libsrc/dviface.cc
dcmpstat/libsrc/dvpsab.cc
dcmpstat/libsrc/dvpsal.cc
dcmpstat/libsrc/dvpsall.cc
dcmpstat/libsrc/dvpscf.cc
dcmpstat/libsrc/dvpsda.cc
dcmpstat/libsrc/dvpsfs.cc
dcmpstat/libsrc/dvpsga.cc
dcmpstat/libsrc/dvpsgl.cc
dcmpstat/libsrc/dvpsgr.cc
dcmpstat/libsrc/dvpshlp.cc
dcmpstat/libsrc/dvpsib.cc
dcmpstat/libsrc/dvpsmsg.cc
dcmpstat/libsrc/dvpsov.cc
dcmpstat/libsrc/dvpspl.cc
dcmpstat/libsrc/dvpspr.cc
dcmpstat/libsrc/dvpsprt.cc
dcmpstat/libsrc/dvpsri.cc
dcmpstat/libsrc/dvpsrs.cc
dcmpstat/libsrc/dvpssp.cc
dcmpstat/libsrc/dvpssv.cc
dcmpstat/libsrc/dvpssvl.cc
dcmpstat/libsrc/dvpstx.cc
dcmpstat/libsrc/dvpsvl.cc
dcmpstat/libsrc/dvpsvwl.cc
dcmpstat/tests/Makefile.dep
dcmpstat/tests/msgserv.cc
dcmqrdb/CMakeLists.txt
dcmqrdb/apps/CMakeLists.txt
dcmqrdb/apps/Makefile.dep
dcmqrdb/apps/dcmqridx.cc
dcmqrdb/apps/dcmqrscp.cc
dcmqrdb/docs/CMakeLists.txt
dcmqrdb/docs/dcmqrcnf.txt
dcmqrdb/docs/dcmqrscp.man
dcmqrdb/etc/CMakeLists.txt
dcmqrdb/etc/dcmqrprf.cfg
dcmqrdb/include/CMakeLists.txt
dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbm.h
dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h
dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h
dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h
dcmqrdb/libsrc/Makefile.dep
dcmqrdb/libsrc/dcmqrcbg.cc
dcmqrdb/libsrc/dcmqrcbm.cc
dcmqrdb/libsrc/dcmqrcbs.cc
dcmqrdb/libsrc/dcmqrdbi.cc
dcmqrdb/libsrc/dcmqrptb.cc
dcmqrdb/libsrc/dcmqrsrv.cc
dcmqrdb/libsrc/dcmqrtis.cc
dcmrt/CMakeLists.txt
dcmrt/apps/Makefile.dep
dcmrt/include/CMakeLists.txt
dcmrt/libsrc/Makefile.dep
dcmrt/tests/Makefile.dep
dcmseg/CMakeLists.txt
dcmseg/include/CMakeLists.txt
dcmseg/include/dcmtk/dcmseg/segdoc.h
dcmseg/include/dcmtk/dcmseg/segment.h
dcmseg/include/dcmtk/dcmseg/segtypes.h
dcmseg/include/dcmtk/dcmseg/segutils.h
dcmseg/libsrc/Makefile.dep
dcmseg/libsrc/segdoc.cc
dcmseg/libsrc/segutils.cc
dcmseg/tests/Makefile.dep
dcmseg/tests/tutils.cc
dcmsign/CMakeLists.txt
dcmsign/apps/Makefile.dep
dcmsign/apps/dcmsign.cc
dcmsign/include/CMakeLists.txt
dcmsign/include/dcmtk/dcmsign/dcsignat.h
dcmsign/include/dcmtk/dcmsign/sialgo.h
dcmsign/include/dcmtk/dcmsign/siautopr.h
dcmsign/include/dcmtk/dcmsign/sibrsapr.h
dcmsign/include/dcmtk/dcmsign/sicert.h
dcmsign/include/dcmtk/dcmsign/sicertvf.h
dcmsign/include/dcmtk/dcmsign/sicreapr.h
dcmsign/include/dcmtk/dcmsign/sidsa.h
dcmsign/include/dcmtk/dcmsign/simac.h
dcmsign/include/dcmtk/dcmsign/simaccon.h
dcmsign/include/dcmtk/dcmsign/simd5.h
dcmsign/include/dcmtk/dcmsign/sinullpr.h
dcmsign/include/dcmtk/dcmsign/siprivat.h
dcmsign/include/dcmtk/dcmsign/siripemd.h
dcmsign/include/dcmtk/dcmsign/sirsa.h
dcmsign/include/dcmtk/dcmsign/sisha1.h
dcmsign/include/dcmtk/dcmsign/sisha256.h
dcmsign/include/dcmtk/dcmsign/sisha384.h
dcmsign/include/dcmtk/dcmsign/sisha512.h
dcmsign/include/dcmtk/dcmsign/sisprof.h
dcmsign/include/dcmtk/dcmsign/sitstamp.h
dcmsign/include/dcmtk/dcmsign/sitypes.h
dcmsign/libsrc/Makefile.dep
dcmsign/libsrc/dcsignat.cc
dcmsign/libsrc/simaccon.cc
dcmsign/libsrc/siprivat.cc
dcmsign/libsrc/sisha384.cc
dcmsign/libsrc/sitypes.cc
dcmsr/CMakeLists.txt
dcmsr/apps/CMakeLists.txt
dcmsr/apps/Makefile.dep
dcmsr/data/CMakeLists.txt
dcmsr/docs/dcmsr.dox
dcmsr/docs/dsr2html.man
dcmsr/docs/dsr2xml.man
dcmsr/docs/dsrdump.man
dcmsr/docs/xml2dsr.man
dcmsr/include/CMakeLists.txt
dcmsr/include/dcmtk/dcmsr/cmr/cid100.h
dcmsr/include/dcmtk/dcmsr/cmr/cid10013.h
dcmsr/include/dcmtk/dcmsr/cmr/cid10033.h
dcmsr/include/dcmtk/dcmsr/cmr/cid11.h
dcmsr/include/dcmtk/dcmsr/cmr/cid244.h
dcmsr/include/dcmtk/dcmsr/cmr/cid29.h
dcmsr/include/dcmtk/dcmsr/cmr/cid4020.h
dcmsr/include/dcmtk/dcmsr/cmr/cid4021.h
dcmsr/include/dcmtk/dcmsr/cmr/cid4031.h
dcmsr/include/dcmtk/dcmsr/cmr/cid42.h
dcmsr/include/dcmtk/dcmsr/cmr/cid6147.h
dcmsr/include/dcmtk/dcmsr/cmr/cid7021.h
dcmsr/include/dcmtk/dcmsr/cmr/cid7181.h
dcmsr/include/dcmtk/dcmsr/cmr/cid7445.h
dcmsr/include/dcmtk/dcmsr/cmr/cid7452.h
dcmsr/include/dcmtk/dcmsr/cmr/cid7453.h
dcmsr/include/dcmtk/dcmsr/cmr/cid7464.h
dcmsr/include/dcmtk/dcmsr/cmr/cid7469.h
dcmsr/include/dcmtk/dcmsr/cmr/tid1419m.h
dcmsr/include/dcmtk/dcmsr/cmr/tid4019.h [new file with mode: 0644]
dcmsr/include/dcmtk/dcmsr/codes/dcm.h
dcmsr/include/dcmtk/dcmsr/codes/ncit.h
dcmsr/include/dcmtk/dcmsr/codes/umls.h
dcmsr/include/dcmtk/dcmsr/dsrcodvl.h
dcmsr/include/dcmtk/dcmsr/dsrdnflt.h
dcmsr/include/dcmtk/dcmsr/dsrdocst.h
dcmsr/include/dcmtk/dcmsr/dsrdoctr.h
dcmsr/include/dcmtk/dcmsr/dsrreftn.h
dcmsr/include/dcmtk/dcmsr/dsrsc3tn.h
dcmsr/include/dcmtk/dcmsr/dsrsc3vl.h
dcmsr/include/dcmtk/dcmsr/dsrtlist.h
dcmsr/include/dcmtk/dcmsr/dsrtncsr.h
dcmsr/include/dcmtk/dcmsr/dsrtpltn.h
dcmsr/include/dcmtk/dcmsr/dsrtree.h
dcmsr/libcmr/CMakeLists.txt
dcmsr/libcmr/Makefile.dep
dcmsr/libcmr/Makefile.in
dcmsr/libcmr/cid100.cc
dcmsr/libcmr/cid10013.cc
dcmsr/libcmr/cid10033.cc
dcmsr/libcmr/cid11.cc
dcmsr/libcmr/cid244.cc
dcmsr/libcmr/cid29.cc
dcmsr/libcmr/cid4020.cc
dcmsr/libcmr/cid4021.cc
dcmsr/libcmr/cid4031.cc
dcmsr/libcmr/cid4031e.cc
dcmsr/libcmr/cid42.cc
dcmsr/libcmr/cid6147.cc
dcmsr/libcmr/cid7021.cc
dcmsr/libcmr/cid7181.cc
dcmsr/libcmr/cid7445.cc
dcmsr/libcmr/cid7452.cc
dcmsr/libcmr/cid7453.cc
dcmsr/libcmr/cid7464.cc
dcmsr/libcmr/cid7469.cc
dcmsr/libcmr/tid1419m.cc
dcmsr/libcmr/tid1600.cc
dcmsr/libcmr/tid300.cc
dcmsr/libcmr/tid4019.cc [new file with mode: 0644]
dcmsr/libsrc/Makefile.dep
dcmsr/libsrc/dsrcodtn.cc
dcmsr/libsrc/dsrcomtn.cc
dcmsr/libsrc/dsrcontn.cc
dcmsr/libsrc/dsrdattn.cc
dcmsr/libsrc/dsrdnflt.cc
dcmsr/libsrc/dsrdocst.cc
dcmsr/libsrc/dsrdtitn.cc
dcmsr/libsrc/dsrimgfr.cc
dcmsr/libsrc/dsrimgtn.cc
dcmsr/libsrc/dsrimgvl.cc
dcmsr/libsrc/dsrnumtn.cc
dcmsr/libsrc/dsrpnmtn.cc
dcmsr/libsrc/dsrreftn.cc
dcmsr/libsrc/dsrsc3gr.cc
dcmsr/libsrc/dsrsc3tn.cc
dcmsr/libsrc/dsrsc3vl.cc
dcmsr/libsrc/dsrscogr.cc
dcmsr/libsrc/dsrscotn.cc
dcmsr/libsrc/dsrtcosp.cc
dcmsr/libsrc/dsrtcotn.cc
dcmsr/libsrc/dsrtcoto.cc
dcmsr/libsrc/dsrtextn.cc
dcmsr/libsrc/dsrtimtn.cc
dcmsr/libsrc/dsrtpltn.cc
dcmsr/libsrc/dsruidtn.cc
dcmsr/libsrc/dsrwavtn.cc
dcmsr/libsrc/dsrxmld.cc
dcmsr/tests/Makefile.dep
dcmsr/tests/tsrcmr.cc
dcmsr/tests/tsrdoctr.cc
dcmtls/CMakeLists.txt
dcmtls/docs/CMakeLists.txt
dcmtls/docs/ciphers.txt
dcmtls/docs/dcmtls.dox
dcmtls/docs/randseed.txt
dcmtls/include/CMakeLists.txt
dcmtls/include/dcmtk/dcmtls/tlsciphr.h [new file with mode: 0644]
dcmtls/include/dcmtk/dcmtls/tlslayer.h
dcmtls/include/dcmtk/dcmtls/tlsopt.h
dcmtls/include/dcmtk/dcmtls/tlsscu.h
dcmtls/include/dcmtk/dcmtls/tlstrans.h
dcmtls/libsrc/CMakeLists.txt
dcmtls/libsrc/Makefile.dep
dcmtls/libsrc/Makefile.in
dcmtls/libsrc/tlsciphr.cc [new file with mode: 0644]
dcmtls/libsrc/tlscond.cc
dcmtls/libsrc/tlslayer.cc
dcmtls/libsrc/tlsopt.cc
dcmtls/libsrc/tlsscu.cc
dcmtls/libsrc/tlstrans.cc
dcmtls/tests/dcmtls_testsuite_generate.pl [new file with mode: 0755]
dcmtls/tests/dcmtls_testsuite_run.pl [new file with mode: 0755]
dcmtract/CMakeLists.txt
dcmtract/include/CMakeLists.txt
dcmtract/include/dcmtk/dcmtract/trcmeasurement.h
dcmtract/include/dcmtk/dcmtract/trctrackset.h
dcmtract/include/dcmtk/dcmtract/trctractographyresults.h
dcmtract/include/dcmtk/dcmtract/trctypes.h
dcmtract/libsrc/Makefile.dep
dcmtract/libsrc/trcmeasurement.cc
dcmtract/libsrc/trcmodtractresults.cc
dcmtract/libsrc/trcstatistic.cc
dcmtract/libsrc/trctrack.cc
dcmtract/libsrc/trctrackset.cc
dcmtract/libsrc/trctractographyresults.cc
dcmwlm/CMakeLists.txt
dcmwlm/apps/CMakeLists.txt
dcmwlm/apps/Makefile.dep
dcmwlm/data/CMakeLists.txt
dcmwlm/data/wlistdb/OFFIS/wklist4.dump
dcmwlm/data/wlistdb/OFFIS/wklist5.dump
dcmwlm/data/wlistdb/OFFIS/wklist6.dump
dcmwlm/include/CMakeLists.txt
dcmwlm/include/dcmtk/dcmwlm/wlds.h
dcmwlm/include/dcmtk/dcmwlm/wlfsim.h
dcmwlm/include/dcmtk/dcmwlm/wltypdef.h
dcmwlm/libsrc/Makefile.dep
dcmwlm/libsrc/wlds.cc
dcmwlm/libsrc/wldsfs.cc
dcmwlm/libsrc/wlfsim.cc
dcmwlm/libsrc/wlmactmg.cc
dcmwlm/tests/Makefile.dep
docs/ANNOUNCE.363 [new file with mode: 0644]
docs/CHANGES.364 [new file with mode: 0644]
doxygen/CMakeLists.txt
doxygen/htmldocs.cfg
doxygen/manpages/man1/cda2dcm.1 [new file with mode: 0644]
doxygen/manpages/man1/dcm2json.1
doxygen/manpages/man1/dcm2pdf.1
doxygen/manpages/man1/dcm2pnm.1
doxygen/manpages/man1/dcm2xml.1
doxygen/manpages/man1/dcmcjpeg.1
doxygen/manpages/man1/dcmcjpls.1
doxygen/manpages/man1/dcmconv.1
doxygen/manpages/man1/dcmcrle.1
doxygen/manpages/man1/dcmdjpeg.1
doxygen/manpages/man1/dcmdjpls.1
doxygen/manpages/man1/dcmdrle.1
doxygen/manpages/man1/dcmdspfn.1
doxygen/manpages/man1/dcmdump.1
doxygen/manpages/man1/dcmftest.1
doxygen/manpages/man1/dcmgpdir.1
doxygen/manpages/man1/dcmicmp.1 [new file with mode: 0644]
doxygen/manpages/man1/dcmj2pnm.1
doxygen/manpages/man1/dcml2pnm.1
doxygen/manpages/man1/dcmmkcrv.1
doxygen/manpages/man1/dcmmkdir.1
doxygen/manpages/man1/dcmmklut.1
doxygen/manpages/man1/dcmodify.1
doxygen/manpages/man1/dcmp2pgm.1
doxygen/manpages/man1/dcmprscp.1
doxygen/manpages/man1/dcmprscu.1
doxygen/manpages/man1/dcmpschk.1
doxygen/manpages/man1/dcmpsmk.1
doxygen/manpages/man1/dcmpsprt.1
doxygen/manpages/man1/dcmpsrcv.1
doxygen/manpages/man1/dcmpssnd.1
doxygen/manpages/man1/dcmqridx.1
doxygen/manpages/man1/dcmqrscp.1
doxygen/manpages/man1/dcmqrti.1
doxygen/manpages/man1/dcmquant.1
doxygen/manpages/man1/dcmrecv.1
doxygen/manpages/man1/dcmscale.1
doxygen/manpages/man1/dcmsend.1
doxygen/manpages/man1/dcmsign.1
doxygen/manpages/man1/dcod2lum.1
doxygen/manpages/man1/dconvlum.1
doxygen/manpages/man1/drtdump.1
doxygen/manpages/man1/dsr2html.1
doxygen/manpages/man1/dsr2xml.1
doxygen/manpages/man1/dsrdump.1
doxygen/manpages/man1/dump2dcm.1
doxygen/manpages/man1/echoscu.1
doxygen/manpages/man1/findscu.1
doxygen/manpages/man1/getscu.1
doxygen/manpages/man1/img2dcm.1
doxygen/manpages/man1/movescu.1
doxygen/manpages/man1/pdf2dcm.1
doxygen/manpages/man1/stl2dcm.1 [new file with mode: 0644]
doxygen/manpages/man1/storescp.1
doxygen/manpages/man1/storescu.1
doxygen/manpages/man1/termscu.1
doxygen/manpages/man1/wlmscpfs.1
doxygen/manpages/man1/xml2dcm.1
doxygen/manpages/man1/xml2dsr.1
oflog/CMakeLists.txt
oflog/etc/CMakeLists.txt
oflog/include/CMakeLists.txt
oflog/include/dcmtk/oflog/winconap.h
oflog/libsrc/CMakeLists.txt
oflog/libsrc/Makefile.dep
oflog/libsrc/cygwin32.cc
oflog/libsrc/fileap.cc
oflog/libsrc/ntelogap.cc
oflog/libsrc/strccloc.cc
oflog/libsrc/timehelp.cc
oflog/libsrc/winconap.cc
ofstd/CMakeLists.txt
ofstd/docs/ofstd.dox
ofstd/include/CMakeLists.txt
ofstd/include/dcmtk/ofstd/ofassert.h [new file with mode: 0644]
ofstd/include/dcmtk/ofstd/ofchrenc.h
ofstd/include/dcmtk/ofstd/ofcmdln.h
ofstd/include/dcmtk/ofstd/ofconapp.h
ofstd/include/dcmtk/ofstd/ofcond.h
ofstd/include/dcmtk/ofstd/ofconsol.h
ofstd/include/dcmtk/ofstd/oferror.h
ofstd/include/dcmtk/ofstd/ofexit.h [new file with mode: 0644]
ofstd/include/dcmtk/ofstd/offile.h
ofstd/include/dcmtk/ofstd/offilsys.h [new file with mode: 0644]
ofstd/include/dcmtk/ofstd/offname.h
ofstd/include/dcmtk/ofstd/ofgrp.h
ofstd/include/dcmtk/ofstd/ofoset.h
ofstd/include/dcmtk/ofstd/ofpwd.h
ofstd/include/dcmtk/ofstd/ofrand.h [new file with mode: 0644]
ofstd/include/dcmtk/ofstd/ofsetit.h
ofstd/include/dcmtk/ofstd/ofsockad.h
ofstd/include/dcmtk/ofstd/ofstd.h
ofstd/include/dcmtk/ofstd/ofstdinc.h
ofstd/include/dcmtk/ofstd/ofthread.h
ofstd/include/dcmtk/ofstd/ofuoset.h
ofstd/include/dcmtk/ofstd/ofutil.h
ofstd/include/dcmtk/ofstd/ofuuid.h
ofstd/include/dcmtk/ofstd/ofvector.h
ofstd/include/dcmtk/ofstd/ofxml.h
ofstd/include/dcmtk/ofstd/variadic/helpers.h
ofstd/libsrc/CMakeLists.txt
ofstd/libsrc/Makefile.dep
ofstd/libsrc/Makefile.in
ofstd/libsrc/ofchrenc.cc
ofstd/libsrc/ofcmdln.cc
ofstd/libsrc/ofconapp.cc
ofstd/libsrc/oferror.cc
ofstd/libsrc/offile.cc
ofstd/libsrc/offilsys.cc [new file with mode: 0755]
ofstd/libsrc/offname.cc
ofstd/libsrc/ofrand.cc [new file with mode: 0644]
ofstd/libsrc/ofsockad.cc
ofstd/libsrc/ofstd.cc
ofstd/libsrc/ofstring.cc
ofstd/libsrc/ofthread.cc
ofstd/libsrc/oftime.cc
ofstd/libsrc/ofuuid.cc
ofstd/libsrc/ofxml.cc
ofstd/tests/CMakeLists.txt
ofstd/tests/Makefile.dep
ofstd/tests/Makefile.in
ofstd/tests/tchrenc.cc
ofstd/tests/terror.cc
ofstd/tests/tests.cc
ofstd/tests/tfilsys.cc [new file with mode: 0644]
ofstd/tests/tlimits.cc
ofstd/tests/toffile.cc
ofstd/tests/tofstd.cc
ofstd/tests/tthread.cc
ofstd/tests/txml.cc

index 3c38b34ecba43e4609837c3c9ce5a5b1a2e60da2..513b9d1218caee5e589addfbbc01e6259977f8e3 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,11 +1,11 @@
 ANNOUNCEMENT
 
-Version 3.6.3 of the OFFIS DCMTK (DICOM ToolKit) software is now available for
+Version 3.6.4 of the OFFIS DCMTK (DICOM ToolKit) software is now available for
 public release.  This is a minor release that includes the following changes
-over the previous version 3.6.2:
+over the previous version 3.6.3:
 
-- DCMTK 3.6.3 builds correctly on older and up-to-date versions of GNU gcc
-  (4.2.1 to 7.1.1) Clang (3.4.1 to 4.0.1),  Microsoft Visual Studio (2005 to
+- DCMTK 3.6.4 builds correctly on older and up-to-date versions of GNU gcc
+  (4.2.1 to 8.2.1) Clang (3.4.2 to 7.0.0),  Microsoft Visual Studio (2005 to
   2017) and SunPro CC (5.14 and 5.15).
 
 - Tested with the following operating systems/environments:
@@ -23,81 +23,128 @@ over the previous version 3.6.2:
 
   For a complete list of tested systems and compilers, see the INSTALL file.
 
-- GNU Autoconf has been deprecated, running 'configure' will now emit a
-  warning by default.
+- GNU Autoconf is still deprecated, running 'configure' emits a warning by
+  default.  Support for GNU Autoconf will be removed after this release.
 
 - Updated data dictionary, SOP Class and Transfer Syntax UIDs for the recently
   approved changes to the DICOM standard (i.e. Supplements and CPs), up to DICOM
-  standard release DICOM 2017e.
+  standard release DICOM 2018d plus Supplement 188 (Multi-energy CT Images),
+  CP-1803 and CP-1809.
 
-- Updated automatically generated classes in module "dcmrt" (Radiotherapy) and
-  "dcmsr" (Structured Reporting) based on DICOM 2017e.  Also updated the Code
+- Added "dcmicmp", a new tool that reads two DICOM images, an original
+  "reference image" and a post-processed "test image" to which some kind of
+  processing such as a lossy image compression has been applied.  dcmicmp
+  compares both images and computes several metrics that describe how similar
+  or different both images are.
+
+- Added new command line applications: cda2dcm and stl2dcm for encapsulation
+  of HL7 CDA documents and STL files into DICOM file format.  Revised
+  implementation of pdf2dcm based on new class DcmEncapsulatedDocument.
+
+- The lossless JPEG decoder can now handle images compressed with the
+  Cornell codec, which creates invalid Huffman codes for 16-bit images.
+
+- The new class OFRandom implements a cryptographically secure pseudo
+  random number generator (PRNG) based on the ISAAC algorithm and its public
+  domain reference implementation by Bob Jenkins.
+
+- Major revision of the TLS code in DCMTK (module dcmtls and related command
+  line tools) implementing DICOM Supplement 204 "TLS Security Profiles".
+  Selection of TLS ciphersuites is now based on security profiles, and
+  DCMTK now implements the recommendations of BCP 195 / RFC 7525.
+
+- DCMTK can now be compiled with LibreSSL as an alternative to OpenSSL.
+
+- Updated automatically generated Context Group classes in "dcmsr"
+  (Structured Reporting) based on DICOM 2018d.  Also updated the Code
   definitions from the supported coding schemes such as DICOM, NCIt and UMLS.
 
 - Further enhanced DICOM Structured Reporting (SR) module "dcmsr":
 
-  - Added support for the Patient Radiation Dose SR IOD (Supplement 191).
+  - Added support for included template TID 4019 (Algorithm Identification) to
+    the implementation of TID 1419 (ROI Measurements).
 
-  - Added support for further sub-templates to the existing class for TID 1500
-    (Measurement Report), e.g. TID 300 (Measurement).
+  - Added a document tree node filter that checks for the presence or absence
+    of a concept name, i.e. whether it is empty or not.
 
-  - Enhanced support for image entry descriptors in TID 1600 (Image Library),
-    e.g. by adding a new method that allows for moving common image entry
-    descriptors automatically to their respective image group.
+  - Added new and enhanced existing code examples for this module.
 
-  - Added new method that allows for adding extra content items to extensible
-    SR templates.
+- Enhanced Worklist SCP code to make use of existing classes and functions
+  instead of using its own "spaghetti" code for everything.  This also
+  resolves issues with the Worklist SCP rejecting some legit Worklist queries
+  as its own verification functions were too strict.
 
-  - Further enhanced iterating an SR document tree, e.g. by providing a new
-    filter mechanism that allows for matching document tree nodes based on a
-    variety of properties like value type and concept name.
+- Added method getNumberOfValues() to all VR and other classes that are
+  derived from DcmObject (such as DcmItem).  This new method always returns
+  the number of values currently stored in the corresponding object/element,
+  in contrast to getVM(), which sometimes returns the constant 1, or card(),
+  which is not available for all classes.
 
-  - Added another gotoNode() method to tree and cursor class, which searches for
-    a particular tree node by its value.
+- The ACSE timeout, e.g. passed to the various networking command line tools
+  using --acse-timeout, is now also used for the first PDU to be read.  This is
+  another step towards cleaning up the timeout handling in dcmnet module.
 
-  - Added "equal" and "not equal" comparison operators to all document tree node
-    and underlying value classes as well as to the wrapper class for "SR content
-    items".
+- Replaced all calls of strcpy() by OFStandard::strlcpy(), which should reduce
+  the possibility of buffer overflows.  Also added OFStandard::snprintf() and
+  OFStandard::vsnprintf(), which should be used within the DCMTK as safe and
+  portable helper functions.
 
-  - Updated mapping of the Defined Terms for Body Part Examined in the class
-    that implements CID 4031 (Common Anatomic Regions) based on DICOM 2017e.
+- Fixed bug in dcmseg that produced broken binary Segmentation objects if the
+  number of pixels were not dividable by 8 for a single frame.
 
-  - Many further improvements in order to stay up-to-date with development of
-    the DICOM standard and to make it easier to use this module and its classes.
+- Enhanced Worklist SCP code to make use of existing classes and functions
+  instead of using its own "spaghetti" code for everything.  This also
+  resolves issues with the Worklist SCP rejecting some legit Worklist queries
+  as its own verification functions were too strict.
 
-- Added options to findscu that extract the C-FIND response datasets to XML
-  files (either a single file with all responses or separate files for each
-  response, similar to the existing --extract option).
+- Introduced a subset of std::filesystem to ofstd, currently providing the
+  classes OFpath, OFdirectory_entry and OFdirectory_iterator as portable
+  implementations for the respective C++17 STL classes.
 
-- Added option --socket-timeout to echoscu (same as for e.g. storescu).
+- The Windows implementation of class OFReadWriteLock class now uses Slim
+  Reader/Writer (SRW) Locks, which are available since Windows Vista, instead
+  of the older implementation based on a Mutex, a Semaphore and a counter,
+  because SRW locks are much faster.
 
-- Consistently use the default value "MEDIUM" for Priority in all DIMSE request
-  messages, i.e. for C-STORE, C-FIND, C-GET and C-MOVE.
+- Changed version numbering of shared objects.  On Posix operating systems,
+  it now follows these guidelines: https://autotools.io/libtool/version.html.
 
-- Fixed various issues that occurred after the official 3.6.2 release.
+- Fixed various issues that occurred after the official 3.6.3 release.
+  See CHANGES file for details.
 
 
 Many people have contributed to this new release of DCMTK, appearing here in
 alphabetical order.  Thank you very much for your support!
 
-  Domen Soklic <domen.soklic@cosylab.com>
+  Klaus Eisentraut <klaus.eisentraut@siemens-healthineers.com>
+  Andrey Fedorov <andrey.fedorov@gmail.com>
+  Florian Franzen <Florian.Franzen@caesar.de>
+  Christian Fremgen <Christian.Fremgen@ith-icoserve.com>
+  Omar Ganiev <beched@deteact.com>
+  Daniel Grieger <Daniel.Grieger@ith-icoserve.com>
+  Helmut Grohne <helmut@subdivi.de>
   GwanYeong Kim <gy741.kim@gmail.com>
-  Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
-  Joerg Koenig <joerg.koenig@zeiss.com>
-  Michael Craggs <Michael.Craggs@ith-icoserve.com>
   Peter Klotz <Peter.Klotz@ith-icoserve.com>
-
-  Helmut Steiner
-  Max Smolens
-  Martin Strunz
-  Sergei Khlutchin
-
-  Forum user "Hafiz Rafeeq"
-  Forum user "sfzhang"
+  Mathieu Malaterre <mathieu.malaterre@gmail.com>
+  Savvas Metallidis <savvas.metallidis@infomedcs.com>
+  Isaiah Norton <inorton@bwh.harvard.edu>
+  Lukas Raesenhoeft <lukas@raesenhoeft.com>
+  Uli Schlachter <psychon@znc.in>
+  Max Smolens (github user msmolens)
+  Christian Wetzel <wetzel@phoenix-pacs.de>
+  Gert Wollny <gw.fossdev@gmail.com>
+  Sahab Zanjanizadeh <Sahab.Zanjanizadeh@ge.com>
+
+  Thomas Dement
+  Hans Johnson (GitHub user "hjmjohnson")
+
+  Forum user "deepakt"
+  GitHub user "sercxjo"
 
 Members of the DCMTK Team who have worked on this release are
 (in alphabetical order):
 
+  Pedro Arizpe Gomez <arizpegomez@offis.de>
   Marco Eichelberg <eichelberg@offis.de>
   Michael Onken <onken@open-connections.de>
   Joerg Riesmeier <dicom@jriesmeier.com>
@@ -106,13 +153,12 @@ Members of the DCMTK Team who have worked on this release are
 Student associates:
 
   Nikolas Goldhammer <nikolasgoldhammer@gmail.com>
-  Sebastian Grallert <Grallert.Sebastian@web.de>
 
 Also see CREDITS file for projects and companies who have been generously
 supporting DCMTK.
 
 The DCMTK software can be downloaded via:
 
-  http://dicom.offis.de/dcmtk or http://www.dcmtk.org/
+  https://dicom.offis.de/dcmtk or https://www.dcmtk.org/
 
-OFFIS e.V., Oldenburg, Germany, 2018-02-05
+OFFIS e.V., Oldenburg, Germany, 2018-11-29
index cbbff906443955d3da2418f07543b6d643227e61..de829f66b8dae24332ef238324a008c66f6bc44f 100644 (file)
-IF(WIN32 AND NOT MINGW)
+if(WIN32 AND NOT MINGW)
 
   # For Windows, we don't used FIND_PACKAGE because DCMTK usually is used with its
   # own set of 3rd-party support libraries that can be downloaded from DCMTK's
   # website (pre-built).
 
   # libxml support: find out whether user has library
-  FILE(GLOB LIBXML_DIR "${DCMTK_SOURCE_DIR}/../libxml2*")
-  FIND_PATH(WITH_LIBXMLINC "/include/libxml/parser.h" "${LIBXML_DIR}" NO_DEFAULT_PATH)
+  file(GLOB LIBXML_DIR "${DCMTK_SOURCE_DIR}/../libxml2*")
+  find_path(WITH_LIBXMLINC "/include/libxml/parser.h" "${LIBXML_DIR}" NO_DEFAULT_PATH)
 
   # libpng support: find out whether user has library
-  FILE(GLOB LIBPNG_DIR "${DCMTK_SOURCE_DIR}/../libpng*")
-  FIND_PATH(WITH_LIBPNGINC "include/png.h" "${LIBPNG_DIR}" NO_DEFAULT_PATH)
+  file(GLOB LIBPNG_DIR "${DCMTK_SOURCE_DIR}/../libpng*")
+  find_path(WITH_LIBPNGINC "include/png.h" "${LIBPNG_DIR}" NO_DEFAULT_PATH)
 
   # libtiff support: find out whether user has library
-  FILE(GLOB LIBTIFF_DIR "${DCMTK_SOURCE_DIR}/../libtiff*")
-  FIND_PATH(WITH_LIBTIFFINC "include/tiff.h" "${LIBTIFF_DIR}" NO_DEFAULT_PATH)
+  file(GLOB LIBTIFF_DIR "${DCMTK_SOURCE_DIR}/../libtiff*")
+  find_path(WITH_LIBTIFFINC "include/tiff.h" "${LIBTIFF_DIR}" NO_DEFAULT_PATH)
 
   # OpenSSL support: find out whether user has library
-  FILE(GLOB OPENSSL_DIR "${DCMTK_SOURCE_DIR}/../openssl*")
-  FIND_PATH(WITH_OPENSSLINC "include/openssl/ssl.h" "${OPENSSL_DIR}" NO_DEFAULT_PATH)
+  file(GLOB OPENSSL_DIR "${DCMTK_SOURCE_DIR}/../openssl*")
+  find_path(WITH_OPENSSLINC "include/openssl/ssl.h" "${OPENSSL_DIR}" NO_DEFAULT_PATH)
 
   # zlib support: find out whether user has library
-  FILE(GLOB ZLIB_DIR "${DCMTK_SOURCE_DIR}/../zlib*")
-  FIND_PATH(WITH_ZLIBINC "include/zlib.h" "${ZLIB_DIR}" NO_DEFAULT_PATH)
+  file(GLOB ZLIB_DIR "${DCMTK_SOURCE_DIR}/../zlib*")
+  find_path(WITH_ZLIBINC "include/zlib.h" "${ZLIB_DIR}" NO_DEFAULT_PATH)
 
   # sndfile support: find out whether user has library. Needed for module dcmwave (not in public DCMTK yet, marked as advanced)
-  FILE(GLOB SNDFILE_DIR "${DCMTK_SOURCE_DIR}/../libsndfile*")
-  FIND_PATH(WITH_SNDFILEINC "sndfile.h" "${SNDFILE_DIR}" NO_DEFAULT_PATH)
-  MARK_AS_ADVANCED(SNDFILE_DIR WITH_SNDFILEINC)
+  file(GLOB SNDFILE_DIR "${DCMTK_SOURCE_DIR}/../libsndfile*")
+  find_path(WITH_SNDFILEINC "sndfile.h" "${SNDFILE_DIR}" NO_DEFAULT_PATH)
+  mark_as_advanced(SNDFILE_DIR WITH_SNDFILEINC)
 
   # libiconv support: find out whether user has library
-  FILE(GLOB LIBICONV_DIR "${DCMTK_SOURCE_DIR}/../libiconv*")
-  FIND_PATH(WITH_LIBICONVINC "include/iconv.h" "${LIBICONV_DIR}" NO_DEFAULT_PATH)
+  file(GLOB LIBICONV_DIR "${DCMTK_SOURCE_DIR}/../libiconv*")
+  find_path(WITH_LIBICONVINC "include/iconv.h" "${LIBICONV_DIR}" NO_DEFAULT_PATH)
 
   # libxml support: configure compiler
-  IF(DCMTK_WITH_XML)
-    IF(WITH_LIBXMLINC)
-      SET(LIBXML_INCDIR "${WITH_LIBXMLINC}/include")
-      SET(LIBXML_LIBDIR "${WITH_LIBXMLINC}/lib")
-      SET(LIBXML_LIBS debug "${LIBXML_LIBDIR}/libxml2_d.lib" optimized "${LIBXML_LIBDIR}/libxml2_o.lib" debug "${LIBXML_LIBDIR}/iconv_d.lib" optimized "${LIBXML_LIBDIR}/iconv_o.lib")
-      MESSAGE(STATUS "Info: DCMTK XML support will be enabled")
-      SET(WITH_LIBXML 1)
+  if(DCMTK_WITH_XML)
+    if(WITH_LIBXMLINC)
+      set(LIBXML_INCDIR "${WITH_LIBXMLINC}/include")
+      set(LIBXML_LIBDIR "${WITH_LIBXMLINC}/lib")
+      set(LIBXML_LIBS debug "${LIBXML_LIBDIR}/libxml2_d.lib" optimized "${LIBXML_LIBDIR}/libxml2_o.lib" debug "${LIBXML_LIBDIR}/iconv_d.lib" optimized "${LIBXML_LIBDIR}/iconv_o.lib")
+      message(STATUS "Info: DCMTK XML support will be enabled")
+      set(WITH_LIBXML 1)
       # this hides some warnings that are emitted when linking against libxmlXXX.lib instead of linking the DLL directly
-      ADD_DEFINITIONS("-DLIBXML_STATIC")
-    ELSE(WITH_LIBXMLINC) # turn off library if library path not set
-      MESSAGE(STATUS "Warning: XML support will be disabled because libxml2 directory is not specified. Correct path and re-enable DCMTK_WITH_XML.")
-      SET(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE)
-      SET(WITH_LIBXML "")
-    ENDIF(WITH_LIBXMLINC)
-  ENDIF(DCMTK_WITH_XML)
+      add_definitions("-DLIBXML_STATIC")
+    else() # turn off library if library path not set
+      message(STATUS "Warning: XML support will be disabled because libxml2 directory is not specified. Correct path and re-enable DCMTK_WITH_XML.")
+      set(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE)
+      set(WITH_LIBXML "")
+    endif()
+  endif()
 
   # libpng support: configure compiler
-  IF(DCMTK_WITH_PNG)
-    IF(WITH_LIBPNGINC)
-      SET(LIBPNG_INCDIR "${WITH_LIBPNGINC}/include")
-      SET(LIBPNG_LIBDIR "${WITH_LIBPNGINC}/lib")
-      SET(LIBPNG_LIBS debug "${LIBPNG_LIBDIR}/libpng_d.lib" optimized "${LIBPNG_LIBDIR}/libpng_o.lib")
-      MESSAGE(STATUS "Info: DCMTK PNG support will be enabled")
-      SET(WITH_LIBPNG 1)
-    ELSE(WITH_LIBPNGINC) # turn off library if library path not set
-      MESSAGE(STATUS "Warning: PNG support will be disabled because libpng directory was not specified. Correct path and re-enable DCMTK_WITH_PNG.")
-      SET(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE)
-      SET(WITH_LIBPNG "")
-    ENDIF(WITH_LIBPNGINC)
-  ENDIF(DCMTK_WITH_PNG)
+  if(DCMTK_WITH_PNG)
+    if(WITH_LIBPNGINC)
+      set(LIBPNG_INCDIR "${WITH_LIBPNGINC}/include")
+      set(LIBPNG_LIBDIR "${WITH_LIBPNGINC}/lib")
+      set(LIBPNG_LIBS debug "${LIBPNG_LIBDIR}/libpng_d.lib" optimized "${LIBPNG_LIBDIR}/libpng_o.lib")
+      message(STATUS "Info: DCMTK PNG support will be enabled")
+      set(WITH_LIBPNG 1)
+    else() # turn off library if library path not set
+      message(STATUS "Warning: PNG support will be disabled because libpng directory was not specified. Correct path and re-enable DCMTK_WITH_PNG.")
+      set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE)
+      set(WITH_LIBPNG "")
+    endif()
+  endif()
 
   # libtiff support: configure compiler
-  IF(DCMTK_WITH_TIFF)
-    IF(WITH_LIBTIFFINC)
-      SET(LIBTIFF_INCDIR "${WITH_LIBTIFFINC}/include")
-      SET(LIBTIFF_LIBDIR "${WITH_LIBTIFFINC}/lib")
-      SET(LIBTIFF_LIBS debug "${LIBTIFF_LIBDIR}/libtiff_d.lib" optimized "${LIBTIFF_LIBDIR}/libtiff_o.lib")
-      MESSAGE(STATUS "Info: DCMTK TIFF support will be enabled")
-      SET(WITH_LIBTIFF 1)
-    ELSE(WITH_LIBTIFFINC) # turn off library if library path not set
-      MESSAGE(STATUS "Warning: TIFF support will be disabled because libtiff directory was not specified. Correct path and re-enable DCMTK_WITH_TIFF.")
-      SET(DCMTK_WITH_TIFF OFF CACHE BOOL "" FORCE)
-      SET(WITH_LIBTIFF "")
-    ENDIF(WITH_LIBTIFFINC)
-  ENDIF(DCMTK_WITH_TIFF)
+  if(DCMTK_WITH_TIFF)
+    if(WITH_LIBTIFFINC)
+      set(LIBTIFF_INCDIR "${WITH_LIBTIFFINC}/include")
+      set(LIBTIFF_LIBDIR "${WITH_LIBTIFFINC}/lib")
+      set(LIBTIFF_LIBS debug "${LIBTIFF_LIBDIR}/libtiff_d.lib" optimized "${LIBTIFF_LIBDIR}/libtiff_o.lib")
+      message(STATUS "Info: DCMTK TIFF support will be enabled")
+      set(WITH_LIBTIFF 1)
+    else() # turn off library if library path not set
+      message(STATUS "Warning: TIFF support will be disabled because libtiff directory was not specified. Correct path and re-enable DCMTK_WITH_TIFF.")
+      set(DCMTK_WITH_TIFF OFF CACHE BOOL "" FORCE)
+      set(WITH_LIBTIFF "")
+    endif()
+  endif()
 
   # OpenSSL support: configure compiler
-  IF(DCMTK_WITH_OPENSSL)
-    IF(WITH_OPENSSLINC)
-      SET(OPENSSL_BINDIR "${WITH_OPENSSLINC}/bin")
-      SET(OPENSSL_INCDIR "${WITH_OPENSSLINC}/include")
-      SET(OPENSSL_LIBDIR "${WITH_OPENSSLINC}/lib")
+  if(DCMTK_WITH_OPENSSL)
+    if(WITH_OPENSSLINC)
+      include(CheckCXXSourceCompiles)
+      set(OPENSSL_BINDIR "${WITH_OPENSSLINC}/bin")
+      set(OPENSSL_INCDIR "${WITH_OPENSSLINC}/include")
+      set(OPENSSL_LIBDIR "${WITH_OPENSSLINC}/lib")
       # starting with OpenSSL 1.1.0, the Windows crypt32 library is needed for a static link of OpenSSL.
-      SET(OPENSSL_LIBS "crypt32" debug "${OPENSSL_LIBDIR}/dcmtkssl_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkssl_o.lib" debug "${OPENSSL_LIBDIR}/dcmtkcrypto_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkcrypto_o.lib")
-      MESSAGE(STATUS "Info: DCMTK OPENSSL support will be enabled")
-      SET(WITH_OPENSSL 1)
-    ELSE(WITH_OPENSSLINC) # turn off library if library path not set
-      MESSAGE(STATUS "Warning: OPENSSL support will be disabled because openssl directory was not specified. Correct path and re-enable DCMTK_WITH_OPENSSL.")
-      SET(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE)
-      SET(WITH_OPENSSL "")
-    ENDIF(WITH_OPENSSLINC)
-  ENDIF(DCMTK_WITH_OPENSSL)
+      set(OPENSSL_LIBS "crypt32" debug "${OPENSSL_LIBDIR}/dcmtkssl_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkssl_o.lib" debug "${OPENSSL_LIBDIR}/dcmtkcrypto_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkcrypto_o.lib")
+      set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
+      list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}")
+      CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include <openssl/ssl.h>\n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK)
+      set(CMAKE_REQUIRED_INCLUDES "${TEMP_INCLUDES}")
+      if(OPENSSL_VERSION_CHECK)
+        message(STATUS "Info: DCMTK OPENSSL support will be enabled")
+        set(WITH_OPENSSL 1)
+      else()
+        message(STATUS "Info: DCMTK OPENSSL support will be disabled: DCMTK requires OpenSSL version 1.0.1 or newer")
+        set(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE)
+        set(WITH_OPENSSL "")
+      endif()
+    else() # turn off library if library path not set
+      message(STATUS "Warning: OPENSSL support will be disabled because openssl directory was not specified. Correct path and re-enable DCMTK_WITH_OPENSSL.")
+      set(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE)
+      set(WITH_OPENSSL "")
+    endif()
+  endif()
 
   # zlib support: configure compiler
-  IF(DCMTK_WITH_ZLIB)
-    IF(WITH_ZLIBINC)
-      SET(ZLIB_INCDIR "${WITH_ZLIBINC}/include")
-      SET(ZLIB_LIBDIR "${WITH_ZLIBINC}/lib")
-      SET(ZLIB_LIBS debug "${ZLIB_LIBDIR}/zlib_d.lib" optimized "${ZLIB_LIBDIR}/zlib_o.lib")
-      MESSAGE(STATUS "Info: DCMTK ZLIB support will be enabled")
-      SET(WITH_ZLIB 1)
-    ELSE(WITH_ZLIBINC) # turn off library if library path not set
-      MESSAGE(STATUS "Warning: ZLIB support will be disabled because zlib directory was not specified. Correct path and re-enable DCMTK_WITH_ZLIB.")
-      SET(DCMTK_WITH_ZLIB OFF CACHE BOOL "" FORCE)
-      SET(WITH_ZLIB "")
-    ENDIF(WITH_ZLIBINC)
-  ENDIF(DCMTK_WITH_ZLIB)
+  if(DCMTK_WITH_ZLIB)
+    if(WITH_ZLIBINC)
+      set(ZLIB_INCDIR "${WITH_ZLIBINC}/include")
+      set(ZLIB_LIBDIR "${WITH_ZLIBINC}/lib")
+      set(ZLIB_LIBS debug "${ZLIB_LIBDIR}/zlib_d.lib" optimized "${ZLIB_LIBDIR}/zlib_o.lib")
+      message(STATUS "Info: DCMTK ZLIB support will be enabled")
+      set(WITH_ZLIB 1)
+    else() # turn off library if library path not set
+      message(STATUS "Warning: ZLIB support will be disabled because zlib directory was not specified. Correct path and re-enable DCMTK_WITH_ZLIB.")
+      set(DCMTK_WITH_ZLIB OFF CACHE BOOL "" FORCE)
+      set(WITH_ZLIB "")
+    endif()
+  endif()
 
   # sndfile support: configure compiler
-  IF(DCMTK_WITH_SNDFILE)
-    IF(WITH_SNDFILEINC)
-      SET(SNDFILE_INCDIR "${WITH_SNDFILEINC}/include")
-      SET(SNDFILE_LIBDIR "${WITH_SNDFILEINC}/lib")
-      SET(SNDFILE_LIBS debug "${SNDFILE_LIBDIR}/libsndfile_d.lib" optimized "${SNDFILE_LIBDIR}/libsndfile_o.lib")
-      MESSAGE(STATUS "Info: DCMTK SNDFILE support will be enabled")
-      SET(WITH_SNDFILE 1)
-    ELSE(WITH_SNDFILEINC) # turn off library if library path not set
-      MESSAGE(STATUS "Warning: SNDFILE support will be disabled because libsndfile directory was not specified. Correct path and re-enable DCMTK_WITH_SNDFILE.")
-      SET(DCMTK_WITH_SNDFILE OFF CACHE BOOL "" FORCE)
-      SET(WITH_SNDFILE "")
-    ENDIF(WITH_SNDFILEINC)
-  ENDIF(DCMTK_WITH_SNDFILE)
+  if(DCMTK_WITH_SNDFILE)
+    if(WITH_SNDFILEINC)
+      set(SNDFILE_INCDIR "${WITH_SNDFILEINC}/include")
+      set(SNDFILE_LIBDIR "${WITH_SNDFILEINC}/lib")
+      set(SNDFILE_LIBS debug "${SNDFILE_LIBDIR}/libsndfile_d.lib" optimized "${SNDFILE_LIBDIR}/libsndfile_o.lib")
+      message(STATUS "Info: DCMTK SNDFILE support will be enabled")
+      set(WITH_SNDFILE 1)
+    else() # turn off library if library path not set
+      message(STATUS "Warning: SNDFILE support will be disabled because libsndfile directory was not specified. Correct path and re-enable DCMTK_WITH_SNDFILE.")
+      set(DCMTK_WITH_SNDFILE OFF CACHE BOOL "" FORCE)
+      set(WITH_SNDFILE "")
+    endif()
+  endif()
 
   # libiconv support: configure compiler
-  IF(DCMTK_WITH_ICONV)
-    IF(WITH_LIBICONVINC)
-      SET(LIBICONV_INCDIR "${WITH_LIBICONVINC}/include")
-      SET(LIBICONV_LIBDIR "${WITH_LIBICONVINC}/lib")
-      SET(LIBICONV_LIBS debug "${LIBICONV_LIBDIR}/libiconv_d.lib" optimized "${LIBICONV_LIBDIR}/libiconv_o.lib")
-      MESSAGE(STATUS "Info: DCMTK ICONV support will be enabled")
-      SET(WITH_LIBICONV 1)
-    ELSE(WITH_LIBICONVINC) # turn off library if library path not set
-      MESSAGE(STATUS "Warning: ICONV support will be disabled because libiconv directory was not specified. Correct path and re-enable DCMTK_WITH_ICONV.")
-      SET(DCMTK_WITH_ICONV OFF CACHE BOOL "" FORCE)
-      SET(WITH_LIBICONV "")
-    ENDIF(WITH_LIBICONVINC)
-  ENDIF(DCMTK_WITH_ICONV)
+  if(DCMTK_WITH_ICONV)
+    if(WITH_LIBICONVINC)
+      set(LIBICONV_INCDIR "${WITH_LIBICONVINC}/include")
+      set(LIBICONV_LIBDIR "${WITH_LIBICONVINC}/lib")
+      set(LIBICONV_LIBS debug "${LIBICONV_LIBDIR}/libiconv_d.lib" optimized "${LIBICONV_LIBDIR}/libiconv_o.lib")
+      message(STATUS "Info: DCMTK ICONV support will be enabled")
+      set(WITH_LIBICONV 1)
+    else() # turn off library if library path not set
+      message(STATUS "Warning: ICONV support will be disabled because libiconv directory was not specified. Correct path and re-enable DCMTK_WITH_ICONV.")
+      set(DCMTK_WITH_ICONV OFF CACHE BOOL "" FORCE)
+      set(WITH_LIBICONV "")
+    endif()
+  endif()
 
-ELSE(WIN32 AND NOT MINGW)
+else()
 
   # Find TIFF
-  IF(DCMTK_WITH_TIFF)
-    FIND_PACKAGE(TIFF QUIET)
+  if(DCMTK_WITH_TIFF)
+    find_package(TIFF QUIET)
     # turn off library if it could not be found
-    IF(NOT TIFF_FOUND)
-      MESSAGE(STATUS "Warning: TIFF support will be disabled because libtiff was not found.")
-      SET(DCMTK_WITH_TIFF OFF CACHE BOOL "" FORCE)
-      SET(WITH_LIBTIFF "")
-    ELSE(NOT TIFF_FOUND)
-      MESSAGE(STATUS "Info: DCMTK TIFF support will be enabled")
-      SET(WITH_LIBTIFF 1)
+    if(NOT TIFF_FOUND)
+      message(STATUS "Warning: TIFF support will be disabled because libtiff was not found.")
+      set(DCMTK_WITH_TIFF OFF CACHE BOOL "" FORCE)
+      set(WITH_LIBTIFF "")
+    else()
+      message(STATUS "Info: DCMTK TIFF support will be enabled")
+      set(WITH_LIBTIFF 1)
       # libtiff can be compiled with libjpeg support; if available, add libjpeg to library and include path
-      FIND_PACKAGE(JPEG QUIET)
-      INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR})
-      SET(LIBTIFF_LIBS ${TIFF_LIBRARY} ${JPEG_LIBRARY})
-    ENDIF(NOT TIFF_FOUND)
-  ENDIF(DCMTK_WITH_TIFF)
+      find_package(JPEG QUIET)
+      include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR})
+      set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${JPEG_LIBRARY})
+    endif()
+  endif()
 
   # Find PNG
-  IF(DCMTK_WITH_PNG)
-    FIND_PACKAGE(PNG QUIET)
-    IF(NOT PNG_FOUND)
-      SET(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE)
-      MESSAGE(STATUS "Warning: PNG support will be disabled because libpng was not found.")
-      SET(WITH_LIBPNG "")
-    ELSE(NOT PNG_FOUND)
-      MESSAGE(STATUS "Info: DCMTK PNG support will be enabled")
-      SET(WITH_LIBPNG 1)
-      INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
-      SET(LIBPNG_LIBS ${PNG_LIBRARY})
-    ENDIF(NOT PNG_FOUND)
-  ENDIF(DCMTK_WITH_PNG)
+  if(DCMTK_WITH_PNG)
+    find_package(PNG QUIET)
+    if(NOT PNG_FOUND)
+      set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE)
+      message(STATUS "Warning: PNG support will be disabled because libpng was not found.")
+      set(WITH_LIBPNG "")
+    else()
+      message(STATUS "Info: DCMTK PNG support will be enabled")
+      set(WITH_LIBPNG 1)
+      include_directories(${PNG_INCLUDE_DIR})
+      set(LIBPNG_LIBS ${PNG_LIBRARY})
+    endif()
+  endif()
 
   # Find OpenSSL
-  IF(DCMTK_WITH_OPENSSL)
-    FIND_PACKAGE(OpenSSL QUIET)
-    IF(NOT OPENSSL_FOUND)
-      MESSAGE(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.")
-      SET(WITH_OPENSSL "")
-      SET(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE)
-    ELSE(NOT OPENSSL_FOUND)
-      MESSAGE(STATUS "Info: DCMTK OPENSSL support will be enabled")
-      SET(WITH_OPENSSL 1)
-      INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
-      SET(OPENSSL_LIBS ${OPENSSL_LIBRARIES})
-    ENDIF(NOT OPENSSL_FOUND)
-  ENDIF(DCMTK_WITH_OPENSSL)
+  if(DCMTK_WITH_OPENSSL)
+    find_package(OpenSSL QUIET)
+    if(NOT OPENSSL_FOUND)
+      message(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.")
+      set(WITH_OPENSSL "")
+      set(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE)
+    else()
+      include(CheckLibraryExists)
+      include(CheckCXXSourceCompiles)
+      CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include <openssl/ssl.h>\n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK)
+      if(OPENSSL_VERSION_CHECK)
+        message(STATUS "Info: DCMTK OPENSSL support will be enabled")
+        set(WITH_OPENSSL 1)
+        include_directories(${OPENSSL_INCLUDE_DIR})
+        set(OPENSSL_LIBS ${OPENSSL_LIBRARIES})
+        CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL)
+        if(HAVE_LIBDL)
+          set(OPENSSL_LIBS ${OPENSSL_LIBS} dl)
+        endif()
+      else()
+        message(STATUS "Info: DCMTK OPENSSL support will be disabled: DCMTK requires OpenSSL version 1.0.1 or newer")
+        set(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE)
+        set(WITH_OPENSSL "")
+      endif()
+    endif()
+  endif()
 
   # Find libXML2
-  IF(DCMTK_WITH_XML)
-    FIND_PACKAGE(LibXml2 QUIET)
-    IF(NOT LIBXML2_FOUND)
-      MESSAGE(STATUS "Warning: XML support will be disabled because libxml2 was not found.")
-      SET(WITH_LIBXML "")
-      SET(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE)
-    ELSE(NOT LIBXML2_FOUND)
-      MESSAGE(STATUS "Info: DCMTK XML support will be enabled")
-      SET(WITH_LIBXML 1)
-      INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
-      SET(LIBXML_LIBS ${LIBXML2_LIBRARIES})
-    ENDIF(NOT LIBXML2_FOUND)
-  ENDIF(DCMTK_WITH_XML)
+  if(DCMTK_WITH_XML)
+    find_package(LibXml2 QUIET)
+    if(NOT LIBXML2_FOUND)
+      message(STATUS "Warning: XML support will be disabled because libxml2 was not found.")
+      set(WITH_LIBXML "")
+      set(DCMTK_WITH_XML OFF CACHE BOOL "" FORCE)
+    else()
+      message(STATUS "Info: DCMTK XML support will be enabled")
+      set(WITH_LIBXML 1)
+      include_directories(${LIBXML2_INCLUDE_DIR})
+      set(LIBXML_LIBS ${LIBXML2_LIBRARIES})
+    endif()
+  endif()
 
   # Find zlib
-  IF(DCMTK_WITH_ZLIB)
-    FIND_PACKAGE(ZLIB QUIET)
-    IF(NOT ZLIB_FOUND)
-      MESSAGE(STATUS "Warning: ZLIB support will be disabled because zlib was not found.")
-      SET(WITH_ZLIB "")
-      SET(DCMTK_WITH_ZLIB OFF CACHE BOOL "" FORCE)
-    ELSE(NOT ZLIB_FOUND)
-      MESSAGE(STATUS "Info: DCMTK ZLIB support will be enabled")
-      SET(WITH_ZLIB 1)
-      INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
-      SET(ZLIB_LIBS ${ZLIB_LIBRARIES})
-    ENDIF(NOT ZLIB_FOUND)
-  ENDIF(DCMTK_WITH_ZLIB)
+  if(DCMTK_WITH_ZLIB)
+    find_package(ZLIB QUIET)
+    if(NOT ZLIB_FOUND)
+      message(STATUS "Warning: ZLIB support will be disabled because zlib was not found.")
+      set(WITH_ZLIB "")
+      set(DCMTK_WITH_ZLIB OFF CACHE BOOL "" FORCE)
+    else()
+      message(STATUS "Info: DCMTK ZLIB support will be enabled")
+      set(WITH_ZLIB 1)
+      include_directories(${ZLIB_INCLUDE_DIRS})
+      set(ZLIB_LIBS ${ZLIB_LIBRARIES})
+    endif()
+  endif()
 
   # Find libsndfile
-  IF(DCMTK_WITH_SNDFILE)
-    FIND_PACKAGE(Sndfile QUIET)
-    IF(NOT SNDFILE_LIBS)
-      MESSAGE(STATUS "Warning: SNDFILE support will be disabled because libsndfile was not found.")
-      SET(WITH_SNDFILE "")
-      SET(DCMTK_WITH_SNDFILE OFF CACHE BOOL "" FORCE)
-    ELSE(NOT SNDFILE_LIBS)
-      MESSAGE(STATUS "Info: DCMTK SNDFILE support will be enabled")
-      SET(WITH_SNDFILE 1)
-      INCLUDE_DIRECTORIES(${SNDFILE_INCLUDE_DIRS})
-      SET(SNDFILE_LIBS ${SNDFILE_LIBRARIES})
-    ENDIF(NOT SNDFILE_LIBS)
-  ENDIF(DCMTK_WITH_SNDFILE)
+  if(DCMTK_WITH_SNDFILE)
+    find_package(Sndfile QUIET)
+    if(NOT SNDFILE_LIBS)
+      message(STATUS "Warning: SNDFILE support will be disabled because libsndfile was not found.")
+      set(WITH_SNDFILE "")
+      set(DCMTK_WITH_SNDFILE OFF CACHE BOOL "" FORCE)
+    else()
+      message(STATUS "Info: DCMTK SNDFILE support will be enabled")
+      set(WITH_SNDFILE 1)
+      include_directories(${SNDFILE_INCLUDE_DIRS})
+      set(SNDFILE_LIBS ${SNDFILE_LIBRARIES})
+    endif()
+  endif()
 
   # Find libiconv
-  IF(DCMTK_WITH_ICONV)
-    FIND_PACKAGE(ICONV QUIET)
-    FIND_PACKAGE(Charset QUIET)
-    IF(NOT LIBICONV_FOUND OR NOT LIBCHARSET_FOUND)
-      MESSAGE(STATUS "Warning: ICONV support will be disabled because libiconv was not found. Correct LIBICONV_LIBDIR and LIBICONV_INCLUDE_DIR and re-enable DCMTK_WITH_ICONV.")
-      SET(DCMTK_WITH_ICONV OFF CACHE BOOL "" FORCE)
-      SET(WITH_LIBICONV "")
-    ELSE(NOT LIBICONV_FOUND OR NOT LIBCHARSET_FOUND)
-      MESSAGE(STATUS "Info: DCMTK ICONV support will be enabled")
-      SET(WITH_LIBICONV 1)
-      SET(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${LIBCHARSET_INCLUDE_DIRS})
-      SET(LIBICONV_LIBDIR ${LIBICONV_LIBDIR})
-      SET(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${LIBCHARSET_LIBRARY})
-      INCLUDE_DIRECTORIES(${LIBICONV_INCDIR})
-    ENDIF(NOT LIBICONV_FOUND OR NOT LIBCHARSET_FOUND)
-  ENDIF(DCMTK_WITH_ICONV)
+  if(DCMTK_WITH_ICONV)
+    find_package(Iconv QUIET)
+    find_package(Charset QUIET)
+    if(ICONV_FOUND)
+        if(NOT Iconv_IS_BUILT_IN)
+            set(LIBICONV_FOUND ${ICONV_FOUND})
+        else()
+            message(STATUS "Info: found builtin ICONV support inside the C standard library.")
+            set(DCMTK_WITH_STDLIBC_ICONV ON CACHE BOOL "" FORCE)
+        endif()
+        if(DEFINED ICONV_SECOND_ARGUMENT_IS_CONST)
+            get_property(HELPSTRING CACHE ICONV_SECOND_ARGUMENT_IS_CONST PROPERTY HELPSTRING)
+            set(LIBICONV_SECOND_ARGUMENT_CONST ${ICONV_SECOND_ARGUMENT_IS_CONST} CACHE INTERNAL "${HELPSTRING}")
+        endif()
+    endif()
+    if(NOT LIBICONV_FOUND OR NOT LIBCHARSET_FOUND)
+      message(STATUS "Warning: ICONV support will be disabled because libiconv was not found. Correct LIBICONV_LIBDIR and LIBICONV_INCLUDE_DIR and re-enable DCMTK_WITH_ICONV.")
+      set(DCMTK_WITH_ICONV OFF CACHE BOOL "" FORCE)
+      set(WITH_LIBICONV "")
+    else()
+      message(STATUS "Info: DCMTK ICONV support will be enabled")
+      set(WITH_LIBICONV 1)
+      set(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR} ${LIBCHARSET_INCLUDE_DIRS})
+      set(LIBICONV_LIBDIR ${LIBICONV_LIBDIR})
+      set(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${Iconv_LIBRARIES} ${ICONV_LIBRARIES} ${LIBCHARSET_LIBRARY})
+      include_directories(${LIBICONV_INCDIR})
+    endif()
+  endif()
 
   # Find libwrap
-  IF(DCMTK_WITH_WRAP)
-    FIND_PACKAGE(Wrap QUIET)
-    IF(NOT WRAP_FOUND)
-      MESSAGE(STATUS "Warning: WRAP support will be disabled because libwrap was not found.")
-      SET(WITH_TCPWRAPPER "")
-      SET(DCMTK_WITH_WRAP OFF CACHE BOOL "" FORCE)
-    ELSE(NOT WRAP_FOUND)
-      MESSAGE(STATUS "Info: DCMTK WRAP support will be enabled")
-      SET(WITH_TCPWRAPPER 1)
-      INCLUDE_DIRECTORIES(${WRAP_INCLUDE_DIRS})
-      SET(WRAP_LIBS ${WRAP_LIBRARIES})
-    ENDIF(NOT WRAP_FOUND)
-  ENDIF(DCMTK_WITH_WRAP)
+  if(DCMTK_WITH_WRAP)
+    find_package(Wrap QUIET)
+    if(NOT WRAP_FOUND)
+      message(STATUS "Warning: WRAP support will be disabled because libwrap was not found.")
+      set(WITH_TCPWRAPPER "")
+      set(DCMTK_WITH_WRAP OFF CACHE BOOL "" FORCE)
+    else()
+      message(STATUS "Info: DCMTK WRAP support will be enabled")
+      set(WITH_TCPWRAPPER 1)
+      include_directories(${WRAP_INCLUDE_DIRS})
+      set(WRAP_LIBS ${WRAP_LIBRARIES})
+    endif()
+  endif()
 
-ENDIF()
+endif()
 
-IF(NOT DEFINED DCMTK_WITH_STDLIBC_ICONV)
-  INCLUDE(CheckCXXSourceCompiles)
+if(NOT DEFINED DCMTK_WITH_STDLIBC_ICONV)
+  include(CheckCXXSourceCompiles)
   CHECK_CXX_SOURCE_COMPILES("#include <iconv.h>\nint main(){iconv_t cd = iconv_open(\"\",\"\");iconv(cd,0,0,0,0);iconv_close(cd);return 0;}" WITH_STDLIBC_ICONV)
-  IF(WITH_STDLIBC_ICONV)
-    MESSAGE(STATUS "Info: found builtin ICONV support inside the C standard library.")
-    SET(DCMTK_WITH_STDLIBC_ICONV ON CACHE BOOL "" FORCE)
-  ELSE(WITH_STDLIBC_ICONV)
-    SET(DCMTK_WITH_STDLIBC_ICONV OFF CACHE BOOL "" FORCE)
-  ENDIF(WITH_STDLIBC_ICONV)
-ENDIF(NOT DEFINED DCMTK_WITH_STDLIBC_ICONV)
+  if(WITH_STDLIBC_ICONV)
+    message(STATUS "Info: found builtin ICONV support inside the C standard library.")
+    set(DCMTK_WITH_STDLIBC_ICONV ON CACHE BOOL "" FORCE)
+  else()
+    set(DCMTK_WITH_STDLIBC_ICONV OFF CACHE BOOL "" FORCE)
+  endif()
+endif()
 
-IF(DCMTK_WITH_ICU)
-  FIND_PACKAGE(ICU COMPONENTS uc data QUIET)
-  IF(NOT ICU_FOUND)
-    MESSAGE(STATUS "Warning: ICU support will be disabled because the ICU were not found.")
-    SET(DCMTK_WITH_ICU OFF CACHE BOOL "" FORCE)
-    SET(WITH_ICU "")
-  ELSE(NOT ICU_FOUND)
-    MESSAGE(STATUS "Info: DCMTK ICU support will be enabled")
-    SET(WITH_ICU 1)
-    SET(ICU_INCDIR ${ICU_INCLUDE_DIR})
-    SET(ICU_LIBS ${ICU_LIBRARIES})
-    INCLUDE_DIRECTORIES(${ICU_INCLUDE_DIR})
-  ENDIF(NOT ICU_FOUND)
-ENDIF(DCMTK_WITH_ICU)
+if(DCMTK_WITH_ICU)
+  find_package(ICU COMPONENTS uc data QUIET)
+  if(NOT ICU_FOUND)
+    message(STATUS "Warning: ICU support will be disabled because the ICU were not found.")
+    set(DCMTK_WITH_ICU OFF CACHE BOOL "" FORCE)
+    set(WITH_ICU "")
+  else()
+    message(STATUS "Info: DCMTK ICU support will be enabled")
+    set(WITH_ICU 1)
+    set(ICU_INCDIR ${ICU_INCLUDE_DIR})
+    set(ICU_LIBS ${ICU_LIBRARIES})
+    include_directories(${ICU_INCLUDE_DIR})
+  endif()
+endif()
 
 # Find doxygen
-IF(DCMTK_WITH_DOXYGEN)
-  FIND_PACKAGE(Doxygen QUIET) # will set variable DOXYGEN_EXECUTABLE
-  IF(NOT DOXYGEN_FOUND)
-    MESSAGE(STATUS "Warning: DOXYGEN support will be disabled because doxygen was not found.")
-    SET(DCMTK_WITH_DOXYGEN OFF CACHE BOOL "" FORCE)
-  ENDIF(NOT DOXYGEN_FOUND)
-ENDIF(DCMTK_WITH_DOXYGEN)
+if(DCMTK_WITH_DOXYGEN)
+  find_package(Doxygen QUIET) # will set variable DOXYGEN_EXECUTABLE
+  if(NOT DOXYGEN_FOUND)
+    message(STATUS "Warning: DOXYGEN support will be disabled because doxygen was not found.")
+    set(DCMTK_WITH_DOXYGEN OFF CACHE BOOL "" FORCE)
+  endif()
+endif()
 
-IF(DCMTK_WITH_ICONV OR DCMTK_WITH_STDLIBC_ICONV)
-  INCLUDE(CheckCXXSourceCompiles)
-  SET(CMAKE_REQUIRED_INCLUDES ${LIBICONV_INCDIR})
-  SET(CMAKE_REQUIRED_LIBRARIES ${LIBICONV_LIBS})
+if(DCMTK_WITH_ICONV OR DCMTK_WITH_STDLIBC_ICONV)
+  include(CheckCXXSourceCompiles)
+  set(CMAKE_REQUIRED_INCLUDES ${LIBICONV_INCDIR})
+  set(CMAKE_REQUIRED_LIBRARIES ${LIBICONV_LIBS})
   CHECK_CXX_SOURCE_COMPILES("
   #include <iconv.h>
   int main() {
@@ -319,6 +355,6 @@ IF(DCMTK_WITH_ICONV OR DCMTK_WITH_STDLIBC_ICONV)
     iconv(cd, &in, 0, 0, 0);
     return 0;
   }" LIBICONV_SECOND_ARGUMENT_CONST)
-  SET(CMAKE_REQUIRED_INCLUDES)
-  SET(CMAKE_REQUIRED_LIBRARIES)
-ENDIF(DCMTK_WITH_ICONV OR DCMTK_WITH_STDLIBC_ICONV)
+  set(CMAKE_REQUIRED_INCLUDES)
+  set(CMAKE_REQUIRED_LIBRARIES)
+endif()
index 2b93e0b28b3275a2fb01b9504d55fede83416bec..4e738fd7296cc79bc2b4f7b6afa730d64690105a 100644 (file)
@@ -5,36 +5,36 @@
 #
 
 # Restore the required settings of the CMake configuration step
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
-SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
-SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_BINARY_DIR@")
-SET(CMAKE_FILES_DIRECTORY "@CMAKE_FILES_DIRECTORY@")
-SET(CMAKE_MODULE_PATH "@CMAKE_ROOT@/Modules")
-SET(CMAKE_SHARED_LIBRARY_PREFIX "@CMAKE_SHARED_LIBRARY_PREFIX@")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX "@CMAKE_SHARED_LIBRARY_SUFFIX@")
-SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
-SET(DCMTK_CMAKE_INCLUDE "@CMAKE_SOURCE_DIR@/@DCMTK_CMAKE_INCLUDE@")
-SET(DCMTK_TEST_EXECUTABLES "@DCMTK_TEST_EXECUTABLES@")
-SET(DCMTK_ALL_LIBRARIES "@DCMTK_ALL_LIBRARIES@")
-SET(DCMTK_LIBRARY_DEPENDENCIES "@DCMTK_LIBRARY_DEPENDENCIES@")
-SET(DCMTK_PACKAGE_VERSION "@DCMTK_PACKAGE_VERSION@")
-SET(DCMTK_ABI_VERSION "@DCMTK_ABI_VERSION@")
-SET(BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
-SET(DCMTK_DICOM_DICTIONARIES "@DCMTK_DICOM_DICTIONARIES@")
-SET(ANDROID "@ANDROID@")
-SET(ANDROID_ADB_PROGRAM "@ANDROID_ADB_PROGRAM@")
-SET(ANDROID_ANDROID_PROGRAM "@ANDROID_ANDROID_PROGRAM@")
-SET(ANDROID_EMULATOR_PROGRAM "@ANDROID_EMULATOR_PROGRAM@")
-SET(ANDROID_EMULATOR_AVD "@ANDROID_EMULATOR_AVD@")
-SET(ANDROID_RUNTIME_LIBRARIES "@ANDROID_RUNTIME_LIBRARIES@")
-SET(ANDROID_TEMPORARY_FILES_LOCATION "@ANDROID_TEMPORARY_FILES_LOCATION@")
+cmake_minimum_required(VERSION 2.6)
+set(CMAKE_COMMAND "@CMAKE_COMMAND@")
+set(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
+set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_BINARY_DIR@")
+set(CMAKE_FILES_DIRECTORY "@CMAKE_FILES_DIRECTORY@")
+set(CMAKE_MODULE_PATH "@CMAKE_ROOT@/Modules")
+set(CMAKE_SHARED_LIBRARY_PREFIX "@CMAKE_SHARED_LIBRARY_PREFIX@")
+set(CMAKE_SHARED_LIBRARY_SUFFIX "@CMAKE_SHARED_LIBRARY_SUFFIX@")
+set(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
+set(DCMTK_CMAKE_INCLUDE "@CMAKE_SOURCE_DIR@/@DCMTK_CMAKE_INCLUDE@")
+set(DCMTK_TEST_EXECUTABLES "@DCMTK_TEST_EXECUTABLES@")
+set(DCMTK_ALL_LIBRARIES "@DCMTK_ALL_LIBRARIES@")
+set(DCMTK_LIBRARY_DEPENDENCIES "@DCMTK_LIBRARY_DEPENDENCIES@")
+set(DCMTK_PACKAGE_VERSION "@DCMTK_PACKAGE_VERSION@")
+set(DCMTK_ABI_VERSION "@DCMTK_ABI_VERSION@")
+set(BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
+set(DCMTK_DICOM_DICTIONARIES "@DCMTK_DICOM_DICTIONARIES@")
+set(ANDROID "@ANDROID@")
+set(ANDROID_ADB_PROGRAM "@ANDROID_ADB_PROGRAM@")
+set(ANDROID_ANDROID_PROGRAM "@ANDROID_ANDROID_PROGRAM@")
+set(ANDROID_EMULATOR_PROGRAM "@ANDROID_EMULATOR_PROGRAM@")
+set(ANDROID_EMULATOR_AVD "@ANDROID_EMULATOR_AVD@")
+set(ANDROID_RUNTIME_LIBRARIES "@ANDROID_RUNTIME_LIBRARIES@")
+set(ANDROID_TEMPORARY_FILES_LOCATION "@ANDROID_TEMPORARY_FILES_LOCATION@")
 # Emulate some required CMake commands while running inside CTest
-INCLUDE(${DCMTK_CMAKE_INCLUDE}CMake/CTest/dcmtkCTestMacros.cmake)
+include(${DCMTK_CMAKE_INCLUDE}CMake/CTest/dcmtkCTestMacros.cmake)
 # For DCMTK_UNSET_XXX
-INCLUDE(${DCMTK_CMAKE_INCLUDE}CMake/dcmtkMacros.cmake)
+include(${DCMTK_CMAKE_INCLUDE}CMake/dcmtkMacros.cmake)
 # Load required functions for controlling the Android device emulator
-INCLUDE(${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseAndroidSDK.cmake)
+include(${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseAndroidSDK.cmake)
 
 # Prepare the Android testing environment
 # Prepare the emulator
@@ -51,20 +51,20 @@ MESSAGE_COMMAND(STOP_MESSAGE ${STOP_MESSAGE})
 # CTEST_CUSTOM_POST_TESTS executes a sequence of 'non CMake' commands separated
 # by ';' characters. Therefore the sequence a single command consists of must
 # be translated appropriately first
-STRING(REPLACE ";" " " STOP_EMULATOR "${STOP_EMULATOR}")
-STRING(REPLACE ";" " " STOP_MESSAGE "${STOP_MESSAGE}")
+string(REPLACE ";" " " STOP_EMULATOR "${STOP_EMULATOR}")
+string(REPLACE ";" " " STOP_MESSAGE "${STOP_MESSAGE}")
 # Register the cleanup hooks
-SET(CTEST_CUSTOM_POST_TEST "${STOP_MESSAGE}" "${STOP_EMULATOR}")
+set(CTEST_CUSTOM_POST_TEST "${STOP_MESSAGE}" "${STOP_EMULATOR}")
 
 # Set the current emulator instance handle via an environment variable
-SET(ENV{DCMTK_ANDROID_EMULATOR_INSTANCE} "${DCMTK_ANDROID_EMULATOR_INSTANCE}")
+set(ENV{DCMTK_ANDROID_EMULATOR_INSTANCE} "${DCMTK_ANDROID_EMULATOR_INSTANCE}")
 
 # Collect the list of required libraries
-IF(BUILD_SHARED_LIBS)
-    FOREACH(LIBRARY ${DCMTK_ALL_LIBRARIES})
-        LIST(APPEND DCMTK_CREATED_SHARED_LIBRARIES "${CMAKE_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}${LIBRARY}${CMAKE_SHARED_LIBRARY_SUFFIX}.${DCMTK_PACKAGE_VERSION}")
-    ENDFOREACH()
-ENDIF(BUILD_SHARED_LIBS)
+if(BUILD_SHARED_LIBS)
+    foreach(LIBRARY ${DCMTK_ALL_LIBRARIES})
+        list(APPEND DCMTK_CREATED_SHARED_LIBRARIES "${CMAKE_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}${LIBRARY}${CMAKE_SHARED_LIBRARY_SUFFIX}.${DCMTK_PACKAGE_VERSION}")
+    endforeach()
+endif()
 
 # Transmit the required executables, libraries and dictionaries to the emulator
 DCMTK_ANDROID_PUSH(DCMTK_ANDROID_EMULATOR_INSTANCE
@@ -77,22 +77,22 @@ DCMTK_ANDROID_PUSH(DCMTK_ANDROID_EMULATOR_INSTANCE
 )
 
 # Set executable permissions
-FOREACH(TEST_EXECUTABLE ${DCMTK_TEST_EXECUTABLES})
-    GET_FILENAME_COMPONENT(NAME "${TEST_EXECUTABLE}" NAME)
+foreach(TEST_EXECUTABLE ${DCMTK_TEST_EXECUTABLES})
+    get_filename_component(NAME "${TEST_EXECUTABLE}" NAME)
     DCMTK_ANDROID_SHELL(DCMTK_ANDROID_EMULATOR_INSTANCE
         COMMAND chmod 755 "${ANDROID_TEMPORARY_FILES_LOCATION}/${NAME}"
         OUTPUT_QUIET
         ERROR_QUIET
     )
-ENDFOREACH()
+endforeach()
 
 # Create necessary softlinks
-IF(BUILD_SHARED_LIBS)
-    FOREACH(LIBRARY ${DCMTK_ALL_LIBRARIES})
+if(BUILD_SHARED_LIBS)
+    foreach(LIBRARY ${DCMTK_ALL_LIBRARIES})
         DCMTK_ANDROID_SHELL(DCMTK_ANDROID_EMULATOR_INSTANCE
         COMMAND ln -s "./${CMAKE_SHARED_LIBRARY_PREFIX}${LIBRARY}${CMAKE_SHARED_LIBRARY_SUFFIX}.${DCMTK_PACKAGE_VERSION}" "${ANDROID_TEMPORARY_FILES_LOCATION}/${CMAKE_SHARED_LIBRARY_PREFIX}${LIBRARY}${CMAKE_SHARED_LIBRARY_SUFFIX}.${DCMTK_ABI_VERSION}"
         OUTPUT_QUIET
         ERROR_QUIET
         )
-    ENDFOREACH()
-ENDIF(BUILD_SHARED_LIBS)
+    endforeach()
+endif()
index 4ec2eb3947795dcb67d6156a609bd4856f58799f..12b40a364dc1a7449d1707d27f9416c65d33c03e 100644 (file)
@@ -4,13 +4,13 @@
 # workaround, but what can you do?
 #
 
-SET(ENV{WINEPREFIX} "@DCMTK_WINEPREFIX@")
-SET(ENV{DCMDICTPATH} "@DCMDICTPATH@")
-SET(WINE_WINE_PROGRAM "@WINE_WINE_PROGRAM@")
+set(ENV{WINEPREFIX} "@DCMTK_WINEPREFIX@")
+set(ENV{DCMDICTPATH} "@DCMDICTPATH@")
+set(WINE_WINE_PROGRAM "@WINE_WINE_PROGRAM@")
 
 # spawn the winserver using 'cmd /C call' -> effectively NOP
 # spawn it using 'sh', such that this script does not attach itself to it.
-EXECUTE_PROCESS(COMMAND
+execute_process(COMMAND
     sh -c "\"${WINE_WINE_PROGRAM}\" cmd /C call"
     OUTPUT_FILE "/dev/null"
     ERROR_FILE "/dev/null"
index b3a7eb50e2e79afb5265ba0a9ca7b80b7abdfc9c..3a4f1bcaf26e4cfa6bd37c0cb6c3b1945236ffcd 100644 (file)
@@ -3,25 +3,25 @@
 # that is missing inside CTest.
 #
 
-MACRO(MESSAGE_COMMAND VAR MODE)
-    IF(${MODE} STREQUAL "STATUS")
-        SET(${VAR} ${CMAKE_COMMAND} -E echo -- ${ARGN})
-    ELSEIF(${MODE} STREQUAL "WARNING")
-        SET(${VAR} ${CMAKE_COMMAND} -E echo WARNING: ${ARGN})
-    ELSEIF(${MODE} STREQUAL "AUTHOR_WARNING")
-        SET(${VAR} ${CMAKE_COMMAND} -E echo Warning: ${ARGN})
-    ELSEIF(${MODE} STREQUAL "SEND_ERROR")
-        SET(${VAR} ${CMAKE_COMMAND} -E echo Error: ${ARGN})
-    ELSEIF(${MODE} STREQUAL "FATAL_ERROR")
-        SET(${VAR} ${CMAKE_COMMAND} -E echo ERROR: ${ARGN})
-    ELSEIF(${MODE} STREQUAL "DEPRECATION")
-        SET(${VAR} ${CMAKE_COMMAND} -E echo ${ARGN})
-    ELSE()
-        SET(${VAR} ${CMAKE_COMMAND} -E echo ${MODE} ${ARGN})
-    ENDIF()
-ENDMACRO(MESSAGE_COMMAND)
+macro(MESSAGE_COMMAND VAR MODE)
+    if(${MODE} STREQUAL "STATUS")
+        set(${VAR} ${CMAKE_COMMAND} -E echo -- ${ARGN})
+    elseif(${MODE} STREQUAL "WARNING")
+        set(${VAR} ${CMAKE_COMMAND} -E echo WARNING: ${ARGN})
+    elseif(${MODE} STREQUAL "AUTHOR_WARNING")
+        set(${VAR} ${CMAKE_COMMAND} -E echo Warning: ${ARGN})
+    elseif(${MODE} STREQUAL "SEND_ERROR")
+        set(${VAR} ${CMAKE_COMMAND} -E echo Error: ${ARGN})
+    elseif(${MODE} STREQUAL "FATAL_ERROR")
+        set(${VAR} ${CMAKE_COMMAND} -E echo ERROR: ${ARGN})
+    elseif(${MODE} STREQUAL "DEPRECATION")
+        set(${VAR} ${CMAKE_COMMAND} -E echo ${ARGN})
+    else()
+        set(${VAR} ${CMAKE_COMMAND} -E echo ${MODE} ${ARGN})
+    endif()
+endmacro()
 
-FUNCTION(MESSAGE)
+function(MESSAGE)
     MESSAGE_COMMAND(COMMAND ${ARGN})
-    EXECUTE_PROCESS(COMMAND ${COMMAND})
-ENDFUNCTION(MESSAGE)
+    execute_process(COMMAND ${COMMAND})
+endfunction()
index 67bd4a444320af39eab5c621b42303501e76b168..7b1a3da4824c5a226e18c623061446510f29b101 100644 (file)
@@ -4,15 +4,15 @@
 # environment variable appropriately.
 #
 
-SET(ENV{DCMDICTPATH} "@DCMDICTPATH@")
+set(ENV{DCMDICTPATH} "@DCMDICTPATH@")
 
-EXECUTE_PROCESS(COMMAND
+execute_process(COMMAND
     "${DCMTK_CTEST_TESTCASE_COMMAND}" $ENV{DCMTK_CTEST_EXTRA_ARGUMENTS} "${DCMTK_CTEST_TEST_NAME}"
     RESULT_VARIABLE RESULT
 )
 
 # We cannot forward the result value to CMake, so print it instead and let CMake
 # return with code '1' or whatever it deems appropriate to notify about an error.
-IF(RESULT)
-    MESSAGE(FATAL_ERROR "Test command returned: ${RESULT}")
-ENDIF()
+if(RESULT)
+    message(FATAL_ERROR "Test command returned: ${RESULT}")
+endif()
index 9e2632d0b0ecdba773e2157e922c7c5195ddcea3..0203373948caf2c355362ea25de7a6bc94113713 100644 (file)
@@ -6,18 +6,18 @@
 #
 
 # Restore the required settings of the CMake configuration step
-SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
-SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_BINARY_DIR@")
-SET(CMAKE_FILES_DIRECTORY "@CMAKE_FILES_DIRECTORY@")
-SET(DCMTK_CMAKE_INCLUDE "@CMAKE_SOURCE_DIR@/@DCMTK_CMAKE_INCLUDE@")
-SET(DCMDICTPATH "@DCMDICTPATH@")
-SET(ANDROID_ADB_PROGRAM "@ANDROID_ADB_PROGRAM@")
-SET(ANDROID_TEMPORARY_FILES_LOCATION "@ANDROID_TEMPORARY_FILES_LOCATION@")
+set(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
+set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_BINARY_DIR@")
+set(CMAKE_FILES_DIRECTORY "@CMAKE_FILES_DIRECTORY@")
+set(DCMTK_CMAKE_INCLUDE "@CMAKE_SOURCE_DIR@/@DCMTK_CMAKE_INCLUDE@")
+set(DCMDICTPATH "@DCMDICTPATH@")
+set(ANDROID_ADB_PROGRAM "@ANDROID_ADB_PROGRAM@")
+set(ANDROID_TEMPORARY_FILES_LOCATION "@ANDROID_TEMPORARY_FILES_LOCATION@")
 # Load required functions for controlling the Android device emulator
-INCLUDE(${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseAndroidSDK.cmake)
+include(${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseAndroidSDK.cmake)
 
 # Restore the Android device emulator instance handle
-SET(DCMTK_ANDROID_EMULATOR_INSTANCE "$ENV{DCMTK_ANDROID_EMULATOR_INSTANCE}")
+set(DCMTK_ANDROID_EMULATOR_INSTANCE "$ENV{DCMTK_ANDROID_EMULATOR_INSTANCE}")
 
 # Run the actual testcase on the remote device
 DCMTK_ANDROID_SHELL(DCMTK_ANDROID_EMULATOR_INSTANCE
@@ -28,6 +28,6 @@ DCMTK_ANDROID_SHELL(DCMTK_ANDROID_EMULATOR_INSTANCE
 
 # We cannot forward the result value to CTest, so print it instead and let CMake
 # return with code '1' or whatever it deems appropriate to notify about an error.
-IF(RESULT)
-    MESSAGE(FATAL_ERROR "Test command returned: ${RESULT}")
-ENDIF()
+if(RESULT)
+    message(FATAL_ERROR "Test command returned: ${RESULT}")
+endif()
index 06419f33b28b0ae76a03a74c8b2a57331f627e22..b33145fa16dff006d49c1a4f500f318a0a85ba0f 100644 (file)
@@ -2,5 +2,5 @@
 # this file is used to execute the unit tests with the -x option injected
 #
 
-SET(ENV{DCMTK_CTEST_EXTRA_ARGUMENTS} "-x")
-EXECUTE_PROCESS(COMMAND ${CMAKE_CTEST_COMMAND} -C "${CONFIG}")
+set(ENV{DCMTK_CTEST_EXTRA_ARGUMENTS} "-x")
+execute_process(COMMAND ${CMAKE_CTEST_COMMAND} -C "${CONFIG}")
index 4dc0d783fdc042f5c0e5463cb5f5fb03b821177c..12a3489ce601d12482f38f04ebab1c49de193a22 100644 (file)
@@ -7,17 +7,17 @@
 # shutdown.
 #
 
-SET(ENV{WINEPREFIX} "@DCMTK_WINEPREFIX@")
-SET(ENV{DCMDICTPATH} "@DCMDICTPATH@")
-SET(WINE_WINE_PROGRAM "@WINE_WINE_PROGRAM@")
+set(ENV{WINEPREFIX} "@DCMTK_WINEPREFIX@")
+set(ENV{DCMDICTPATH} "@DCMDICTPATH@")
+set(WINE_WINE_PROGRAM "@WINE_WINE_PROGRAM@")
 
-EXECUTE_PROCESS(COMMAND
+execute_process(COMMAND
     "${WINE_WINE_PROGRAM}" "${DCMTK_CTEST_TESTCASE_COMMAND}" $ENV{DCMTK_CTEST_EXTRA_ARGUMENTS} "${DCMTK_CTEST_TEST_NAME}"
     RESULT_VARIABLE RESULT
 )
 
 # We cannot forward the result value to CMake, so print it instead and let CMake
 # return with code '1' or whatever it deems appropriate to notify about an error.
-IF(RESULT)
-    MESSAGE(FATAL_ERROR "Test command returned: ${RESULT}")
-ENDIF()
+if(RESULT)
+    message(FATAL_ERROR "Test command returned: ${RESULT}")
+endif()
index c204778e14c1cec68461f8100b1b5a5b45fc3ed6..f73125b2d18d5a0b7158dadb127e639434398f76 100644 (file)
@@ -1,12 +1,12 @@
 # Helper macro that checks whether a given CMake command exists or not
-MACRO(CHECK_CMAKE_COMMAND_EXISTS commandname)
-  MESSAGE(STATUS "Looking for CMake command ${commandname}")
+macro(CHECK_CMAKE_COMMAND_EXISTS commandname)
+  message(STATUS "Looking for CMake command ${commandname}")
   string(TOUPPER ${commandname} commandname_upper)
-  IF(COMMAND ${commandname})
-    SET(HAVE_${commandname_upper} TRUE)
-    MESSAGE(STATUS "Looking for CMake command ${commandname} - found")
-  ELSE()
-    SET(HAVE_${commandname_upper} FALSE)
-    MESSAGE(STATUS "Looking for CMake command ${commandname} - not found")
-  ENDIF()
-ENDMACRO()
+  if(COMMAND ${commandname})
+    set(HAVE_${commandname_upper} TRUE)
+    message(STATUS "Looking for CMake command ${commandname} - found")
+  else()
+    set(HAVE_${commandname_upper} FALSE)
+    message(STATUS "Looking for CMake command ${commandname} - not found")
+  endif()
+endmacro()
index 1b95ac4878dab31d964eb931767ee20341ad35b2..f22f56a28dcc00d0f1ee50aae4388871bcc708ba 100644 (file)
@@ -8,26 +8,26 @@
 # ... - additional arguments will be interpreted as additional libraries to link during testing.
 #
 
-MACRO(CHECK_FUNCTIONWITHHEADER_EXISTS SYMBOL FILES VARIABLE)
-  IF(NOT DEFINED "${VARIABLE}")
-    SET(CHECK_SYMBOL_EXISTS_CONTENT "/* */\n")
-    SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
-    IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_SYMBOL_EXISTS_LIBS
+macro(CHECK_FUNCTIONWITHHEADER_EXISTS SYMBOL FILES VARIABLE)
+  if(NOT DEFINED "${VARIABLE}")
+    set(CHECK_SYMBOL_EXISTS_CONTENT "/* */\n")
+    set(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
+    if(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_SYMBOL_EXISTS_LIBS
         "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES};${ARGN}")
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    FOREACH(FILE ${FILES})
-      SET(CHECK_SYMBOL_EXISTS_CONTENT
+    endif()
+    foreach(FILE ${FILES})
+      set(CHECK_SYMBOL_EXISTS_CONTENT
         "${CHECK_SYMBOL_EXISTS_CONTENT}#include <${FILE}>\n")
-    ENDFOREACH(FILE)
-    SET(CHECK_SYMBOL_EXISTS_CONTENT
+    endforeach()
+    set(CHECK_SYMBOL_EXISTS_CONTENT
       "${CHECK_SYMBOL_EXISTS_CONTENT}\nint main()\n{\n${SYMBOL};return 0;\n}\n")
 
-    FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.cxx
+    file(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.cxx
       "${CHECK_SYMBOL_EXISTS_CONTENT}")
 
-    MESSAGE(STATUS "Looking for prototype of ${SYMBOL}")
-    TRY_COMPILE(${VARIABLE}
+    message(STATUS "Looking for prototype of ${SYMBOL}")
+    try_compile(${VARIABLE}
       "${CMAKE_BINARY_DIR}"
       "${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.cxx"
       CMAKE_FLAGS
@@ -36,22 +36,22 @@ MACRO(CHECK_FUNCTIONWITHHEADER_EXISTS SYMBOL FILES VARIABLE)
       "${CHECK_SYMBOL_EXISTS_LIBS}"
       ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS}
       OUTPUT_VARIABLE OUTPUT)
-    IF(${VARIABLE})
-      MESSAGE(STATUS "Looking for prototype of ${SYMBOL} - found")
-      SET(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}")
-      FILE(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log"
+    if(${VARIABLE})
+      message(STATUS "Looking for prototype of ${SYMBOL} - found")
+      set(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}")
+      file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log"
         "Determining if the ${SYMBOL} "
         "exist passed with the following output:\n"
         "${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.ccc:\n"
         "${CHECK_SYMBOL_EXISTS_CONTENT}\n")
-    ELSE(${VARIABLE})
-      MESSAGE(STATUS "Looking for prototype of ${SYMBOL} - not found.")
-      SET(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
-      FILE(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
+    else()
+      message(STATUS "Looking for prototype of ${SYMBOL} - not found.")
+      set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
+      file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
         "Determining if the ${SYMBOL} "
         "exist failed with the following output:\n"
         "${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.cxx:\n"
         "${CHECK_SYMBOL_EXISTS_CONTENT}\n")
-    ENDIF(${VARIABLE})
-  ENDIF(NOT DEFINED "${VARIABLE}")
-ENDMACRO(CHECK_FUNCTIONWITHHEADER_EXISTS)
+    endif()
+  endif()
+endmacro()
index b574626717e322beaefe97b2dc06d3d37041762f..66507330cad86739dfbd63970a137b50516644d8 100644 (file)
@@ -5,56 +5,56 @@
 @PACKAGE_INIT@
 
 # Basic version information
-SET(DCMTK_MAJOR_VERSION @DCMTK_MAJOR_VERSION@)
-SET(DCMTK_MINOR_VERSION @DCMTK_MINOR_VERSION@)
-SET(DCMTK_BUILD_VERSION @DCMTK_BUILD_VERSION@)
+set(DCMTK_MAJOR_VERSION @DCMTK_MAJOR_VERSION@)
+set(DCMTK_MINOR_VERSION @DCMTK_MINOR_VERSION@)
+set(DCMTK_BUILD_VERSION @DCMTK_BUILD_VERSION@)
 
 # DCMTK libraries and modules
-SET(DCMTK_MODULES "@DCMTK_MODULES@")
-SET(DCMTK_LIBRARIES "@DCMTK_LIBRARY_TARGETS@")
+set(DCMTK_MODULES "@DCMTK_MODULES@")
+set(DCMTK_LIBRARIES "@DCMTK_LIBRARY_TARGETS@")
 
 # Optional DCMTK 3rd party libraries
-SET(DCMTK_WITH_TIFF @DCMTK_WITH_TIFF@)
-SET(DCMTK_WITH_PNG @DCMTK_WITH_PNG@)
-SET(DCMTK_WITH_XML @DCMTK_WITH_XML@)
-SET(DCMTK_WITH_ZLIB @DCMTK_WITH_ZLIB@)
-SET(DCMTK_WITH_OPENSSL @DCMTK_WITH_OPENSSL@)
-SET(DCMTK_WITH_SNDFILE @DCMTK_WITH_SNDFILE@)
-SET(DCMTK_WITH_ICONV @DCMTK_WITH_ICONV@)
-SET(DCMTK_WITH_STDLIBC_ICONV @DCMTK_WITH_STDLIBC_ICONV@)
-SET(DCMTK_WITH_ICU @DCMTK_WITH_ICU@)
-SET(DCMTK_WITH_WRAP @DCMTK_WITH_WRAP@)
-SET(DCMTK_WITH_DOXYGEN @DCMTK_WITH_DOXYGEN@)
+set(DCMTK_WITH_TIFF @DCMTK_WITH_TIFF@)
+set(DCMTK_WITH_PNG @DCMTK_WITH_PNG@)
+set(DCMTK_WITH_XML @DCMTK_WITH_XML@)
+set(DCMTK_WITH_ZLIB @DCMTK_WITH_ZLIB@)
+set(DCMTK_WITH_OPENSSL @DCMTK_WITH_OPENSSL@)
+set(DCMTK_WITH_SNDFILE @DCMTK_WITH_SNDFILE@)
+set(DCMTK_WITH_ICONV @DCMTK_WITH_ICONV@)
+set(DCMTK_WITH_STDLIBC_ICONV @DCMTK_WITH_STDLIBC_ICONV@)
+set(DCMTK_WITH_ICU @DCMTK_WITH_ICU@)
+set(DCMTK_WITH_WRAP @DCMTK_WITH_WRAP@)
+set(DCMTK_WITH_DOXYGEN @DCMTK_WITH_DOXYGEN@)
 
 # Dictionary-related
-SET(DCMTK_ENABLE_BUILTIN_DICTIONARY @DCMTK_ENABLE_BUILTIN_DICTIONARY@)
-SET(DCMTK_ENABLE_EXTERNAL_DICTIONARY @DCMTK_ENABLE_EXTERNAL_DICTIONARY@)
-SET(DCMTK_ENABLE_PRIVATE_TAGS @DCMTK_ENABLE_PRIVATE_TAGS@)
+set(DCMTK_ENABLE_BUILTIN_DICTIONARY @DCMTK_ENABLE_BUILTIN_DICTIONARY@)
+set(DCMTK_ENABLE_EXTERNAL_DICTIONARY @DCMTK_ENABLE_EXTERNAL_DICTIONARY@)
+set(DCMTK_ENABLE_PRIVATE_TAGS @DCMTK_ENABLE_PRIVATE_TAGS@)
 
 # Compiler / standard library features
-SET(DCMTK_ENABLE_CXX11 @DCMTK_ENABLE_CXX11@)
-SET(DCMTK_CXX11_FLAGS @DCMTK_CXX11_FLAGS@)
-SET(DCMTK_ENABLE_STL @DCMTK_ENABLE_STL@)
+set(DCMTK_ENABLE_CXX11 @DCMTK_ENABLE_CXX11@)
+set(DCMTK_CXX11_FLAGS @DCMTK_CXX11_FLAGS@)
+set(DCMTK_ENABLE_STL @DCMTK_ENABLE_STL@)
 
 # DCMTK shared libraries
-SET(DCMTK_SHARED_LIBRARIES @BUILD_SHARED_LIBS@)
-SET(DCMTK_SINGLE_SHARED_LIBRARY @BUILD_SINGLE_SHARED_LIBRARY@)
+set(DCMTK_SHARED_LIBRARIES @BUILD_SHARED_LIBS@)
+set(DCMTK_SINGLE_SHARED_LIBRARY @BUILD_SINGLE_SHARED_LIBRARY@)
 
 # DCMTK additional options
-SET(DCMTK_WITH_THREADS @DCMTK_WITH_THREADS@)
-SET(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS @DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS@)
-SET(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS @DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS@)
-SET(DCMTK_WIDE_CHAR_MAIN_FUNCTION @DCMTK_WIDE_CHAR_MAIN_FUNCTION@)
-SET(DCMTK_ENABLE_LFS @DCMTK_ENABLE_LFS@)
+set(DCMTK_WITH_THREADS @DCMTK_WITH_THREADS@)
+set(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS @DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS@)
+set(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS @DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS@)
+set(DCMTK_WIDE_CHAR_MAIN_FUNCTION @DCMTK_WIDE_CHAR_MAIN_FUNCTION@)
+set(DCMTK_ENABLE_LFS @DCMTK_ENABLE_LFS@)
 
 SET_AND_CHECK(DCMTK_TARGETS "@PACKAGE_DCMTK_CMKDIR_CONFIG@/DCMTKTargets.cmake")
 
 @DCMTK_CONFIG_CODE@
 
 # Compatibility: This variable is deprecated
-SET(DCMTK_INCLUDE_DIR ${DCMTK_INCLUDE_DIRS})
+set(DCMTK_INCLUDE_DIR ${DCMTK_INCLUDE_DIRS})
 
-IF(NOT DCMTK_TARGETS_IMPORTED)
-  SET(DCMTK_TARGETS_IMPORTED 1)
-  INCLUDE(${DCMTK_TARGETS})
-ENDIF(NOT DCMTK_TARGETS_IMPORTED)
+if(NOT DCMTK_TARGETS_IMPORTED)
+  set(DCMTK_TARGETS_IMPORTED 1)
+  include(${DCMTK_TARGETS})
+endif()
index 85a89a01154fc9fd08676da4bdf48dffaa44777b..f779d1782dc1839eeeb4c4bb13b69d007b2a2d86 100644 (file)
@@ -4,19 +4,19 @@
 #  LIBCHARSET_LIBRARIES    - Lists of libraries when using charset
 #  LIBCHARSET_FOUND        - True if charset found
 
-INCLUDE(FindPackageHandleStandardArgs)
+include(FindPackageHandleStandardArgs)
 
 # Look for the header file
-FIND_PATH(LIBCHARSET_INCLUDE_DIR NAMES localcharset.h)
-MARK_AS_ADVANCED(LIBCHARSET_INCLUDE_DIR)
+find_path(LIBCHARSET_INCLUDE_DIR NAMES localcharset.h)
+mark_as_advanced(LIBCHARSET_INCLUDE_DIR)
 
-SET(LIBCHARSET_LIBS charset)
-FIND_LIBRARY(LIBCHARSET_LIBRARY NAMES ${LIBCHARSET_LIBS})
-MARK_AS_ADVANCED(LIBCHARSET_LIBRARY)
+set(LIBCHARSET_LIBS charset)
+find_library(LIBCHARSET_LIBRARY NAMES ${LIBCHARSET_LIBS})
+mark_as_advanced(LIBCHARSET_LIBRARY)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBCHARSET REQUIRED_VARS LIBCHARSET_LIBRARY LIBCHARSET_INCLUDE_DIR)
 
-IF(LIBCHARSET_FOUND)
-  SET(LIBCHARSET_INCLUDE_DIRS ${LIBCHARSET_INCLUDE_DIR})
-  SET(LIBCHARSET_LIBRARIES ${LIBCHARSET_LIBRARY})
-ENDIF(LIBCHARSET_FOUND)
+if(LIBCHARSET_FOUND)
+  set(LIBCHARSET_INCLUDE_DIRS ${LIBCHARSET_INCLUDE_DIR})
+  set(LIBCHARSET_LIBRARIES ${LIBCHARSET_LIBRARY})
+endif()
diff --git a/CMake/FindICONV.cmake b/CMake/FindICONV.cmake
deleted file mode 100644 (file)
index f010b79..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# Find iconv library
-#
-# Released under BSD license
-#
-#  LIBICONV_INCLUDE_DIRS - where to find iconv.h, etc
-#  LIBICONV_LIBRARIES    - Lists of libraries when using iconv
-#  LIBICONV_FOUND        - True if iconv found
-
-INCLUDE(FindPackageHandleStandardArgs)
-INCLUDE(dcmtkTryCompile)
-
-# Look for the header file
-FIND_PATH(LIBICONV_INCLUDE_DIR NAMES iconv.h)
-MARK_AS_ADVANCED(LIBICONV_INCLUDE_DIR)
-
-# Look for the library
-SET(LIBICONV_LIBS iconv)
-FIND_LIBRARY(LIBICONV_LIBRARY NAMES ${LIBICONV_LIBS})
-MARK_AS_ADVANCED(LIBICONV_LIBRARY)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBICONV REQUIRED_VARS LIBICONV_LIBRARY LIBICONV_INCLUDE_DIR)
-
-# Copy the result to output variables
-IF(LIBICONV_FOUND)
-  SET(LIBICONV_LIBRARIES ${LIBICONV_LIBRARY})
-  SET(LIBICONV_INCLUDE_DIRS ${LIBICONV_INCLUDE_DIR})
-ELSE(LIBICONV_FOUND)
-  SET(LIBICONV_LIBS)
-  SET(LIBICONV_LIBRARY)
-  SET(LIBICONV_LIBRARIES)
-  SET(LIBICONV_INCLUDE_DIR)
-  SET(LIBICONV_INCLUDE_DIRS)
-ENDIF(LIBICONV_FOUND)
index 59dd891afaacc26235bcff4ec8e71350ac415f6c..68045c9a1d64db8d3f6840a7198072234c87fffe 100644 (file)
@@ -39,7 +39,7 @@
 #      target_link_libraries(myapp ${ICU_LIBRARIES})
 #      # with CMake >= 3.0.0, the last two lines can be replaced by the following
 #      target_link_libraries(myapp ICU::ICU)
-#   endif(ICU_FOUND)
+#   endif()
 
 ########## <ICU finding> ##########
 
@@ -48,13 +48,13 @@ find_package(PkgConfig QUIET)
 ########## Private ##########
 if(NOT DEFINED ICU_PUBLIC_VAR_NS)
     set(ICU_PUBLIC_VAR_NS "ICU")                          # Prefix for all ICU relative public variables
-endif(NOT DEFINED ICU_PUBLIC_VAR_NS)
+endif()
 if(NOT DEFINED ICU_PRIVATE_VAR_NS)
     set(ICU_PRIVATE_VAR_NS "_${ICU_PUBLIC_VAR_NS}")       # Prefix for all ICU relative internal variables
-endif(NOT DEFINED ICU_PRIVATE_VAR_NS)
+endif()
 if(NOT DEFINED PC_ICU_PRIVATE_VAR_NS)
     set(PC_ICU_PRIVATE_VAR_NS "_PC${ICU_PRIVATE_VAR_NS}") # Prefix for all pkg-config relative internal variables
-endif(NOT DEFINED PC_ICU_PRIVATE_VAR_NS)
+endif()
 
 set(${ICU_PRIVATE_VAR_NS}_HINTS )
 # <deprecated>
@@ -62,25 +62,25 @@ set(${ICU_PRIVATE_VAR_NS}_HINTS )
 if(DEFINED ENV{ICU_ROOT})
     list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "$ENV{ICU_ROOT}")
     message(AUTHOR_WARNING "ENV{ICU_ROOT} is deprecated in favor of ENV{ICU_ROOT_DIR}")
-endif(DEFINED ENV{ICU_ROOT})
+endif()
 if (DEFINED ICU_ROOT)
     list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "${ICU_ROOT}")
     message(AUTHOR_WARNING "ICU_ROOT is deprecated in favor of ICU_ROOT_DIR")
-endif(DEFINED ICU_ROOT)
+endif()
 # </deprecated>
 if(DEFINED ENV{ICU_ROOT_DIR})
     list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "$ENV{ICU_ROOT_DIR}")
-endif(DEFINED ENV{ICU_ROOT_DIR})
+endif()
 if (DEFINED ICU_ROOT_DIR)
     list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "${ICU_ROOT_DIR}")
-endif(DEFINED ICU_ROOT_DIR)
+endif()
 
 set(${ICU_PRIVATE_VAR_NS}_COMPONENTS )
 # <icu component name> <library name 1> ... <library name N>
 macro(_icu_declare_component _NAME)
     list(APPEND ${ICU_PRIVATE_VAR_NS}_COMPONENTS ${_NAME})
     set("${ICU_PRIVATE_VAR_NS}_COMPONENTS_${_NAME}" ${ARGN})
-endmacro(_icu_declare_component)
+endmacro()
 
 _icu_declare_component(data icudata)
 _icu_declare_component(uc   icuuc)         # Common and Data libraries
@@ -103,20 +103,20 @@ set(${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS "")
 foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS})
     string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
     set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE) # may be done in the _icu_declare_component macro
-endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
+endforeach()
 
 # Check components
 if(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS) # uc required at least
     set(${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
-else(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
+else()
     list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
     list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
     foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
         if(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
             message(FATAL_ERROR "Unknown ICU component: ${${ICU_PRIVATE_VAR_NS}_COMPONENT}")
-        endif(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-    endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-endif(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
+        endif()
+    endforeach()
+endif()
 
 # if pkg-config is available check components dependencies and append `pkg-config icu-<component> --variable=prefix` to hints
 if(PKG_CONFIG_FOUND)
@@ -133,12 +133,12 @@ if(PKG_CONFIG_FOUND)
                     if(${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX EQUAL -1)
                         message(WARNING "Missing component dependency: ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY}. Add it to your find_package(ICU) line as COMPONENTS to fix this warning.")
                         list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY})
-                    endif(${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX EQUAL -1)
-                endif(NOT ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY STREQUAL "data")
-            endforeach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY)
-        endif(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
-    endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-endif(PKG_CONFIG_FOUND)
+                    endif()
+                endif()
+            endforeach()
+        endif()
+    endforeach()
+endif()
 # list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS ENV ICU_ROOT_DIR)
 # message("${ICU_PRIVATE_VAR_NS}_HINTS = ${${ICU_PRIVATE_VAR_NS}_HINTS}")
 
@@ -196,12 +196,12 @@ if(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR)
     endif()
     set(${ICU_PUBLIC_VAR_NS}_VERSION "${${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR}.${${ICU_PUBLIC_VAR_NS}_VERSION_MINOR}.${${ICU_PUBLIC_VAR_NS}_VERSION_PATCH}")
     ########## </part to keep synced with tests/version/CMakeLists.txt> ##########
-endif(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR)
+endif()
 
 # Check libraries
 if(MSVC)
     include(SelectLibraryConfigurations)
-endif(MSVC)
+endif()
 foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
     string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
     if(MSVC)
@@ -212,7 +212,7 @@ foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
             list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}d")
             list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR}${${ICU_PUBLIC_VAR_NS}_VERSION_MINOR}")
             list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR}${${ICU_PUBLIC_VAR_NS}_VERSION_MINOR}d")
-        endforeach(${ICU_PRIVATE_VAR_NS}_BASE_NAME)
+        endforeach()
 
         find_library(
             ${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE
@@ -229,7 +229,7 @@ foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
 
         select_library_configurations("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}")
         list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARY ${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY})
-    else(MSVC)
+    else()
         find_library(
             ${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY
             NAMES ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
@@ -240,9 +240,9 @@ foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
         if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY)
             set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" TRUE)
             list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARY ${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY})
-        endif(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY)
-    endif(MSVC)
-endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
+        endif()
+    endif()
+endforeach()
 
 # Try to find out compiler flags
 find_program(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE icu-config HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS})
@@ -254,7 +254,7 @@ if(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
     execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
     execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
     execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-endif(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
+endif()
 
 # Check find_package arguments
 include(FindPackageHandleStandardArgs)
@@ -264,9 +264,9 @@ if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
         REQUIRED_VARS ${ICU_PUBLIC_VAR_NS}_LIBRARY ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR
         VERSION_VAR ${ICU_PUBLIC_VAR_NS}_VERSION
     )
-else(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
+else()
     find_package_handle_standard_args(${ICU_PUBLIC_VAR_NS} "Could NOT find ICU" ${ICU_PUBLIC_VAR_NS}_LIBRARY ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR)
-endif(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
+endif()
 
 if(${ICU_PUBLIC_VAR_NS}_FOUND)
     # <deprecated>
@@ -281,7 +281,7 @@ if(${ICU_PUBLIC_VAR_NS}_FOUND)
     if(NOT CMAKE_VERSION VERSION_LESS "3.0.0")
         if(NOT TARGET ICU::ICU)
             add_library(ICU::ICU INTERFACE IMPORTED)
-        endif(NOT TARGET ICU::ICU)
+        endif()
         set_target_properties(ICU::ICU PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}")
         foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
             string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
@@ -289,19 +289,19 @@ if(${ICU_PUBLIC_VAR_NS}_FOUND)
             if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE)
                 set_property(TARGET "ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
                 set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES IMPORTED_LOCATION_RELEASE "${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE}")
-            endif(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE)
+            endif()
             if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_DEBUG)
                 set_property(TARGET "ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
                 set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES IMPORTED_LOCATION_DEBUG "${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_DEBUG}")
-            endif(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_DEBUG)
+            endif()
             if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY)
                 set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES IMPORTED_LOCATION "${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY}")
-            endif(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY)
+            endif()
             set_property(TARGET ICU::ICU APPEND PROPERTY INTERFACE_LINK_LIBRARIES "ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}")
 #             set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}")
-        endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-    endif(NOT CMAKE_VERSION VERSION_LESS "3.0.0")
-endif(${ICU_PUBLIC_VAR_NS}_FOUND)
+        endforeach()
+    endif()
+endif()
 
 mark_as_advanced(
     ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR
@@ -319,7 +319,7 @@ function(_icu_extract_locale_from_rb _BUNDLE_SOURCE _RETURN_VAR_NAME)
     string(REGEX REPLACE "[ \t\n]" "" _BUNDLE_CONTENTS_WITHOUT_COMMENTS_AND_SPACES ${_BUNDLE_CONTENTS_WITHOUT_COMMENTS})
     string(REGEX MATCH "^([a-zA-Z_-]+)(:table)?{" LOCALE_FOUND ${_BUNDLE_CONTENTS_WITHOUT_COMMENTS_AND_SPACES})
     set("${_RETURN_VAR_NAME}" "${CMAKE_MATCH_1}" PARENT_SCOPE)
-endfunction(_icu_extract_locale_from_rb)
+endfunction()
 
 ########## Public ##########
 
@@ -376,10 +376,10 @@ function(icu_generate_resource_bundle)
 
     if(NOT ${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE)
         message(FATAL_ERROR "genrb not found")
-    endif(NOT ${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE)
+    endif()
     if(NOT ${ICU_PUBLIC_VAR_NS}_PKGDATA_EXECUTABLE)
         message(FATAL_ERROR "pkgdata not found")
-    endif(NOT ${ICU_PUBLIC_VAR_NS}_PKGDATA_EXECUTABLE)
+    endif()
     ##### </check for pkgdata/genrb availability> #####
 
     ##### <constants> #####
@@ -434,40 +434,40 @@ function(icu_generate_resource_bundle)
     # assert(${PARSED_ARGS_NAME} != "")
     if(NOT PARSED_ARGS_NAME)
         message(FATAL_ERROR "${__FUNCTION__}(): no name given, NAME parameter missing")
-    endif(NOT PARSED_ARGS_NAME)
+    endif()
 
     # assert(length(PARSED_ARGS_FILES) > 0)
     list(LENGTH PARSED_ARGS_FILES PARSED_ARGS_FILES_LEN)
     if(PARSED_ARGS_FILES_LEN LESS 1)
         message(FATAL_ERROR "${__FUNCTION__}() expects at least 1 resource bundle as FILES argument, 0 given")
-    endif(PARSED_ARGS_FILES_LEN LESS 1)
+    endif()
 
     string(TOUPPER "${PARSED_ARGS_FORMAT}" UPPER_FORMAT)
     # assert(${UPPER_FORMAT} in ['', 'java', 'xlif'])
     if(NOT DEFINED BUNDLES_${UPPER_FORMAT}_SUFFIX)
         message(FATAL_ERROR "${__FUNCTION__}(): unknown FORMAT '${PARSED_ARGS_FORMAT}'")
-    endif(NOT DEFINED BUNDLES_${UPPER_FORMAT}_SUFFIX)
+    endif()
 
     if(UPPER_FORMAT STREQUAL "JAVA")
         # assert(${PARSED_ARGS_BUNDLE} != "")
         if(NOT PARSED_ARGS_BUNDLE)
             message(FATAL_ERROR "${__FUNCTION__}(): java bundle name expected, BUNDLE parameter missing")
-        endif(NOT PARSED_ARGS_BUNDLE)
-    endif(UPPER_FORMAT STREQUAL "JAVA")
+        endif()
+    endif()
 
     if(PARSED_ARGS_PACKAGE)
         # assert(${PARSED_ARGS_FORMAT} == "")
         if(PARSED_ARGS_FORMAT)
             message(FATAL_ERROR "${__FUNCTION__}(): packaging is only supported for binary format, not xlif neither java outputs")
-        endif(PARSED_ARGS_FORMAT)
+        endif()
 
         string(TOUPPER "${PARSED_ARGS_TYPE}" UPPER_MODE)
         # assert(${UPPER_MODE} in ['', 'common', 'archive', 'dll', library'])
         if(NOT DEFINED PKGDATA_${UPPER_MODE}_ALIAS)
             message(FATAL_ERROR "${__FUNCTION__}(): unknown TYPE '${PARSED_ARGS_TYPE}'")
-        else(NOT DEFINED PKGDATA_${UPPER_MODE}_ALIAS)
+        else()
             set(TYPE "${PKGDATA_${UPPER_MODE}_ALIAS}")
-        endif(NOT DEFINED PKGDATA_${UPPER_MODE}_ALIAS)
+        endif()
 
         # Package name: strip file extension if present
         get_filename_component(PACKAGE_NAME_WE ${PARSED_ARGS_NAME} NAME_WE)
@@ -479,25 +479,25 @@ function(icu_generate_resource_bundle)
         # We make our "cook" there to prevent any conflict
         if(DEFINED CMAKE_PLATFORM_ROOT_BIN) # CMake < 2.8.10
             set(RESOURCE_GENRB_CHDIR_DIR "${CMAKE_PLATFORM_ROOT_BIN}/${PACKAGE_TARGET_NAME}.dir/")
-        else(DEFINED CMAKE_PLATFORM_ROOT_BIN) # CMake >= 2.8.10
+        else() # CMake >= 2.8.10
             set(RESOURCE_GENRB_CHDIR_DIR "${CMAKE_PLATFORM_INFO_DIR}/${PACKAGE_TARGET_NAME}.dir/")
-        endif(DEFINED CMAKE_PLATFORM_ROOT_BIN)
+        endif()
         # Directory (absolute) where resource bundles are built: concatenation of RESOURCE_GENRB_CHDIR_DIR and package name
         set(RESOURCE_OUTPUT_DIR "${RESOURCE_GENRB_CHDIR_DIR}/${PACKAGE_NAME_WE}/")
         # Output (relative) path for built package
         if(MSVC AND TYPE STREQUAL PKGDATA_LIBRARY_ALIAS)
             set(PACKAGE_OUTPUT_PATH "${RESOURCE_GENRB_CHDIR_DIR}/${PACKAGE_NAME_WE}/${PKGDATA_${TYPE}_PREFIX}${PACKAGE_NAME_WE}${PKGDATA_${TYPE}_SUFFIX}")
-        else(MSVC AND TYPE STREQUAL PKGDATA_LIBRARY_ALIAS)
+        else()
             set(PACKAGE_OUTPUT_PATH "${RESOURCE_GENRB_CHDIR_DIR}/${PKGDATA_${TYPE}_PREFIX}${PACKAGE_NAME_WE}${PKGDATA_${TYPE}_SUFFIX}")
-        endif(MSVC AND TYPE STREQUAL PKGDATA_LIBRARY_ALIAS)
+        endif()
         # Output (absolute) path for the list file
         set(PACKAGE_LIST_OUTPUT_PATH "${RESOURCE_GENRB_CHDIR_DIR}/pkglist.txt")
 
         file(MAKE_DIRECTORY "${RESOURCE_OUTPUT_DIR}")
-    else(PARSED_ARGS_PACKAGE)
+    else()
         set(RESOURCE_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/")
 #         set(RESOURCE_GENRB_CHDIR_DIR "UNUSED")
-    endif(PARSED_ARGS_PACKAGE)
+    endif()
 
     set(TARGET_RESOURCES )
     set(COMPILED_RESOURCES_PATH )
@@ -510,10 +510,10 @@ function(icu_generate_resource_bundle)
         if(UPPER_FORMAT STREQUAL "XLIFF")
             if(RESOURCE_NAME_WE STREQUAL "root")
                 set(XLIFF_LANGUAGE "en")
-            else(RESOURCE_NAME_WE STREQUAL "root")
+            else()
                 string(REGEX REPLACE "[^a-z].*$" "" XLIFF_LANGUAGE "${RESOURCE_NAME_WE}")
-            endif(RESOURCE_NAME_WE STREQUAL "root")
-        endif(UPPER_FORMAT STREQUAL "XLIFF")
+            endif()
+        endif()
 
         ##### <templates> #####
         set(RESOURCE_TARGET_NAME "${RESOURCE_TARGET_PREFIX}${TARGET_SEPARATOR}${PARSED_ARGS_NAME}${TARGET_SEPARATOR}${RESOURCE_NAME_WE}")
@@ -521,9 +521,9 @@ function(icu_generate_resource_bundle)
         set(RESOURCE_OUTPUT__PATH "${RESOURCE_NAME_WE}.res")
         if(RESOURCE_NAME_WE STREQUAL "root")
             set(RESOURCE_OUTPUT_JAVA_PATH "${PARSED_ARGS_BUNDLE}.java")
-        else(RESOURCE_NAME_WE STREQUAL "root")
+        else()
             set(RESOURCE_OUTPUT_JAVA_PATH "${PARSED_ARGS_BUNDLE}_${RESOURCE_NAME_WE}.java")
-        endif(RESOURCE_NAME_WE STREQUAL "root")
+        endif()
         set(RESOURCE_OUTPUT_XLIFF_PATH "${RESOURCE_NAME_WE}.xlf")
 
         set(GENRB__OPTIONS "")
@@ -538,13 +538,13 @@ function(icu_generate_resource_bundle)
                 COMMAND ${CMAKE_COMMAND} -E chdir ${RESOURCE_GENRB_CHDIR_DIR} ${${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE} ${GENRB_${UPPER_FORMAT}_OPTIONS} -d ${PACKAGE_NAME_WE} ${ABSOLUTE_SOURCE}
                 DEPENDS ${RESOURCE_SOURCE}
             )
-        else(PARSED_ARGS_PACKAGE)
+        else()
             add_custom_command(
                 OUTPUT "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}"
                 COMMAND ${${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE} ${GENRB_${UPPER_FORMAT}_OPTIONS} -d ${RESOURCE_OUTPUT_DIR} ${ABSOLUTE_SOURCE}
                 DEPENDS ${RESOURCE_SOURCE}
             )
-        endif(PARSED_ARGS_PACKAGE)
+        endif()
         # dummy target (ICU+RB+<name>+<locale>) for each locale to build the <locale>.res file from its <locale>.txt by the add_custom_command above
         add_custom_target(
             "${RESOURCE_TARGET_NAME}" ALL
@@ -555,12 +555,12 @@ function(icu_generate_resource_bundle)
 
         if(PARSED_ARGS_DESTINATION AND NOT PARSED_ARGS_PACKAGE)
             install(FILES "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}" DESTINATION ${PARSED_ARGS_DESTINATION} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
-        endif(PARSED_ARGS_DESTINATION AND NOT PARSED_ARGS_PACKAGE)
+        endif()
 
         list(APPEND TARGET_RESOURCES "${RESOURCE_TARGET_NAME}")
         list(APPEND COMPILED_RESOURCES_PATH "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}")
         list(APPEND COMPILED_RESOURCES_BASENAME "${RESOURCE_NAME_WE}.${BUNDLES_${UPPER_FORMAT}_SUFFIX}")
-    endforeach(RESOURCE_SOURCE)
+    endforeach()
     # convert semicolon separated list to a space separated list
     # NOTE: if the pkglist.txt file starts (or ends?) with a whitespace, pkgdata add an undefined symbol (named <package>_) for it
     string(REPLACE ";" " " COMPILED_RESOURCES_BASENAME "${COMPILED_RESOURCES_BASENAME}")
@@ -583,14 +583,14 @@ function(icu_generate_resource_bundle)
             # assert(${PARSED_ARGS_DEPENDS} != "")
             if(NOT PARSED_ARGS_DEPENDS)
                 message(FATAL_ERROR "${__FUNCTION__}(): static and library mode imply a list of targets to link to, DEPENDS parameter missing")
-            endif(NOT PARSED_ARGS_DEPENDS)
+            endif()
             add_library(${PACKAGE_TARGET_NAME} ${PKGDATA_LIBRARY_${TYPE}_TYPE} IMPORTED)
             if(MSVC)
                 string(REGEX REPLACE "${PKGDATA_LIBRARY_SUFFIX}\$" "${CMAKE_IMPORT_LIBRARY_SUFFIX}" PACKAGE_OUTPUT_LIB "${PACKAGE_OUTPUT_PATH}")
                 set_target_properties(${PACKAGE_TARGET_NAME} PROPERTIES IMPORTED_LOCATION ${PACKAGE_OUTPUT_PATH} IMPORTED_IMPLIB ${PACKAGE_OUTPUT_LIB})
-            else(MSVC)
+            else()
                 set_target_properties(${PACKAGE_TARGET_NAME} PROPERTIES IMPORTED_LOCATION ${PACKAGE_OUTPUT_PATH})
-            endif(MSVC)
+            endif()
             foreach(DEPENDENCY ${PARSED_ARGS_DEPENDS})
                 target_link_libraries(${DEPENDENCY} ${PACKAGE_TARGET_NAME})
                 if(NOT PARSED_ARGS_NO_SHARED_FLAGS)
@@ -598,11 +598,11 @@ function(icu_generate_resource_bundle)
                     list(LENGTH "${ENABLED_LANGUAGES}" ENABLED_LANGUAGES_LENGTH)
                     if(ENABLED_LANGUAGES_LENGTH GREATER 1)
                         message(WARNING "Project has more than one language enabled, skip automatic shared flags appending")
-                    else(ENABLED_LANGUAGES_LENGTH GREATER 1)
+                    else()
                         set_property(TARGET "${DEPENDENCY}" APPEND PROPERTY COMPILE_FLAGS "${${ICU_PUBLIC_VAR_NS}_${ENABLED_LANGUAGES}_SHARED_FLAGS}")
-                    endif(ENABLED_LANGUAGES_LENGTH GREATER 1)
-                endif(NOT PARSED_ARGS_NO_SHARED_FLAGS)
-            endforeach(DEPENDENCY)
+                    endif()
+                endif()
+            endforeach()
             # http://www.mail-archive.com/cmake-commits@cmake.org/msg01135.html
             set(PACKAGE_INTERMEDIATE_TARGET_NAME "${PACKAGE_TARGET_NAME}${TARGET_SEPARATOR}DUMMY")
             # dummy intermediate target (ICU+PKG+<name>+DUMMY) to link the package to the produced library by running pkgdata (see add_custom_command above)
@@ -612,14 +612,14 @@ function(icu_generate_resource_bundle)
                 DEPENDS "${PACKAGE_OUTPUT_PATH}"
             )
             add_dependencies("${PACKAGE_TARGET_NAME}" "${PACKAGE_INTERMEDIATE_TARGET_NAME}")
-        else(PKGDATA_LIBRARY_${TYPE}_TYPE)
+        else()
             # dummy target (ICU+PKG+<name>) to run pkgdata (see add_custom_command above)
             add_custom_target(
                 "${PACKAGE_TARGET_NAME}" ALL
                 COMMENT ""
                 DEPENDS "${PACKAGE_OUTPUT_PATH}"
             )
-        endif(PKGDATA_LIBRARY_${TYPE}_TYPE)
+        endif()
         # dummy target (ICU+PKG+<name>+PKGLIST) to build the file pkglist.txt
         add_custom_target(
             "${PACKAGE_LIST_TARGET_NAME}" ALL
@@ -633,10 +633,10 @@ function(icu_generate_resource_bundle)
 
         if(PARSED_ARGS_DESTINATION)
             install(FILES "${PACKAGE_OUTPUT_PATH}" DESTINATION ${PARSED_ARGS_DESTINATION} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
-        endif(PARSED_ARGS_DESTINATION)
-    endif(PARSED_ARGS_PACKAGE)
+        endif()
+    endif()
 
-endfunction(icu_generate_resource_bundle)
+endfunction()
 
 ########## </resource bundle support> ##########
 
@@ -647,10 +647,10 @@ if(${ICU_PUBLIC_VAR_NS}_DEBUG)
     function(icudebug _VARNAME)
         if(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
             message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = ${${ICU_PUBLIC_VAR_NS}_${_VARNAME}}")
-        else(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
+        else()
             message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = <UNDEFINED>")
-        endif(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-    endfunction(icudebug)
+        endif()
+    endfunction()
 
     # IN (args)
     icudebug("FIND_COMPONENTS")
@@ -682,9 +682,9 @@ if(${ICU_PUBLIC_VAR_NS}_DEBUG)
         string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
         foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLE ${${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLES})
             icudebug("${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_${${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLE}")
-        endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLE)
-    endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
+        endforeach()
+    endforeach()
 
-endif(${ICU_PUBLIC_VAR_NS}_DEBUG)
+endif()
 
 ########## </debug> ##########
diff --git a/CMake/FindIconv.cmake b/CMake/FindIconv.cmake
new file mode 100644 (file)
index 0000000..379ec09
--- /dev/null
@@ -0,0 +1,33 @@
+# Find iconv library
+#
+# Released under BSD license
+#
+#  LIBICONV_INCLUDE_DIRS - where to find iconv.h, etc
+#  LIBICONV_LIBRARIES    - Lists of libraries when using iconv
+#  LIBICONV_FOUND        - True if iconv found
+
+include(FindPackageHandleStandardArgs)
+include(dcmtkTryCompile)
+
+# Look for the header file
+find_path(LIBICONV_INCLUDE_DIR NAMES iconv.h)
+mark_as_advanced(LIBICONV_INCLUDE_DIR)
+
+# Look for the library
+set(LIBICONV_LIBS iconv)
+find_library(LIBICONV_LIBRARY NAMES ${LIBICONV_LIBS})
+mark_as_advanced(LIBICONV_LIBRARY)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBICONV REQUIRED_VARS LIBICONV_LIBRARY LIBICONV_INCLUDE_DIR)
+
+# Copy the result to output variables
+if(LIBICONV_FOUND)
+  set(LIBICONV_LIBRARIES ${LIBICONV_LIBRARY})
+  set(LIBICONV_INCLUDE_DIRS ${LIBICONV_INCLUDE_DIR})
+else()
+  set(LIBICONV_LIBS)
+  set(LIBICONV_LIBRARY)
+  set(LIBICONV_LIBRARIES)
+  set(LIBICONV_INCLUDE_DIR)
+  set(LIBICONV_INCLUDE_DIRS)
+endif()
index b1d12148fad326b24de7192fb04171256ccef6a7..ca5e8c33bd425b39208ad9eb01ccbd6becb95f13 100644 (file)
@@ -6,27 +6,27 @@
 #  SNDFILE_LIBRARIES    - Lists of libraries when using sndfile
 #  SNDFILE_FOUND        - True if sndfile found
 
-INCLUDE(FindPackageHandleStandardArgs)
+include(FindPackageHandleStandardArgs)
 
 # Look for the header file
-FIND_PATH(SNDFILE_INCLUDE_DIR NAMES sndfile.h)
-MARK_AS_ADVANCED(SNDFILE_INCLUDE_DIR)
+find_path(SNDFILE_INCLUDE_DIR NAMES sndfile.h)
+mark_as_advanced(SNDFILE_INCLUDE_DIR)
 
 # Look for the library
-SET(SNDFILE_LIBS sndfile)
-FIND_LIBRARY(SNDFILE_LIBRARY NAMES ${SNDFILE_LIBS})
-MARK_AS_ADVANCED(SNDFILE_LIBRARY)
+set(SNDFILE_LIBS sndfile)
+find_library(SNDFILE_LIBRARY NAMES ${SNDFILE_LIBS})
+mark_as_advanced(SNDFILE_LIBRARY)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SNDFILE REQUIRED_VARS SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
 
 # Copy the result to output variables
-IF(SNDFILE_FOUND)
-  SET(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
-  SET(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIR})
-ELSE(SNDFILE_FOUND)
-  SET(SNDFILE_LIBS)
-  SET(SNDFILE_LIBRARY)
-  SET(SNDFILE_LIBRARIES)
-  SET(SNDFILE_INCLUDE_DIR)
-  SET(SNDFILE_INCLUDE_DIRS)
-ENDIF(SNDFILE_FOUND)
+if(SNDFILE_FOUND)
+  set(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
+  set(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIR})
+else()
+  set(SNDFILE_LIBS)
+  set(SNDFILE_LIBRARY)
+  set(SNDFILE_LIBRARIES)
+  set(SNDFILE_INCLUDE_DIR)
+  set(SNDFILE_INCLUDE_DIRS)
+endif()
index 5737e418eda1319fda8b8538af4e2dc8aae84a95..27955bf013bb617b7964e216e6ba3e341a8e9901 100644 (file)
@@ -6,27 +6,27 @@
 #  WRAP_LIBRARIES    - Lists of libraries when using libwrap
 #  WRAP_FOUND        - True if wrap found
 
-INCLUDE(FindPackageHandleStandardArgs)
+include(FindPackageHandleStandardArgs)
 
 # Look for the header file
-FIND_PATH(WRAP_INCLUDE_DIR NAMES tcpd.h)
-MARK_AS_ADVANCED(WRAP_INCLUDE_DIR)
+find_path(WRAP_INCLUDE_DIR NAMES tcpd.h)
+mark_as_advanced(WRAP_INCLUDE_DIR)
 
 # Look for the library
-SET(WRAP_LIBS wrap)
-FIND_LIBRARY(WRAP_LIBRARY NAMES ${WRAP_LIBS})
-MARK_AS_ADVANCED(WRAP_LIBRARY)
+set(WRAP_LIBS wrap)
+find_library(WRAP_LIBRARY NAMES ${WRAP_LIBS})
+mark_as_advanced(WRAP_LIBRARY)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(WRAP REQUIRED_VARS WRAP_LIBRARY WRAP_INCLUDE_DIR)
 
 # Copy the result to output variables
-IF(WRAP_FOUND)
-  SET(WRAP_LIBRARIES ${WRAP_LIBRARY})
-  SET(WRAP_INCLUDE_DIRS ${WRAP_INCLUDE_DIR})
-ELSE(WRAP_FOUND)
-  SET(WRAP_LIBS)
-  SET(WRAP_LIBRARY)
-  SET(WRAP_LIBRARIES)
-  SET(WRAP_INCLUDE_DIR)
-  SET(WRAP_INCLUDE_DIRS)
-ENDIF(WRAP_FOUND)
+if(WRAP_FOUND)
+  set(WRAP_LIBRARIES ${WRAP_LIBRARY})
+  set(WRAP_INCLUDE_DIRS ${WRAP_INCLUDE_DIR})
+else()
+  set(WRAP_LIBS)
+  set(WRAP_LIBRARY)
+  set(WRAP_LIBRARIES)
+  set(WRAP_INCLUDE_DIR)
+  set(WRAP_INCLUDE_DIRS)
+endif()
index e231e587277d360d7e8f9dea8d69a6c0a1d4df32..9a9feb360e87bb67baa56101d6a8439ed154d646 100644 (file)
 # DCMTKConfig.cmake will contain options used to build this DCMTK package
 
 # Get and store all executable targets to DCMTKTargets.cmake within build's main dir
-GET_PROPERTY(DCMTK_EXECUTABLE_TARGETS GLOBAL PROPERTY DCMTK_EXECUTABLE_TARGETS)
-EXPORT(TARGETS ${DCMTK_EXECUTABLE_TARGETS} APPEND FILE "${DCMTK_BUILD_CMKDIR}/DCMTKTargets.cmake")
+get_property(DCMTK_EXECUTABLE_TARGETS GLOBAL PROPERTY DCMTK_EXECUTABLE_TARGETS)
+export(TARGETS ${DCMTK_EXECUTABLE_TARGETS} FILE "${DCMTK_BUILD_CMKDIR}/DCMTKTargets.cmake")
 
 # Get and store libraries to DCMTKTargets.cmake within the build's main dir
-GET_PROPERTY(DCMTK_LIBRARY_TARGETS GLOBAL PROPERTY DCMTK_LIBRARY_TARGETS)
-EXPORT(TARGETS ${DCMTK_LIBRARY_TARGETS} APPEND FILE "${DCMTK_BUILD_CMKDIR}/DCMTKTargets.cmake")
+get_property(DCMTK_LIBRARY_TARGETS GLOBAL PROPERTY DCMTK_LIBRARY_TARGETS)
+export(TARGETS ${DCMTK_LIBRARY_TARGETS} APPEND FILE "${DCMTK_BUILD_CMKDIR}/DCMTKTargets.cmake")
 
 # Create DCMTConfigVersion.cmake with basic DCMTK version information (build tree)
-SET(DCMTK_CONFIG_VERSION "${DCMTK_BUILD_CMKDIR}/DCMTKConfigVersion.cmake")
+set(DCMTK_CONFIG_VERSION "${DCMTK_BUILD_CMKDIR}/DCMTKConfigVersion.cmake")
 WRITE_BASIC_PACKAGE_VERSION_FILE(
     ${DCMTK_CONFIG_VERSION}
     VERSION ${DCMTK_MAJOR_VERSION}.${DCMTK_MINOR_VERSION}.${DCMTK_BUILD_VERSION}
@@ -36,46 +36,46 @@ WRITE_BASIC_PACKAGE_VERSION_FILE(
 # build and install tree versions of the file.
 
 # Case 1: Configure 'DCMTKConfig.cmake' for a build tree.
-SET(DCMTK_CMKDIR_CONFIG "${DCMTK_BUILD_CMKDIR}")
+set(DCMTK_CMKDIR_CONFIG "${DCMTK_BUILD_CMKDIR}")
 # Collect include paths
-SET(DCMTK_INCLUDE_DIR_CONFIGS
+set(DCMTK_INCLUDE_DIR_CONFIGS
     "SET_AND_CHECK(DCMTK_config_INCLUDE_DIR \"${DCMTK_BINARY_DIR}/config/include/dcmtk/config\")")
-FOREACH(module ${DCMTK_MODULES})
-    SET(DCMTK_INCLUDE_DIR_CONFIGS
+foreach(module ${DCMTK_MODULES})
+    set(DCMTK_INCLUDE_DIR_CONFIGS
         "${DCMTK_INCLUDE_DIR_CONFIGS}\nSET_AND_CHECK(DCMTK_${module}_INCLUDE_DIR \"${DCMTK_SOURCE_DIR}/${module}/include/dcmtk/${module}\")")
-ENDFOREACH(module)
-SET(DCMTK_CONFIG_CODE "####### Expanded from \@DCMTK_CONFIG_CODE\@ #######\n")
-SET(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}list(APPEND DCMTK_INCLUDE_DIRS \"${DCMTK_BINARY_DIR}/config/include\")\n")
-FOREACH(module ${DCMTK_MODULES})
-    SET(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}list(APPEND DCMTK_INCLUDE_DIRS \"${DCMTK_SOURCE_DIR}/${module}/include\")\n")
-ENDFOREACH(module)
-SET(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}##################################################")
-SET(dcmtk_config "${DCMTK_BUILD_CMKDIR}/DCMTKConfig.cmake")
+endforeach()
+set(DCMTK_CONFIG_CODE "####### Expanded from \@DCMTK_CONFIG_CODE\@ #######\n")
+set(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}list(APPEND DCMTK_INCLUDE_DIRS \"${DCMTK_BINARY_DIR}/config/include\")\n")
+foreach(module ${DCMTK_MODULES})
+    set(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}list(APPEND DCMTK_INCLUDE_DIRS \"${DCMTK_SOURCE_DIR}/${module}/include\")\n")
+endforeach()
+set(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}##################################################")
+set(dcmtk_config "${DCMTK_BUILD_CMKDIR}/DCMTKConfig.cmake")
 # Actually configure file and write it to build's main directory
 CONFIGURE_PACKAGE_CONFIG_FILE(
-    CMake/DCMTKConfig.cmake.in
+    ${DCMTK_SOURCE_DIR}/CMake/DCMTKConfig.cmake.in
     ${dcmtk_config}
     INSTALL_DESTINATION "${CMAKE_BINARY_DIR}"
     PATH_VARS DCMTK_CMKDIR_CONFIG DCMTK_INCLUDE_DIR_CONFIGS
     NO_CHECK_REQUIRED_COMPONENTS_MACRO)
 
 # Case 2: Configure 'DCMTKConfig.cmake' for an install tree
-SET(DCMTK_CMKDIR_CONFIG "${DCMTK_INSTALL_CMKDIR}")
+set(DCMTK_CMKDIR_CONFIG "${DCMTK_INSTALL_CMKDIR}")
 # Collect include paths
-SET(DCMTK_INCLUDE_DIR_CONFIGS
+set(DCMTK_INCLUDE_DIR_CONFIGS
     "SET_AND_CHECK(DCMTK_config_INCLUDE_DIR \"\${PACKAGE_PREFIX_DIR}/include/dcmtk/config\")")
-FOREACH(module ${DCMTK_MODULES})
-    SET(DCMTK_INCLUDE_DIR_CONFIGS
+foreach(module ${DCMTK_MODULES})
+    set(DCMTK_INCLUDE_DIR_CONFIGS
         "${DCMTK_INCLUDE_DIR_CONFIGS}\nSET_AND_CHECK(DCMTK_${module}_INCLUDE_DIR \"\${PACKAGE_PREFIX_DIR}/include/dcmtk/${module}\")")
-ENDFOREACH(module)
-SET(DCMTK_CONFIG_CODE "####### Expanded from \@DCMTK_CONFIG_CODE\@ #######\n")
-SET(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}list(APPEND DCMTK_INCLUDE_DIRS \"\${PACKAGE_PREFIX_DIR}/include\")\n")
-SET(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}##################################################")
-SET(DCMTK_INSTALL_CONFIG "${CMAKE_BINARY_DIR}/CMakeFiles/DCMTKConfig.cmake")
+endforeach()
+set(DCMTK_CONFIG_CODE "####### Expanded from \@DCMTK_CONFIG_CODE\@ #######\n")
+set(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}list(APPEND DCMTK_INCLUDE_DIRS \"\${PACKAGE_PREFIX_DIR}/include\")\n")
+set(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}##################################################")
+set(DCMTK_INSTALL_CONFIG "${CMAKE_BINARY_DIR}/CMakeFiles/DCMTKConfig.cmake")
 # Actually configure file and set rule to install it to installation subdir
 CONFIGURE_PACKAGE_CONFIG_FILE(
-    CMake/DCMTKConfig.cmake.in
+    ${DCMTK_SOURCE_DIR}/CMake/DCMTKConfig.cmake.in
     "${DCMTK_INSTALL_CONFIG}"
-    INSTALL_DESTINATION "${CMAKE_INSTALL_PREFIX}/${DCMTK_INSTALL_CMKDIR}"
+    INSTALL_DESTINATION "${DCMTK_INSTALL_CMKDIR}"
     PATH_VARS DCMTK_CMKDIR_CONFIG DCMTK_INCLUDE_DIR_CONFIGS
     NO_CHECK_REQUIRED_COMPONENTS_MACRO)
index d811a582fafe473bfbe2ca9a98ad3c03c8741190..71f3d48d9909ef34c8f27979426601e00880715b 100644 (file)
 # Set build configuration to use for configuration tests
-IF(CMAKE_BUILD_TYPE)
-  SET(CMAKE_TRY_COMPILE_CONFIGURATION "${CMAKE_BUILD_TYPE}")
-ELSE(CMAKE_BUILD_TYPE)
-  SET(CMAKE_TRY_COMPILE_CONFIGURATION "Release")
-ENDIF(CMAKE_BUILD_TYPE)
+if(CMAKE_BUILD_TYPE)
+  set(CMAKE_TRY_COMPILE_CONFIGURATION "${CMAKE_BUILD_TYPE}")
+else()
+  set(CMAKE_TRY_COMPILE_CONFIGURATION "Release")
+endif()
 
 # Compiled-in dictionary support
-IF(DCMTK_ENABLE_BUILTIN_DICTIONARY)
-  SET(ENABLE_BUILTIN_DICTIONARY 1)
-  MESSAGE(STATUS "Info: DCMTK will compile with built-in (compiled-in) dictionary")
+if(DCMTK_ENABLE_BUILTIN_DICTIONARY)
+  set(ENABLE_BUILTIN_DICTIONARY 1)
+  message(STATUS "Info: DCMTK will compile with built-in (compiled-in) dictionary")
   # No extra variable needed since its only evaluated in CMake files
-ELSE(DCMTK_ENABLE_BUILTIN_DICTIONARY)
-  SET(ENABLE_BUILTIN_DICTIONARY "")
-  MESSAGE(STATUS "Info: DCMTK will compile without built-in (compiled-in) dictionary")
+else()
+  set(ENABLE_BUILTIN_DICTIONARY "")
+  message(STATUS "Info: DCMTK will compile without built-in (compiled-in) dictionary")
   # No extra variable needed since its only evaluated in CMake files
-ENDIF(DCMTK_ENABLE_BUILTIN_DICTIONARY)
+endif()
 
 # External dictionary support
-IF(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
-  SET(ENABLE_EXTERNAL_DICTIONARY 1)
-  MESSAGE(STATUS "Info: DCMTK will try to load external dictionary from default path on startup")
-ELSE(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
-  SET(ENABLE_EXTERNAL_DICTIONARY "")
-  MESSAGE(STATUS "Info: DCMTK will not try to load external dictionary from default path on startup")
-ENDIF(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
+if(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
+  set(ENABLE_EXTERNAL_DICTIONARY 1)
+  message(STATUS "Info: DCMTK will try to load external dictionary from default path on startup")
+else()
+  set(ENABLE_EXTERNAL_DICTIONARY "")
+  message(STATUS "Info: DCMTK will not try to load external dictionary from default path on startup")
+endif()
 
 
 # Private tags
-IF(DCMTK_ENABLE_PRIVATE_TAGS)
-  SET(ENABLE_PRIVATE_TAGS 1)
-  MESSAGE(STATUS "Info: DCMTK's builtin private dictionary support will be enabled")
-ELSE(DCMTK_ENABLE_PRIVATE_TAGS)
-  SET(ENABLE_PRIVATE_TAGS "")
-  MESSAGE(STATUS "Info: DCMTK's builtin private dictionary support will be disabled")
-ENDIF(DCMTK_ENABLE_PRIVATE_TAGS)
+if(DCMTK_ENABLE_PRIVATE_TAGS)
+  set(ENABLE_PRIVATE_TAGS 1)
+  message(STATUS "Info: DCMTK's builtin private dictionary support will be enabled")
+else()
+  set(ENABLE_PRIVATE_TAGS "")
+  message(STATUS "Info: DCMTK's builtin private dictionary support will be disabled")
+endif()
 
 # Thread support
-IF(DCMTK_WITH_THREADS)
-  SET(WITH_THREADS 1)
-  MESSAGE(STATUS "Info: Thread support will be enabled")
-ELSE(DCMTK_WITH_THREADS)
-  SET(WITH_THREADS "")
-  MESSAGE(STATUS "Info: Thread support will be disabled")
-ENDIF(DCMTK_WITH_THREADS)
+if(DCMTK_WITH_THREADS)
+  set(WITH_THREADS 1)
+  message(STATUS "Info: Thread support will be enabled")
+else()
+  set(WITH_THREADS "")
+  message(STATUS "Info: Thread support will be disabled")
+endif()
 
 # Wide char file I/O support
-IF(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS)
-  SET(WIDE_CHAR_FILE_IO_FUNCTIONS 1)
-  MESSAGE(STATUS "Info: Wide char file I/O functions will be enabled")
-ELSE(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS)
-  SET(WIDE_CHAR_FILE_IO_FUNCTIONS "")
-  MESSAGE(STATUS "Info: Wide char file I/O functions will be disabled")
-ENDIF(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS)
+if(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS)
+  set(WIDE_CHAR_FILE_IO_FUNCTIONS 1)
+  message(STATUS "Info: Wide char file I/O functions will be enabled")
+else()
+  set(WIDE_CHAR_FILE_IO_FUNCTIONS "")
+  message(STATUS "Info: Wide char file I/O functions will be disabled")
+endif()
 
 # Wide char main function
-IF(DCMTK_WIDE_CHAR_MAIN_FUNCTION)
-  SET(WIDE_CHAR_MAIN_FUNCTION 1)
-  MESSAGE(STATUS "Info: Wide char main function for command line tools will be enabled")
-ELSE(DCMTK_WIDE_CHAR_MAIN_FUNCTION)
-  SET(WIDE_CHAR_MAIN_FUNCTION "")
-  MESSAGE(STATUS "Info: Wide char main function for command line tools will be disabled")
-ENDIF(DCMTK_WIDE_CHAR_MAIN_FUNCTION)
-
-IF(NOT DCMTK_ENABLE_CHARSET_CONVERSION)
-  SET(DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING "Select character set conversion implementation.")
-  IF(DCMTK_WITH_ICONV)
-    IF(DCMTK_WITH_ICU)
-      MESSAGE(WARNING "Warning: Both ICU and the libiconv are available, using libiconv. Modify DCMTK_ENABLE_CHARSET_CONVERSION for switching to ICU")
-    ENDIF()
-    SET(DCMTK_ENABLE_CHARSET_CONVERSION "libiconv" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}")
-  ELSEIF(DCMTK_WITH_ICU)
-    SET(DCMTK_ENABLE_CHARSET_CONVERSION "ICU" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}")
-  ELSEIF(DCMTK_WITH_STDLIBC_ICONV)
-    SET(DCMTK_ENABLE_CHARSET_CONVERSION "stdlibc (iconv)" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}")
-  ELSE()
-    SET(DCMTK_ENABLE_CHARSET_CONVERSION "<disabled>" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}")
-  ENDIF()
-ENDIF()
-
-SET(DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES)
-IF(DCMTK_WITH_ICONV)
-  LIST(APPEND DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES "libiconv")
-ENDIF()
-IF(DCMTK_WITH_ICU)
-  LIST(APPEND DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES "ICU")
-ENDIF()
-IF(DCMTK_WITH_STDLIBC_ICONV)
-  LIST(APPEND DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES "stdlibc (iconv)")
-ENDIF()
-SET_PROPERTY(CACHE DCMTK_ENABLE_CHARSET_CONVERSION PROPERTY STRINGS ${DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES} "<disabled>")
-
-IF(DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "libiconv" OR DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "DCMTK_CHARSET_CONVERSION_ICONV")
-  MESSAGE(STATUS "Info: Building DCMTK with character set conversion support using libiconv")
-  SET(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_ICONV")
-  SET(CHARSET_CONVERSION_LIBS ${LIBICONV_LIBS})
-ELSEIF(DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "ICU" OR DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "DCMTK_CHARSET_CONVERSION_ICU")
-  MESSAGE(STATUS "Info: Building DCMTK with character set conversion support using the ICU")
-  SET(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_ICU")
-  SET(CHARSET_CONVERSION_LIBS ${ICU_LIBS})
-ELSEIF(DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "stdlibc (iconv)" OR DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV")
-  MESSAGE(STATUS "Info: Building DCMTK with character set conversion support using builtin iconv functions from the C standard library")
-  SET(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV")
-ELSE()
-  MESSAGE(STATUS "Info: Building DCMTK without character set conversion support")
-  SET(DCMTK_ENABLE_CHARSET_CONVERSION OFF)
-ENDIF()
+if(DCMTK_WIDE_CHAR_MAIN_FUNCTION)
+  set(WIDE_CHAR_MAIN_FUNCTION 1)
+  message(STATUS "Info: Wide char main function for command line tools will be enabled")
+else()
+  set(WIDE_CHAR_MAIN_FUNCTION "")
+  message(STATUS "Info: Wide char main function for command line tools will be disabled")
+endif()
+
+if(NOT DCMTK_ENABLE_CHARSET_CONVERSION)
+  set(DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING "Select character set conversion implementation.")
+  if(DCMTK_WITH_ICONV)
+    if(DCMTK_WITH_ICU)
+      message(WARNING "Warning: Both ICU and the libiconv are available, using libiconv. Modify DCMTK_ENABLE_CHARSET_CONVERSION for switching to ICU")
+    endif()
+    set(DCMTK_ENABLE_CHARSET_CONVERSION "libiconv" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}")
+  elseif(DCMTK_WITH_ICU)
+    set(DCMTK_ENABLE_CHARSET_CONVERSION "ICU" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}")
+  elseif(DCMTK_WITH_STDLIBC_ICONV)
+    set(DCMTK_ENABLE_CHARSET_CONVERSION "stdlibc (iconv)" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}")
+  else()
+    set(DCMTK_ENABLE_CHARSET_CONVERSION "<disabled>" CACHE STRING "${DCMTK_ENABLE_CHARSET_CONVERSION_DOCSTRING}")
+  endif()
+endif()
+
+set(DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES)
+if(DCMTK_WITH_ICONV)
+  list(APPEND DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES "libiconv")
+endif()
+if(DCMTK_WITH_ICU)
+  list(APPEND DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES "ICU")
+endif()
+if(DCMTK_WITH_STDLIBC_ICONV)
+  list(APPEND DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES "stdlibc (iconv)")
+endif()
+set_property(CACHE DCMTK_ENABLE_CHARSET_CONVERSION PROPERTY STRINGS ${DCMTK_ENABLE_CHARSET_CONVERSION_ALTERNATIVES} "<disabled>")
+
+if(DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "libiconv" OR DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "DCMTK_CHARSET_CONVERSION_ICONV")
+  message(STATUS "Info: Building DCMTK with character set conversion support using libiconv")
+  set(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_ICONV")
+  set(CHARSET_CONVERSION_LIBS ${LIBICONV_LIBS})
+elseif(DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "ICU" OR DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "DCMTK_CHARSET_CONVERSION_ICU")
+  message(STATUS "Info: Building DCMTK with character set conversion support using the ICU")
+  set(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_ICU")
+  set(CHARSET_CONVERSION_LIBS ${ICU_LIBS})
+elseif(DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "stdlibc (iconv)" OR DCMTK_ENABLE_CHARSET_CONVERSION STREQUAL "DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV")
+  message(STATUS "Info: Building DCMTK with character set conversion support using builtin iconv functions from the C standard library")
+  set(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV")
+else()
+  message(STATUS "Info: Building DCMTK without character set conversion support")
+  set(DCMTK_ENABLE_CHARSET_CONVERSION OFF)
+endif()
 
 # Standard C++ headers (currently hard-coded)
-#IF(VTK_USE_ANSI_STDLIB)
-  SET(USE_STD_CXX_INCLUDES 1)
-#ELSE(VTK_USE_ANSI_STDLIB)
-#  SET(USE_STD_CXX_INCLUDES "")
-#ENDIF(VTK_USE_ANSI_STDLIB)
+#if(VTK_USE_ANSI_STDLIB)
+  set(USE_STD_CXX_INCLUDES 1)
+#else()
+#  set(USE_STD_CXX_INCLUDES "")
+#endif()
 
 # Configure file
 
 # Windows being windows, it lies about its processor type to 32 bit binaries
-SET(SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}")
-IF(NOT SYSTEM_PROCESSOR)
-  SET(SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
-ENDIF(NOT SYSTEM_PROCESSOR)
+set(SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}")
+if(NOT SYSTEM_PROCESSOR)
+  set(SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
+endif()
 # CMake doesn't provide a configure-style system type string
-SET(CANONICAL_HOST_TYPE "${SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}")
+set(CANONICAL_HOST_TYPE "${SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}")
 DCMTK_UNSET(SYSTEM_PROCESSOR)
 
 # Configure dictionary path and install prefix
-IF(WIN32 AND NOT CYGWIN)
+if(WIN32 AND NOT CYGWIN)
   # Set DCMTK_PREFIX needed within some code. Be sure that all / are replaced by \\.
-  SET(DCMTK_PREFIX "${CMAKE_INSTALL_PREFIX}")
-  STRING(REGEX REPLACE "/" "\\\\\\\\" DCMTK_PREFIX "${DCMTK_PREFIX}")
+  set(DCMTK_PREFIX "${CMAKE_INSTALL_PREFIX}")
+  string(REGEX REPLACE "/" "\\\\\\\\" DCMTK_PREFIX "${DCMTK_PREFIX}")
   # Set path and multiple path separator being used in dictionary code etc.
-  SET(PATH_SEPARATOR "\\\\")
-  SET(ENVIRONMENT_PATH_SEPARATOR ";")
+  set(PATH_SEPARATOR "\\\\")
+  set(ENVIRONMENT_PATH_SEPARATOR ";")
   # Set dictionary path to the data dir inside install main dir (prefix)
-  IF(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
-    SET(DCM_DICT_DEFAULT_PATH "${DCMTK_PREFIX}\\\\${CMAKE_INSTALL_DATADIR}\\\\dcmtk\\\\dicom.dic")
+  if(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
+    set(DCM_DICT_DEFAULT_PATH "${DCMTK_PREFIX}\\\\${CMAKE_INSTALL_DATADIR}\\\\dcmtk\\\\dicom.dic")
     # If private dictionary should be utilized, add it to default dictionary path.
-    IF(ENABLE_PRIVATE_TAGS)
-      SET(DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH};${DCMTK_PREFIX}\\\\${CMAKE_INSTALL_DATADIR}\\\\dcmtk\\\\private.dic")
-    ENDIF(ENABLE_PRIVATE_TAGS)
+    if(ENABLE_PRIVATE_TAGS)
+      set(DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH};${DCMTK_PREFIX}\\\\${CMAKE_INSTALL_DATADIR}\\\\dcmtk\\\\private.dic")
+    endif()
      # Again, for Windows strip all / from path and replace it with \\.
-    STRING(REGEX REPLACE "/" "\\\\\\\\" DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH}")
-  ELSE(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
-    SET(DCM_DICT_DEFAULT_PATH "")
-  ENDIF(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
+    string(REGEX REPLACE "/" "\\\\\\\\" DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH}")
+  else()
+    set(DCM_DICT_DEFAULT_PATH "")
+  endif()
   # Set default directory for configuration and support data.
-  SET(DCMTK_DEFAULT_CONFIGURATION_DIR "")
-  SET(DCMTK_DEFAULT_SUPPORT_DATA_DIR "")
-ELSE(WIN32 AND NOT CYGWIN)
+  set(DCMTK_DEFAULT_CONFIGURATION_DIR "")
+  set(DCMTK_DEFAULT_SUPPORT_DATA_DIR "")
+else()
   # Set DCMTK_PREFIX needed within some code.
-  SET(DCMTK_PREFIX "${CMAKE_INSTALL_PREFIX}")
+  set(DCMTK_PREFIX "${CMAKE_INSTALL_PREFIX}")
   # Set path and multiple path separator being used in dictionary code etc.
-  SET(PATH_SEPARATOR "/")
-  SET(ENVIRONMENT_PATH_SEPARATOR ":")
+  set(PATH_SEPARATOR "/")
+  set(ENVIRONMENT_PATH_SEPARATOR ":")
   # Set dictionary path to the data dir inside install main dir (prefix).
-  IF(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
-    SET(DCM_DICT_DEFAULT_PATH "${DCMTK_PREFIX}/${CMAKE_INSTALL_DATADIR}/dcmtk/dicom.dic")
+  if(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
+    set(DCM_DICT_DEFAULT_PATH "${DCMTK_PREFIX}/${CMAKE_INSTALL_DATADIR}/dcmtk/dicom.dic")
     # If private dictionary should be utilized, add it to default dictionary path.
-    IF(ENABLE_PRIVATE_TAGS)
-      SET(DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH}:${DCMTK_PREFIX}/${CMAKE_INSTALL_DATADIR}/dcmtk/private.dic")
-    ENDIF(ENABLE_PRIVATE_TAGS)
-  ELSE(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
-    SET(DCM_DICT_DEFAULT_PATH "")
-  ENDIF(DCMTK_ENABLE_EXTERNAL_DICTIONARY)
+    if(ENABLE_PRIVATE_TAGS)
+      set(DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH}:${DCMTK_PREFIX}/${CMAKE_INSTALL_DATADIR}/dcmtk/private.dic")
+    endif()
+  else()
+    set(DCM_DICT_DEFAULT_PATH "")
+  endif()
   # Set default directory for configuration and support data.
-  SET(DCMTK_DEFAULT_CONFIGURATION_DIR "${DCMTK_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}/dcmtk/")
-  SET(DCMTK_DEFAULT_SUPPORT_DATA_DIR "${DCMTK_PREFIX}/${CMAKE_INSTALL_DATADIR}/dcmtk/")
-ENDIF(WIN32 AND NOT CYGWIN)
+  set(DCMTK_DEFAULT_CONFIGURATION_DIR "${DCMTK_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}/dcmtk/")
+  set(DCMTK_DEFAULT_SUPPORT_DATA_DIR "${DCMTK_PREFIX}/${CMAKE_INSTALL_DATADIR}/dcmtk/")
+endif()
 
 # Check the sizes of various types
-INCLUDE (CheckTypeSize)
+include (CheckTypeSize)
 CHECK_TYPE_SIZE("char" SIZEOF_CHAR)
 CHECK_TYPE_SIZE("double" SIZEOF_DOUBLE)
 CHECK_TYPE_SIZE("float" SIZEOF_FLOAT)
@@ -179,65 +179,69 @@ CHECK_TYPE_SIZE("short" SIZEOF_SHORT)
 CHECK_TYPE_SIZE("void*" SIZEOF_VOID_P)
 
 # Check for include files, libraries, and functions
-INCLUDE("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkTryCompile.cmake")
-INCLUDE("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkTryRun.cmake")
-INCLUDE("${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake")
-INCLUDE("${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake")
-INCLUDE("${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake")
-INCLUDE("${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake")
-INCLUDE("${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake")
-INCLUDE("${DCMTK_CMAKE_INCLUDE}CMake/CheckFunctionWithHeaderExists.cmake")
-INCLUDE(CheckCXXSymbolExists OPTIONAL)
-IF(NOT COMMAND CHECK_CXX_SYMBOL_EXISTS)
+include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkTryCompile.cmake")
+include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkTryRun.cmake")
+include("${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake")
+include("${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake")
+include("${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake")
+include("${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake")
+include("${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake")
+include("${DCMTK_CMAKE_INCLUDE}CMake/CheckFunctionWithHeaderExists.cmake")
+include(CheckCXXSymbolExists OPTIONAL)
+if(NOT COMMAND CHECK_CXX_SYMBOL_EXISTS)
   # fallback implementation for old CMake Versions
-  FUNCTION(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VAR)
-    SET(CODE)
-    FOREACH(FILE ${FILES})
-      SET(CODE "${CODE}#include <${FILE}>\n")
-    ENDFOREACH()
-    SET(CODE "${CODE}\nint main(int argc, char** argv)\n{\n  (void)argv;\n#ifndef ${SYMBOL}\n  return ((int*)(&${SYMBOL}))[argc];\n#else\n  (void)argc;\n  return 0;\n#endif\n}\n")
+  function(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VAR)
+    set(CODE)
+    foreach(FILE ${FILES})
+      set(CODE "${CODE}#include <${FILE}>\n")
+    endforeach()
+    set(CODE "${CODE}\nint main(int argc, char** argv)\n{\n  (void)argv;\n#ifndef ${SYMBOL}\n  return ((int*)(&${SYMBOL}))[argc];\n#else\n  (void)argc;\n  return 0;\n#endif\n}\n")
     DCMTK_TRY_COMPILE("${VAR}" "the compiler supports ${SYMBOL}" "${CODE}")
-  ENDFUNCTION()
-ENDIF(NOT COMMAND CHECK_CXX_SYMBOL_EXISTS)
+  endfunction()
+endif()
 
-FOREACH(FUNC "__FUNCTION__" "__PRETTY_FUNCTION__" "__func__")
+foreach(FUNC "__FUNCTION__" "__PRETTY_FUNCTION__" "__func__")
   CHECK_SYMBOL_EXISTS("${FUNC}" "" "HAVE_${FUNC}_C_MACRO")
   # test if the C++ compiler also supports them (e.g. SunPro doesn't)
   CHECK_CXX_SYMBOL_EXISTS("${FUNC}" "" "HAVE_${FUNC}_CXX_MACRO")
-  IF(HAVE_${FUNC}_C_MACRO AND HAVE_${FUNC}_CXX_MACRO)
-    SET("HAVE_${FUNC}_MACRO" 1 CACHE INTERNAL "Have symbol ${FUNC}" FORCE)
-  ELSE()
-    SET("HAVE_${FUNC}_MACRO" CACHE INTERNAL "Have symbol ${FUNC}" FORCE)
-  ENDIF()
-ENDFOREACH()
+  if(HAVE_${FUNC}_C_MACRO AND HAVE_${FUNC}_CXX_MACRO)
+    set("HAVE_${FUNC}_MACRO" 1 CACHE INTERNAL "Have symbol ${FUNC}" FORCE)
+  else()
+    set("HAVE_${FUNC}_MACRO" CACHE INTERNAL "Have symbol ${FUNC}" FORCE)
+  endif()
+endforeach()
 
 # prepare include directories for 3rdparty libraries before performing
 # header searches
-IF(ZLIB_INCDIR)
-  LIST(APPEND CMAKE_REQUIRED_INCLUDES "${ZLIB_INCDIR}")
-ENDIF(ZLIB_INCDIR)
+if(ZLIB_INCDIR)
+  list(APPEND CMAKE_REQUIRED_INCLUDES "${ZLIB_INCDIR}")
+endif()
 
-IF(ZLIB_INCLUDE_DIRS)
-  LIST(APPEND CMAKE_REQUIRED_INCLUDES "${ZLIB_INCLUDE_DIRS}")
-ENDIF(ZLIB_INCLUDE_DIRS)
+if(ZLIB_INCLUDE_DIRS)
+  list(APPEND CMAKE_REQUIRED_INCLUDES "${ZLIB_INCLUDE_DIRS}")
+endif()
 
-IF(LIBPNG_INCDIR)
-  LIST(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPNG_INCDIR}")
-ENDIF(LIBPNG_INCDIR)
+if(LIBPNG_INCDIR)
+  list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPNG_INCDIR}")
+endif()
 
-IF(PNG_INCLUDE_DIR)
-  LIST(APPEND CMAKE_REQUIRED_INCLUDES "${PNG_INCLUDE_DIR}")
-ENDIF(PNG_INCLUDE_DIR)
+if(PNG_INCLUDE_DIR)
+  list(APPEND CMAKE_REQUIRED_INCLUDES "${PNG_INCLUDE_DIR}")
+endif()
 
-IF(OPENSSL_INCDIR)
-  LIST(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}")
-ENDIF(OPENSSL_INCDIR)
+if(OPENSSL_INCDIR)
+  list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}")
+endif()
+
+if(OPENSSL_INCLUDE_DIR)
+  list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
+endif()
 
 # For Windows, hardcode these values to avoid long search times
-IF(WIN32 AND NOT CYGWIN)
+if(WIN32 AND NOT CYGWIN)
   CHECK_INCLUDE_FILE_CXX("windows.h" HAVE_WINDOWS_H)
   CHECK_INCLUDE_FILE_CXX("winsock.h" HAVE_WINSOCK_H)
-ENDIF(WIN32 AND NOT CYGWIN)
+endif()
 
   CHECK_INCLUDE_FILE_CXX("errno.h" HAVE_ERRNO_H)
   CHECK_INCLUDE_FILE_CXX("dirent.h" HAVE_DIRENT_H)
@@ -278,6 +282,7 @@ ENDIF(WIN32 AND NOT CYGWIN)
   CHECK_INCLUDE_FILE_CXX("cstdint" HAVE_CSTDINT)
   CHECK_INCLUDE_FILE_CXX("stdio.h" HAVE_STDIO_H)
   CHECK_INCLUDE_FILE_CXX("cstdio" HAVE_CSTDIO)
+  CHECK_INCLUDE_FILE_CXX("streambuf.h" HAVE_STREAMBUF_H)
   CHECK_INCLUDE_FILE_CXX("strings.h" HAVE_STRINGS_H)
   CHECK_INCLUDE_FILE_CXX("string.h" HAVE_STRING_H)
   CHECK_INCLUDE_FILE_CXX("strstream.h" HAVE_STRSTREAM_H)
@@ -302,6 +307,7 @@ ENDIF(WIN32 AND NOT CYGWIN)
   CHECK_INCLUDE_FILE_CXX("sys/wait.h" HAVE_SYS_WAIT_H)
   CHECK_INCLUDE_FILE_CXX("sys/socket.h" HAVE_SYS_SOCKET_H)
   CHECK_INCLUDE_FILE_CXX("thread.h" HAVE_THREAD_H)
+  CHECK_INCLUDE_FILE_CXX("process.h" HAVE_PROCESS_H)
   CHECK_INCLUDE_FILE_CXX("sys/stat.h" HAVE_SYS_STAT_H)
   CHECK_INCLUDE_FILE_CXX("time.h" HAVE_TIME_H)
   CHECK_INCLUDE_FILE_CXX("unistd.h" HAVE_UNISTD_H)
@@ -321,52 +327,216 @@ ENDIF(WIN32 AND NOT CYGWIN)
   CHECK_INCLUDE_FILE_CXX("signal.h" HAVE_SIGNAL_H)
   CHECK_INCLUDE_FILE_CXX("fenv.h" HAVE_FENV_H)
 
-IF(NOT APPLE)
+if(NOT APPLE)
   # poll on macOS is unreliable, it first did not exist, then was broken until
   # fixed in 10.9 only to break again in 10.12.
   CHECK_INCLUDE_FILE_CXX("poll.h" DCMTK_HAVE_POLL)
-  IF(DCMTK_HAVE_POLL)
-    ADD_DEFINITIONS(-DDCMTK_HAVE_POLL=1)
-  ENDIF(DCMTK_HAVE_POLL)
-ENDIF()
+  if(DCMTK_HAVE_POLL)
+    add_definitions(-DDCMTK_HAVE_POLL=1)
+  endif()
+endif()
 
   # This mimics the autoconf test. There are systems out there
   # (e.g. FreeBSD and NeXT) where tcp.h can't be compiled on its own.
-  SET(TCP_H_DEPS "")
-  IF(HAVE_SYS_TYPES_H)
+  set(TCP_H_DEPS "")
+  if(HAVE_SYS_TYPES_H)
     # This one is needed to make FreeBSD happy
-    SET(TCP_H_DEPS "sys/types.h")
-  ENDIF(HAVE_SYS_TYPES_H)
+    set(TCP_H_DEPS "sys/types.h")
+  endif()
   CHECK_INCLUDE_FILES("${TCP_H_DEPS};netinet/in_systm.h" HAVE_NETINET_IN_SYSTM_H)
-  IF(HAVE_NETINET_IN_SYSTM_H)
-    SET(TCP_H_DEPS "${TCP_H_DEPS};netinet/in_systm.h")
-  ENDIF(HAVE_NETINET_IN_SYSTM_H)
+  if(HAVE_NETINET_IN_SYSTM_H)
+    set(TCP_H_DEPS "${TCP_H_DEPS};netinet/in_systm.h")
+  endif()
   CHECK_INCLUDE_FILES("${TCP_H_DEPS};netinet/in.h" HAVE_NETINET_IN_H)
-  IF(HAVE_NETINET_IN_H)
-    SET(TCP_H_DEPS "${TCP_H_DEPS};netinet/in.h")
-  ENDIF(HAVE_NETINET_IN_H)
+  if(HAVE_NETINET_IN_H)
+    set(TCP_H_DEPS "${TCP_H_DEPS};netinet/in.h")
+  endif()
   CHECK_INCLUDE_FILES("${TCP_H_DEPS};netinet/tcp.h" HAVE_NETINET_TCP_H)
 
-  IF(NOT HAVE_PNG_H)
+  if(NOT HAVE_PNG_H)
     # <png.h> is unavailable, so test if we need to include it as <libpng/png.h>
     CHECK_INCLUDE_FILE_CXX("libpng/png.h" HAVE_LIBPNG_PNG_H)
-  ELSE(NOT HAVE_PNG_H)
+  else()
     # ensure including <png.h> is preferred
     DCMTK_UNSET_CACHE(HAVE_LIBPNG_PNG_H)
-  ENDIF(NOT HAVE_PNG_H)
+  endif()
 
   # There is no CMake macro to take care of these yet
 
-  IF(WIN32 AND NOT CYGWIN AND NOT MINGW)
-    SET(HAVE_NO_TYPEDEF_SSIZE_T TRUE)
-    SET(HAVE_NO_TYPEDEF_PID_T TRUE)
-  ELSE(WIN32 AND NOT CYGWIN AND NOT MINGW)
-    SET(HAVE_NO_TYPEDEF_PID_T FALSE)
-    SET(HAVE_NO_TYPEDEF_SIZE_T FALSE)
-    IF(NOT ${HAVE_SYS_TYPES_H})
-      SET(HAVE_NO_TYPEDEF_SSIZE_T TRUE)
-    ENDIF(NOT ${HAVE_SYS_TYPES_H})
-  ENDIF(WIN32 AND NOT CYGWIN AND NOT MINGW)
+  if(WIN32 AND NOT CYGWIN AND NOT MINGW)
+    set(HAVE_NO_TYPEDEF_SSIZE_T TRUE)
+    set(HAVE_NO_TYPEDEF_PID_T TRUE)
+  else()
+    set(HAVE_NO_TYPEDEF_PID_T FALSE)
+    set(HAVE_NO_TYPEDEF_SIZE_T FALSE)
+    if(NOT ${HAVE_SYS_TYPES_H})
+      set(HAVE_NO_TYPEDEF_SSIZE_T TRUE)
+    endif()
+  endif()
+
+  set(HEADERS)
+
+  if(HAVE_IO_H)
+    set(HEADERS ${HEADERS} io.h)
+  endif()
+
+  if(HAVE_IOSTREAM_H)
+    set(HEADERS ${HEADERS} iostream.h)
+  endif()
+
+  if(HAVE_MATH_H)
+    set(HEADERS ${HEADERS} math.h)
+  endif()
+
+  if(HAVE_LIBC_H)
+    set(HEADERS ${HEADERS} libc.h)
+  endif()
+
+  if(HAVE_THREAD_H)
+    set(HEADERS ${HEADERS} thread.h)
+  endif()
+
+  if(HAVE_PROCESS_H)
+    set(HEADERS ${HEADERS} process.h)
+  endif()
+
+  if(HAVE_PTHREAD_H)
+    set(HEADERS ${HEADERS} pthread.h)
+  endif()
+
+  if(HAVE_UNISTD_H)
+    set(HEADERS ${HEADERS} unistd.h)
+  endif()
+
+  if(HAVE_STDLIB_H)
+    set(HEADERS ${HEADERS} stdlib.h)
+  endif()
+
+  if(HAVE_STDINT_H)
+    set(HEADERS ${HEADERS} stdint.h)
+  endif()
+
+  if(HAVE_STDDEF_H)
+    set(HEADERS ${HEADERS} stddef.h)
+  endif()
+
+  if(HAVE_NETDB_H)
+    set(HEADERS ${HEADERS} netdb.h)
+  endif()
+
+  if(HAVE_SYS_FILE_H)
+    set(HEADERS ${HEADERS} sys/file.h)
+  endif()
+
+  if(HAVE_STRING_H)
+    set(HEADERS ${HEADERS} string.h)
+  endif()
+
+  if(HAVE_STRINGS_H)
+    set(HEADERS ${HEADERS} strings.h)
+  endif()
+
+  if(HAVE_SYS_WAIT_H)
+    set(HEADERS ${HEADERS} sys/wait.h)
+  endif()
+
+  if(HAVE_SYS_TIME_H)
+    set(HEADERS ${HEADERS} sys/time.h)
+  endif()
+
+  if(HAVE_SYS_RESOURCE_H)
+    set(HEADERS ${HEADERS} sys/resource.h)
+  endif()
+
+  if(HAVE_SYS_TYPES_H)
+    set(HEADERS ${HEADERS} sys/types.h)
+  endif()
+
+  if(HAVE_SYS_SOCKET_H)
+    set(HEADERS ${HEADERS} sys/socket.h)
+  endif()
+
+  if(HAVE_SYS_STAT_H)
+    set(HEADERS ${HEADERS} sys/stat.h)
+  endif()
+
+  if(HAVE_SYS_TIMEB_H)
+    set(HEADERS ${HEADERS} sys/timeb.h)
+  endif()
+
+  if(HAVE_STDARG_H)
+    set(HEADERS ${HEADERS} stdarg.h)
+  endif()
+
+  if(HAVE_STDIO_H)
+    set(HEADERS ${HEADERS} stdio.h)
+  endif()
+
+  if(HAVE_SYS_SELECT_H)
+    set(HEADERS ${HEADERS} sys/select.h)
+  endif()
+
+  if(HAVE_WINDOWS_H)
+    # also add winsock2.h and ws2tcpip.h that are available since Windows NT 4.0
+    set(HEADERS ${HEADERS} winsock2.h ws2tcpip.h windows.h)
+  endif()
+
+  if(HAVE_GRP_H)
+    set(HEADERS ${HEADERS} grp.h)
+  endif()
+
+  if(HAVE_PWD_H)
+    set(HEADERS ${HEADERS} pwd.h)
+  endif()
+
+  if(HAVE_DIRENT_H)
+    set(HEADERS ${HEADERS} dirent.h)
+  endif()
+
+  if(HAVE_SYS_SYSCALL_H)
+    set(HEADERS ${HEADERS} sys/syscall.h)
+  endif()
+
+  if(HAVE_WINSOCK_H)
+    set(HEADERS ${HEADERS} winsock.h)
+    set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} iphlpapi ws2_32 netapi32 wsock32)
+  endif()
+
+  if(HAVE_FENV_H)
+    set(HEADERS ${HEADERS} fenv.h)
+  endif()
+
+  # std::vsnprintf and std::vsnprintf need the C++ version of the headers.
+  # We just assume they exist when the C version was found
+  set(CXXHEADERS)
+
+  if(HAVE_CMATH)
+    set(CXXHEADERS ${CXXHEADERS} cmath)
+  endif()
+
+  if(HAVE_CSTDIO)
+    set(CXXHEADERS ${CXXHEADERS} cstdio)
+  endif()
+
+  if(HAVE_CSTDARG)
+    set(CXXHEADERS ${CXXHEADERS} cstdarg)
+  endif()
+
+  if(HAVE_CSTDINT)
+    set(CXXHEADERS ${CXXHEADERS} cstdint)
+  endif()
+
+  if(HAVE_CSTDDEF)
+    set(CXXHEADERS ${CXXHEADERS} cstddef)
+  endif()
+
+  if(WIN32)
+    # CHECK_FUNCTION_EXISTS does not work correctly on Windows (due to symbol name mangling)
+    # use CHECK_SYMBOL_EXISTS instead
+    macro(CHECK_FUNCTION_EXISTS FUNCTION VAR)
+      check_symbol_exists("${FUNCTION}" "${HEADERS}" "${VAR}")
+    endmacro()
+  endif()
 
   CHECK_FUNCTION_EXISTS(connect HAVE_CONNECT)
   CHECK_FUNCTION_EXISTS(accept HAVE_ACCEPT)
@@ -437,151 +607,12 @@ ENDIF()
   CHECK_FUNCTION_EXISTS(_findfirst HAVE__FINDFIRST)
   CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
 
-  SET(HEADERS)
-
-  IF(HAVE_IO_H)
-    SET(HEADERS ${HEADERS} io.h)
-  ENDIF(HAVE_IO_H)
-
-  IF(HAVE_IOSTREAM_H)
-    SET(HEADERS ${HEADERS} iostream.h)
-  ENDIF(HAVE_IOSTREAM_H)
-
-  IF(HAVE_MATH_H)
-    SET(HEADERS ${HEADERS} math.h)
-  ENDIF(HAVE_MATH_H)
-
-  IF(HAVE_CMATH)
-    SET(HEADERS ${HEADERS} cmath)
-  ENDIF(HAVE_CMATH)
-
-  IF(HAVE_LIBC_H)
-    SET(HEADERS ${HEADERS} libc.h)
-  ENDIF(HAVE_LIBC_H)
-
-  IF(HAVE_PTHREAD_H)
-    SET(HEADERS ${HEADERS} pthread.h)
-  ENDIF(HAVE_PTHREAD_H)
-
-  IF(HAVE_UNISTD_H)
-    SET(HEADERS ${HEADERS} unistd.h)
-  ENDIF(HAVE_UNISTD_H)
-
-  IF(HAVE_STDLIB_H)
-    SET(HEADERS ${HEADERS} stdlib.h)
-  ENDIF(HAVE_STDLIB_H)
-
-  IF(HAVE_STDINT_H)
-    SET(HEADERS ${HEADERS} stdint.h)
-  ENDIF(HAVE_STDINT_H)
-
-  IF(HAVE_STDDEF_H)
-    SET(HEADERS ${HEADERS} stddef.h)
-  ENDIF(HAVE_STDDEF_H)
-
-  IF(HAVE_NETDB_H)
-    SET(HEADERS ${HEADERS} netdb.h)
-  ENDIF(HAVE_NETDB_H)
-
-  IF(HAVE_SYS_FILE_H)
-    SET(HEADERS ${HEADERS} sys/file.h)
-  ENDIF(HAVE_SYS_FILE_H)
-
-  IF(HAVE_STRING_H)
-    SET(HEADERS ${HEADERS} string.h)
-  ENDIF(HAVE_STRING_H)
-
-  IF(HAVE_STRINGS_H)
-    SET(HEADERS ${HEADERS} strings.h)
-  ENDIF(HAVE_STRINGS_H)
-
-  IF(HAVE_SYS_WAIT_H)
-    SET(HEADERS ${HEADERS} sys/wait.h)
-  ENDIF(HAVE_SYS_WAIT_H)
-
-  IF(HAVE_SYS_TIME_H)
-    SET(HEADERS ${HEADERS} sys/time.h)
-  ENDIF(HAVE_SYS_TIME_H)
-
-  IF(HAVE_SYS_RESOURCE_H)
-    SET(HEADERS ${HEADERS} sys/resource.h)
-  ENDIF(HAVE_SYS_RESOURCE_H)
-
-  IF(HAVE_SYS_TYPES_H)
-    SET(HEADERS ${HEADERS} sys/types.h)
-  ENDIF(HAVE_SYS_TYPES_H)
-
-  IF(HAVE_SYS_SOCKET_H)
-    SET(HEADERS ${HEADERS} sys/socket.h)
-  ENDIF(HAVE_SYS_SOCKET_H)
-
-  IF(HAVE_STDARG_H)
-    SET(HEADERS ${HEADERS} stdarg.h)
-  ENDIF(HAVE_STDARG_H)
-
-  IF(HAVE_STDIO_H)
-    SET(HEADERS ${HEADERS} stdio.h)
-  ENDIF(HAVE_STDIO_H)
-
-  IF(HAVE_SYS_SELECT_H)
-    SET(HEADERS ${HEADERS} sys/select.h)
-  ENDIF(HAVE_SYS_SELECT_H)
-
-  IF(HAVE_WINDOWS_H)
-    SET(HEADERS ${HEADERS} windows.h)
-  ENDIF(HAVE_WINDOWS_H)
-
-  IF(HAVE_GRP_H)
-    SET(HEADERS ${HEADERS} grp.h)
-  ENDIF(HAVE_GRP_H)
-
-  IF(HAVE_PWD_H)
-    SET(HEADERS ${HEADERS} pwd.h)
-  ENDIF(HAVE_PWD_H)
-
-  IF(HAVE_DIRENT_H)
-    SET(HEADERS ${HEADERS} dirent.h)
-  ENDIF(HAVE_DIRENT_H)
-
-  IF(HAVE_SYS_SYSCALL_H)
-    SET(HEADERS ${HEADERS} sys/syscall.h)
-  ENDIF(HAVE_SYS_SYSCALL_H)
-
-  IF(HAVE_WINSOCK_H)
-    SET(HEADERS ${HEADERS} winsock.h)
-    SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} iphlpapi ws2_32 netapi32 wsock32)
-  ENDIF(HAVE_WINSOCK_H)
-
-  IF(HAVE_FENV_H)
-    SET(HEADERS ${HEADERS} fenv.h)
-  ENDIF(HAVE_FENV_H)
-
-  # std::vsnprintf and std::vsnprintf need the C++ version of the headers.
-  # We just assume they exist when the C version was found
-  SET(CXXHEADERS)
-
-  IF(HAVE_CSTDIO)
-    SET(CXXHEADERS ${CXXHEADERS} cstdio)
-  ENDIF(HAVE_CSTDIO)
-
-  IF(HAVE_CSTDARG)
-    SET(CXXHEADERS ${CXXHEADERS} cstdarg)
-  ENDIF(HAVE_CSTDARG)
-
-  IF(HAVE_CSTDINT)
-    SET(CXXHEADERS ${CXXHEADERS} cstdint)
-  ENDIF(HAVE_CSTDINT)
-
-  IF(HAVE_CSTDDEF)
-    SET(CXXHEADERS ${CXXHEADERS} cstddef)
-  ENDIF(HAVE_CSTDDEF)
-
   CHECK_FUNCTIONWITHHEADER_EXISTS(feenableexcept "${HEADERS}" HAVE_PROTOTYPE_FEENABLEEXCEPT)
-  CHECK_FUNCTIONWITHHEADER_EXISTS(isinf(0.) "${HEADERS}" HAVE_PROTOTYPE_ISINF)
-  CHECK_FUNCTIONWITHHEADER_EXISTS(isnan(0.) "${HEADERS}" HAVE_PROTOTYPE_ISNAN)
+  CHECK_FUNCTIONWITHHEADER_EXISTS("isinf(0.)" "${HEADERS}" HAVE_PROTOTYPE_ISINF)
+  CHECK_FUNCTIONWITHHEADER_EXISTS("isnan(0.)" "${HEADERS}" HAVE_PROTOTYPE_ISNAN)
   CHECK_FUNCTIONWITHHEADER_EXISTS(finite "${HEADERS}" HAVE_PROTOTYPE_FINITE)
-  CHECK_FUNCTIONWITHHEADER_EXISTS(std::isinf "${HEADERS}" HAVE_PROTOTYPE_STD__ISINF)
-  CHECK_FUNCTIONWITHHEADER_EXISTS(std::isnan "${HEADERS}" HAVE_PROTOTYPE_STD__ISNAN)
+  CHECK_FUNCTIONWITHHEADER_EXISTS("std::isinf(0.)" "${CXXHEADERS}" HAVE_PROTOTYPE_STD__ISINF)
+  CHECK_FUNCTIONWITHHEADER_EXISTS("std::isnan(0.)" "${CXXHEADERS}" HAVE_PROTOTYPE_STD__ISNAN)
   CHECK_FUNCTIONWITHHEADER_EXISTS(std::finite "${HEADERS}" HAVE_PROTOTYPE_STD__FINITE)
   CHECK_FUNCTIONWITHHEADER_EXISTS(flock "${HEADERS}" HAVE_PROTOTYPE_FLOCK)
   CHECK_FUNCTIONWITHHEADER_EXISTS(gethostbyname "${HEADERS}" HAVE_PROTOTYPE_GETHOSTBYNAME)
@@ -624,7 +655,7 @@ ENDIF()
   CHECK_FUNCTIONWITHHEADER_EXISTS(strerror_r "${HEADERS}" HAVE_PROTOTYPE_STRERROR_R)
   CHECK_FUNCTIONWITHHEADER_EXISTS(SYS_gettid "${HEADERS}" HAVE_SYS_GETTID)
   # "definition" is an (exchangeable) identifier that is needed for successful compile test
-  CHECK_FUNCTIONWITHHEADER_EXISTS("std::ios_base::openmode definition" "${HEADERS}" HAVE_DECLARATION_STD__IOS_BASE__OPENMODE)
+  CHECK_FUNCTIONWITHHEADER_EXISTS("std::ios_base::openmode definition" "${CXXHEADERS}" HAVE_DECLARATION_STD__IOS_BASE__OPENMODE)
   CHECK_FUNCTIONWITHHEADER_EXISTS(pthread_rwlock_init "${HEADERS}" HAVE_PTHREAD_RWLOCK)
   CHECK_FUNCTIONWITHHEADER_EXISTS("__sync_add_and_fetch((int*)0,0)" "${HEADERS}" HAVE_SYNC_ADD_AND_FETCH)
   CHECK_FUNCTIONWITHHEADER_EXISTS("__sync_sub_and_fetch((int*)0,0)" "${HEADERS}" HAVE_SYNC_SUB_AND_FETCH)
@@ -637,9 +668,7 @@ ENDIF()
   CHECK_FUNCTIONWITHHEADER_EXISTS("readdir_r((DIR*)0,(dirent*)0)" "${HEADERS}" HAVE_OLD_READDIR_R)
   CHECK_FUNCTIONWITHHEADER_EXISTS(nanosleep "${HEADERS}" HAVE_PROTOTYPE_NANOSLEEP)
   CHECK_FUNCTIONWITHHEADER_EXISTS("&passwd::pw_gecos" "${HEADERS}" HAVE_PASSWD_GECOS)
-
-  # TODO: Uncommented because it seems not to make sense. Remove if there are no complaints.
-  #CHECK_LIBRARY_EXISTS(iostream "" "" HAVE_LIBIOSTREAM)
+  CHECK_FUNCTIONWITHHEADER_EXISTS("TryAcquireSRWLockShared((PSRWLOCK)0)" "${HEADERS}" HAVE_PROTOTYPE_TRYACQUIRESRWLOCKSHARED)
 
   # Check for some type definitions needed by JasPer and defines them if necessary
   # Even if not functions but types are looked for, the script works fine.
@@ -666,25 +695,25 @@ ENDIF()
   # Signal handling functions
   CHECK_FUNCTIONWITHHEADER_EXISTS("sigjmp_buf definition" "setjmp.h" HAVE_SIGJMP_BUF)
 
-IF(DCMTK_WITH_OPENSSL)
+if(DCMTK_WITH_OPENSSL)
   # Check if OpenSSL provides the SSL_CTX_get0_param function
   CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_get0_param" "openssl/ssl.h" HAVE_SSL_CTX_GET0_PARAM ${OPENSSL_LIBS})
   CHECK_FUNCTIONWITHHEADER_EXISTS("RAND_egd" "openssl/rand.h" HAVE_RAND_EGD ${OPENSSL_LIBS})
-ENDIF(DCMTK_WITH_OPENSSL)
+endif()
 
-IF(HAVE_LOCKF AND ANDROID)
+if(HAVE_LOCKF AND ANDROID)
   # When Android introduced lockf, they forgot to put the constants like F_LOCK in the
   # appropriate headers, this tests if they are defined and disables lockf if they are not
   CHECK_FUNCTIONWITHHEADER_EXISTS("lockf(0, F_LOCK, 0)" "${HEADERS}" HAVE_LOCKF_CONSTANTS)
-  IF(NOT HAVE_LOCKF_CONSTANTS)
-    SET(HAVE_LOCKF FALSE CACHE INTERNAL "lockf implementation is broken")
-  ENDIF()
-ENDIF(HAVE_LOCKF AND ANDROID)
+  if(NOT HAVE_LOCKF_CONSTANTS)
+    set(HAVE_LOCKF FALSE CACHE INTERNAL "lockf implementation is broken")
+  endif()
+endif()
 
 # Tests that require a try-compile
 
-IF(HAVE_MATH_H)
-  IF(HAVE_LIBC_H)
+if(HAVE_MATH_H)
+  if(HAVE_LIBC_H)
     # checks if <libc.h> and <math.h> cause a problem if libc.h is included extern "C"
     # and math.h is not. This is the case on QNX 6.2.x and 6.5.x.
     DCMTK_TRY_COMPILE(INCLUDE_LIBC_H_AS_EXTERN_C "<libc.h> can be included as extern \"C\""
@@ -697,12 +726,12 @@ int main()
     int i = 0;
     return 0;
 }")
-    IF(INCLUDE_LIBC_H_AS_EXTERN_C)
-      SET(INCLUDE_LIBC_H_AS_CXX 0 CACHE INTERNAL "libc.h should be treated as a C++ header")
-    ELSE()
-      SET(INCLUDE_LIBC_H_AS_CXX 1 CACHE INTERNAL "libc.h should be treated as a C++ header")
-    ENDIF()
-  ENDIF(HAVE_LIBC_H)
+    if(INCLUDE_LIBC_H_AS_EXTERN_C)
+      set(INCLUDE_LIBC_H_AS_CXX 0 CACHE INTERNAL "libc.h should be treated as a C++ header")
+    else()
+      set(INCLUDE_LIBC_H_AS_CXX 1 CACHE INTERNAL "libc.h should be treated as a C++ header")
+    endif()
+  endif()
 
   # checks if <math.h> must be included as a C++ include file (i.e. without extern "C").
   # Some sytems (Win32, HP/UX 10) use C++ language features in <math.h>.
@@ -715,31 +744,31 @@ int main()
     int i = 0;
     return 0;
 }")
-  IF(INCLUDE_MATH_H_AS_EXTERN_C)
-    SET(INCLUDE_MATH_H_AS_CXX 0 CACHE INTERNAL "math.h should be treated as a C++ header")
-  ELSE()
-    SET(INCLUDE_MATH_H_AS_CXX 1 CACHE INTERNAL "math.h should be treated as a C++ header")
-  ENDIF()
-ENDIF(HAVE_MATH_H)
+  if(INCLUDE_MATH_H_AS_EXTERN_C)
+    set(INCLUDE_MATH_H_AS_CXX 0 CACHE INTERNAL "math.h should be treated as a C++ header")
+  else()
+    set(INCLUDE_MATH_H_AS_CXX 1 CACHE INTERNAL "math.h should be treated as a C++ header")
+  endif()
+endif()
 
 
-IF(NOT DEFINED C_CHAR_UNSIGNED)
-  MESSAGE(STATUS "Checking signedness of char")
+if(NOT DEFINED C_CHAR_UNSIGNED)
+  message(STATUS "Checking signedness of char")
   DCMTK_TRY_RUN(C_CHAR_SIGNED C_CHAR_SIGNED_COMPILED "${CMAKE_BINARY_DIR}/CMakeTmp/Char"
           "${DCMTK_SOURCE_DIR}/CMake/dcmtkTestCharSignedness.cc"
           COMPILE_OUTPUT_VARIABLE C_CHAR_SIGNED_COMPILE_OUTPUT)
-  IF(C_CHAR_SIGNED_COMPILED)
-    IF(C_CHAR_SIGNED)
-      MESSAGE(STATUS "Checking signedness of char -- signed")
-      SET(C_CHAR_UNSIGNED 0 CACHE INTERNAL "Whether char is unsigned.")
-    ELSE(C_CHAR_SIGNED)
-      MESSAGE(STATUS "Checking signedness of char -- unsigned")
-      SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.")
-    ENDIF(C_CHAR_SIGNED)
-  ELSE(C_CHAR_SIGNED_COMPILED)
-    MESSAGE(STATUS "Checking signedness of char -- failed")
-  ENDIF(C_CHAR_SIGNED_COMPILED)
-ENDIF(NOT DEFINED C_CHAR_UNSIGNED)
+  if(C_CHAR_SIGNED_COMPILED)
+    if(C_CHAR_SIGNED)
+      message(STATUS "Checking signedness of char -- signed")
+      set(C_CHAR_UNSIGNED 0 CACHE INTERNAL "Whether char is unsigned.")
+    else()
+      message(STATUS "Checking signedness of char -- unsigned")
+      set(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.")
+    endif()
+  else()
+    message(STATUS "Checking signedness of char -- failed")
+  endif()
+endif()
 
 DCMTK_TRY_COMPILE(HAVE_CXX_BOOL "C++ type bool exists"
     "// Minimal test for existence of 'bool' type.
@@ -753,9 +782,9 @@ int main()
 }")
 
 # Check for thread type
-IF(HAVE_WINDOWS_H)
-  SET(HAVE_INT_TYPE_PTHREAD_T 1)
-ELSE(HAVE_WINDOWS_H)
+if(HAVE_WINDOWS_H)
+  set(HAVE_INT_TYPE_PTHREAD_T 1)
+else()
   DCMTK_TRY_COMPILE(HAVE_INT_TYPE_PTHREAD_T "pthread_t is an integer type"
         "// test to see if pthread_t is a pointer type or not
 
@@ -767,12 +796,12 @@ int main ()
   unsigned long l = p;
   return 0;
 }")
-  IF(NOT HAVE_INT_TYPE_PTHREAD_T)
-    SET(HAVE_POINTER_TYPE_PTHREAD_T 1 CACHE INTERNAL "Set if pthread_t is a pointer type")
-  ELSE(NOT HAVE_INT_TYPE_PTHREAD_T)
-    SET(HAVE_POINTER_TYPE_PTHREAD_T 0 CACHE INTERNAL "Set if pthread_t is a pointer type")
-  ENDIF(NOT HAVE_INT_TYPE_PTHREAD_T)
-ENDIF(HAVE_WINDOWS_H)
+  if(NOT HAVE_INT_TYPE_PTHREAD_T)
+    set(HAVE_POINTER_TYPE_PTHREAD_T 1 CACHE INTERNAL "Set if pthread_t is a pointer type")
+  else()
+    set(HAVE_POINTER_TYPE_PTHREAD_T 0 CACHE INTERNAL "Set if pthread_t is a pointer type")
+  endif()
+endif()
 
 # Check if typename works properly. Only MSC6 really fails here.
 DCMTK_TRY_COMPILE(HAVE_TYPENAME "typename works correctly"
@@ -821,11 +850,11 @@ int main()
     int i = strerror_r(0, buf, 100);
     return i;
 }")
-IF(HAVE_INT_STRERROR_R)
-  SET(HAVE_CHARP_STRERROR_R 0 CACHE INTERNAL "Set if strerror_r() returns a char*")
-ELSE(HAVE_INT_STRERROR_R)
-  SET(HAVE_CHARP_STRERROR_R 1 CACHE INTERNAL "Set if strerror_r() returns a char*")
-ENDIF(HAVE_INT_STRERROR_R)
+if(HAVE_INT_STRERROR_R)
+  set(HAVE_CHARP_STRERROR_R 0 CACHE INTERNAL "Set if strerror_r() returns a char*")
+else()
+  set(HAVE_CHARP_STRERROR_R 1 CACHE INTERNAL "Set if strerror_r() returns a char*")
+endif()
 
 # Check if variable length arrays are supported.
 DCMTK_TRY_COMPILE(HAVE_VLA "variable length arrays are supported"
@@ -849,235 +878,235 @@ int main()
 }")
 
 # do try compile to detect lfs and flags
-FUNCTION(DCMTK_LFS_TRY_COMPILE VAR FILE FLAGS DEFINITIONS)
-  IF(FLAGS OR DEFINITIONS)
-    SET(OPTIONS " with arguments: \"")
-  ELSE()
-    SET(OPTIONS)
-  ENDIF()
-  IF(DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS OR FLAGS)
-    SET(CMAKE_FLAGS CMAKE_FLAGS ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS})
-    IF(FLAGS)
-      LIST(APPEND CMAKE_FLAGS "-DCMAKE_C_FLAGS:STRING=${FLAGS}")
-      SET(OPTIONS "${OPTIONS}${FLAGS}")
-    ENDIF()
-  ELSE()
-    SET(CMAKE_FLAGS)
-  ENDIF()
-  IF(DEFINITIONS)
-    SET(COMPILE_DEFINITIONS COMPILE_DEFINITIONS ${DEFINITIONS})
-    IF(FLAGS)
-      SET(OPTIONS "${OPTIONS} ")
-    ENDIF()
-    SET(OPTIONS "${OPTIONS}${DEFINITIONS}")
-  ELSE()
-    SET(COMPILE_DEFINITIONS)
-  ENDIF()
-  IF(FLAGS OR DEFINITIONS)
-    SET(OPTIONS "${OPTIONS}\"")
-  ENDIF()
-  SET(SOURCEFILE "${DCMTK_SOURCE_DIR}/config/tests/${FILE}")
-  TRY_COMPILE(RESULT
+function(DCMTK_LFS_TRY_COMPILE VAR FILE FLAGS DEFINITIONS)
+  if(FLAGS OR DEFINITIONS)
+    set(OPTIONS " with arguments: \"")
+  else()
+    set(OPTIONS)
+  endif()
+  if(DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS OR FLAGS)
+    set(CMAKE_FLAGS CMAKE_FLAGS ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS})
+    if(FLAGS)
+      list(APPEND CMAKE_FLAGS "-DCMAKE_C_FLAGS:STRING=${FLAGS}")
+      set(OPTIONS "${OPTIONS}${FLAGS}")
+    endif()
+  else()
+    set(CMAKE_FLAGS)
+  endif()
+  if(DEFINITIONS)
+    set(COMPILE_DEFINITIONS COMPILE_DEFINITIONS ${DEFINITIONS})
+    if(FLAGS)
+      set(OPTIONS "${OPTIONS} ")
+    endif()
+    set(OPTIONS "${OPTIONS}${DEFINITIONS}")
+  else()
+    set(COMPILE_DEFINITIONS)
+  endif()
+  if(FLAGS OR DEFINITIONS)
+    set(OPTIONS "${OPTIONS}\"")
+  endif()
+  set(SOURCEFILE "${DCMTK_SOURCE_DIR}/config/tests/${FILE}")
+  try_compile(RESULT
         "${CMAKE_BINARY_DIR}"
         "${SOURCEFILE}"
         ${CMAKE_FLAGS}
         ${COMPILE_DEFINITIONS}
         OUTPUT_VARIABLE OUTPUT
   )
-  SET("${VAR}" "${RESULT}" PARENT_SCOPE)
-  IF(RESULT)
-    SET(LOGFILE "CMakeOutput.log")
-    SET(LOG "succeded")
-  ELSE()
-    SET(LOGFILE "CMakeError.log")
-    SET(LOG "failed")
-  ENDIF()
-  FILE(TO_NATIVE_PATH "${SOURCEFILE}" SOURCEFILE)
-  FILE(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${LOGFILE}"
+  set("${VAR}" "${RESULT}" PARENT_SCOPE)
+  if(RESULT)
+    set(LOGFILE "CMakeOutput.log")
+    set(LOG "succeded")
+  else()
+    set(LOGFILE "CMakeError.log")
+    set(LOG "failed")
+  endif()
+  file(TO_NATIVE_PATH "${SOURCEFILE}" SOURCEFILE)
+  file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${LOGFILE}"
     "compiling \"${SOURCEFILE}\"${OPTIONS} ${LOG} with the following output:\n"
     "${OUTPUT}\n"
   )
-ENDFUNCTION(DCMTK_LFS_TRY_COMPILE)
+endfunction()
 
-FUNCTION(DCMTK_CHECK_ENABLE_LFS)
+function(DCMTK_CHECK_ENABLE_LFS)
   # normalize arguments
-  IF(DCMTK_ENABLE_LFS)
+  if(DCMTK_ENABLE_LFS)
     # for cases insensitive comparison
-    STRING(TOLOWER "${DCMTK_ENABLE_LFS}" DCMTK_ENABLE_LFS)
-  ENDIF()
-  IF(NOT DCMTK_ENABLE_LFS OR DCMTK_ENABLE_LFS MATCHES "^(on|true|yes|1)$")
-    SET(DCMTK_ENABLE_LFS "auto")
-  ELSEIF(DCMTK_ENABLE_LFS MATCHES "^(no|false|0)$")
-    SET(DCMTK_ENABLE_LFS "off")
-  ENDIF()
+    string(TOLOWER "${DCMTK_ENABLE_LFS}" DCMTK_ENABLE_LFS)
+  endif()
+  if(NOT DCMTK_ENABLE_LFS OR DCMTK_ENABLE_LFS MATCHES "^(on|true|yes|1)$")
+    set(DCMTK_ENABLE_LFS "auto")
+  elseif(DCMTK_ENABLE_LFS MATCHES "^(no|false|0)$")
+    set(DCMTK_ENABLE_LFS "off")
+  endif()
   # determin whether lfs64 is available in case it wasn't detected yet it may be used
-  IF(NOT DEFINED DCMTK_LFS64_AVAILABLE AND DCMTK_ENABLE_LFS MATCHES "^(lfs64|auto)$")
-    SET(DCMTK_LFS64_DEFINITIONS)
-    SET(MESSAGE_RESULT "no")
-    SET(MESSAGE "Checking whether explicit large file support (LFS64) is available")
-    MESSAGE(STATUS "${MESSAGE}")
+  if(NOT DEFINED DCMTK_LFS64_AVAILABLE AND DCMTK_ENABLE_LFS MATCHES "^(lfs64|auto)$")
+    set(DCMTK_LFS64_DEFINITIONS)
+    set(MESSAGE_RESULT "no")
+    set(MESSAGE "Checking whether explicit large file support (LFS64) is available")
+    message(STATUS "${MESSAGE}")
     DCMTK_LFS_TRY_COMPILE(RESULT "lfs64.cc" "" "")
-    IF(NOT RESULT)
+    if(NOT RESULT)
       DCMTK_LFS_TRY_COMPILE(RESULT "lfs64.cc" "" "-D_LARGEFILE64_SOURCE")
-      IF(RESULT)
-        SET(DCMTK_LFS64_DEFINITIONS "-D_LARGEFILE64_SOURCE")
-        SET(MESSAGE_RESULT "yes, with ${DCMTK_LFS64_DEFINITIONS}")
-      ENDIF()
-    ELSE()
-      SET(MESSAGE_RESULT "yes")
-    ENDIF()
-    IF(RESULT)
-      SET(DCMTK_ENABLE_LFS "lfs64")
-      SET(DCMTK_LFS64_DEFINITIONS "${DCMTK_LFS64_DEFINITIONS}" CACHE INTERNAL "which compiler definitions to set for enabling LFS64 support")
-    ENDIF()
-    SET(DCMTK_LFS64_AVAILABLE "${RESULT}" CACHE INTERNAL "whether LFS64 is available or not" FORCE)
-    MESSAGE(STATUS "${MESSAGE} -- ${MESSAGE_RESULT}")
-  ENDIF()
+      if(RESULT)
+        set(DCMTK_LFS64_DEFINITIONS "-D_LARGEFILE64_SOURCE")
+        set(MESSAGE_RESULT "yes, with ${DCMTK_LFS64_DEFINITIONS}")
+      endif()
+    else()
+      set(MESSAGE_RESULT "yes")
+    endif()
+    if(RESULT)
+      set(DCMTK_ENABLE_LFS "lfs64")
+      set(DCMTK_LFS64_DEFINITIONS "${DCMTK_LFS64_DEFINITIONS}" CACHE INTERNAL "which compiler definitions to set for enabling LFS64 support")
+    endif()
+    set(DCMTK_LFS64_AVAILABLE "${RESULT}" CACHE INTERNAL "whether LFS64 is available or not" FORCE)
+    message(STATUS "${MESSAGE} -- ${MESSAGE_RESULT}")
+  endif()
   # determin whether lfs is available in case it wasn't detected yet it may be used
-  IF(NOT DEFINED DCMTK_LFS_AVAILABLE AND DCMTK_ENABLE_LFS MATCHES "^(lfs|auto)$")
-    SET(DCMTK_LFS_FLAGS)
-    SET(DCMTK_LFS_DEFINITIONS)
-    SET(MESSAGE_RESULT "no")
-    SET(MESSAGE "Checking whether large file support (LFS) is available")
-    MESSAGE(STATUS "${MESSAGE}")
+  if(NOT DEFINED DCMTK_LFS_AVAILABLE AND DCMTK_ENABLE_LFS MATCHES "^(lfs|auto)$")
+    set(DCMTK_LFS_FLAGS)
+    set(DCMTK_LFS_DEFINITIONS)
+    set(MESSAGE_RESULT "no")
+    set(MESSAGE "Checking whether large file support (LFS) is available")
+    message(STATUS "${MESSAGE}")
     # determine size of fpos_t (for the strange LFS implementation on Windows)
-    SET(CMAKE_EXTRA_INCLUDE_FILES)
-    IF(HAVE_STDIO_H)
+    set(CMAKE_EXTRA_INCLUDE_FILES)
+    if(HAVE_STDIO_H)
       # prefer stdio.h so that is not in namespace std
-      SET(CMAKE_EXTRA_INCLUDE_FILES "stdio.h")
-    ELSEIF(HAVE_CSTDIO)
+      set(CMAKE_EXTRA_INCLUDE_FILES "stdio.h")
+    elseif(HAVE_CSTDIO)
       # use cstdio as the fallback
-      SET(CMAKE_EXTRA_INCLUDE_FILES "cstdio")
-    ENDIF()
+      set(CMAKE_EXTRA_INCLUDE_FILES "cstdio")
+    endif()
     CHECK_TYPE_SIZE("fpos_t" SIZEOF_FPOS_T)
     # assume sizeof off_t to be correct, will be removed if below tests fail
-    SET(SIZEOF_OFF_T 8)
+    set(SIZEOF_OFF_T 8)
     # try compile different combinations of compiler flags and definitions
     DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "" "")
-    IF(NOT RESULT)
-      SET(DCMTK_LFS_FLAGS "-n32")
+    if(NOT RESULT)
+      set(DCMTK_LFS_FLAGS "-n32")
       DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "-n32" "")
-    ENDIF()
-    IF(NOT RESULT)
-      SET(DCMTK_LFS_FLAGS "")
-      SET(DCMTK_LFS_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
+    endif()
+    if(NOT RESULT)
+      set(DCMTK_LFS_FLAGS "")
+      set(DCMTK_LFS_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
       DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "" "-D_FILE_OFFSET_BITS=64")
-    ENDIF()
-    IF(NOT RESULT)
-      SET(DCMTK_LFS_FLAGS "-n32")
-      SET(DCMTK_LFS_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
+    endif()
+    if(NOT RESULT)
+      set(DCMTK_LFS_FLAGS "-n32")
+      set(DCMTK_LFS_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
       DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "-n32" "-D_FILE_OFFSET_BITS=64")
-    ENDIF()
-    IF(NOT RESULT)
-      SET(DCMTK_LFS_FLAGS "")
-      SET(DCMTK_LFS_DEFINITIONS "-D_LARGE_FILES=1")
+    endif()
+    if(NOT RESULT)
+      set(DCMTK_LFS_FLAGS "")
+      set(DCMTK_LFS_DEFINITIONS "-D_LARGE_FILES=1")
       DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "" "-D_LARGE_FILES=1")
-    ENDIF()
-    IF(NOT RESULT)
-      SET(DCMTK_LFS_FLAGS "-n32")
-      SET(DCMTK_LFS_DEFINITIONS "-D_LARGE_FILES=1")
+    endif()
+    if(NOT RESULT)
+      set(DCMTK_LFS_FLAGS "-n32")
+      set(DCMTK_LFS_DEFINITIONS "-D_LARGE_FILES=1")
       DCMTK_LFS_TRY_COMPILE(RESULT "lfs.c" "-n32" "-D_LARGE_FILES=1")
-    ENDIF()
-    IF(NOT RESULT)
+    endif()
+    if(NOT RESULT)
       # remove flags and reset SIZEOF_OFF_T to indeterminate
-      SET(DCMTK_LFS_FLAGS)
-      SET(DCMTK_LFS_DEFINITIONS)
-      SET(SIZEOF_OFF_T)
+      set(DCMTK_LFS_FLAGS)
+      set(DCMTK_LFS_DEFINITIONS)
+      set(SIZEOF_OFF_T)
       # detect strange LFS implementation that (at least) Windows provides
       # strange since sizeof(fpos_t) == 8 but sizeof(off_t) == 4!
-      IF(SIZEOF_FPOS_T EQUAL 8)
-        SET(RESULT TRUE)
-      ENDIF()
-    ENDIF()
+      if(SIZEOF_FPOS_T EQUAL 8)
+        set(RESULT TRUE)
+      endif()
+    endif()
     # format a nice result message
-    IF(RESULT)
-      SET(DCMTK_ENABLE_LFS "lfs")
-      SET(DCMTK_LFS_FLAGS "${DCMTK_LFS_FLAGS}" CACHE INTERNAL "which compiler flags to set for enabling LFS support")
-      SET(DCMTK_LFS_DEFINITIONS "${DCMTK_LFS_DEFINITIONS}" CACHE INTERNAL "which compiler definitions to set for enabling LFS support")
-      SET(MESSAGE_RESULT "yes")
-      IF(NOT DCMTK_LFS_FLAGS STREQUAL "" OR NOT DCMTK_LFS_DEFINITIONS STREQUAL "")
-        SET(MESSAGE_RESULT "${MESSAGE_RESULT}, with")
-        IF(NOT DCMTK_LFS_FLAGS STREQUAL "")
-          SET(MESSAGE_RESULT "${MESSAGE_RESULT} ${DCMTK_LFS_FLAGS}")
-        ENDIF()
-        IF(NOT DCMTK_LFS_DEFINITIONS STREQUAL "")
-          SET(MESSAGE_RESULT "${MESSAGE_RESULT} ${DCMTK_LFS_DEFINITIONS}")
-        ENDIF()
-      ENDIF()
-    ENDIF()
-    SET(DCMTK_LFS_AVAILABLE "${RESULT}" CACHE INTERNAL "whether LFS is available or not" FORCE)
-    IF(DEFINED SIZEOF_OFF_T)
-      SET(SIZEOF_OFF_T "${SIZEOF_OFF_T}" CACHE INTERNAL "")
-    ENDIF()
-    MESSAGE(STATUS "${MESSAGE} -- ${MESSAGE_RESULT}")
-  ENDIF()
+    if(RESULT)
+      set(DCMTK_ENABLE_LFS "lfs")
+      set(DCMTK_LFS_FLAGS "${DCMTK_LFS_FLAGS}" CACHE INTERNAL "which compiler flags to set for enabling LFS support")
+      set(DCMTK_LFS_DEFINITIONS "${DCMTK_LFS_DEFINITIONS}" CACHE INTERNAL "which compiler definitions to set for enabling LFS support")
+      set(MESSAGE_RESULT "yes")
+      if(NOT DCMTK_LFS_FLAGS STREQUAL "" OR NOT DCMTK_LFS_DEFINITIONS STREQUAL "")
+        set(MESSAGE_RESULT "${MESSAGE_RESULT}, with")
+        if(NOT DCMTK_LFS_FLAGS STREQUAL "")
+          set(MESSAGE_RESULT "${MESSAGE_RESULT} ${DCMTK_LFS_FLAGS}")
+        endif()
+        if(NOT DCMTK_LFS_DEFINITIONS STREQUAL "")
+          set(MESSAGE_RESULT "${MESSAGE_RESULT} ${DCMTK_LFS_DEFINITIONS}")
+        endif()
+      endif()
+    endif()
+    set(DCMTK_LFS_AVAILABLE "${RESULT}" CACHE INTERNAL "whether LFS is available or not" FORCE)
+    if(DEFINED SIZEOF_OFF_T)
+      set(SIZEOF_OFF_T "${SIZEOF_OFF_T}" CACHE INTERNAL "")
+    endif()
+    message(STATUS "${MESSAGE} -- ${MESSAGE_RESULT}")
+  endif()
   # auto-select LFS implementation in case this is not the first run and the above tests did not select it
-  IF(DCMTK_ENABLE_LFS STREQUAL "auto")
-    IF(DCMTK_LFS64_AVAILABLE)
-      SET(DCMTK_ENABLE_LFS "lfs64")
-    ELSEIF(DCMTK_LFS_AVAILABLE)
-      SET(DCMTK_ENABLE_LFS "lfs")
-    ELSE()
-      SET(DCMTK_ENABLE_LFS "off")
-    ENDIF()
-  ELSEIF(NOT DCMTK_ENABLE_LFS MATCHES "^(lfs|lfs64|off)$")
+  if(DCMTK_ENABLE_LFS STREQUAL "auto")
+    if(DCMTK_LFS64_AVAILABLE)
+      set(DCMTK_ENABLE_LFS "lfs64")
+    elseif(DCMTK_LFS_AVAILABLE)
+      set(DCMTK_ENABLE_LFS "lfs")
+    else()
+      set(DCMTK_ENABLE_LFS "off")
+    endif()
+  elseif(NOT DCMTK_ENABLE_LFS MATCHES "^(lfs|lfs64|off)$")
     # print a warning in case the given argument was not understood
-    MESSAGE(WARNING "unknown argument \"${DCMTK_ENABLE_LFS}\" for DCMTK_ENABLE_LFS, setting it to \"off\"")
-    SET(DCMTK_ENABLE_LFS "off")
-  ELSEIF(DCMTK_ENABLE_LFS STREQUAL "lfs64" AND NOT DCMTK_LFS64_AVAILABLE)
+    message(WARNING "unknown argument \"${DCMTK_ENABLE_LFS}\" for DCMTK_ENABLE_LFS, setting it to \"off\"")
+    set(DCMTK_ENABLE_LFS "off")
+  elseif(DCMTK_ENABLE_LFS STREQUAL "lfs64" AND NOT DCMTK_LFS64_AVAILABLE)
     # test if the explicitly chosen implementation is really available
-    MESSAGE(WARNING "LFS64 was enabled but LFS64 support is not available, focing DCMTK_ENABLE_LFS to \"off\"")
-    SET(DCMTK_ENABLE_LFS "off")
-  ELSEIF(DCMTK_ENABLE_LFS STREQUAL "lfs" AND NOT DCMTK_LFS_AVAILABLE)
+    message(WARNING "LFS64 was enabled but LFS64 support is not available, focing DCMTK_ENABLE_LFS to \"off\"")
+    set(DCMTK_ENABLE_LFS "off")
+  elseif(DCMTK_ENABLE_LFS STREQUAL "lfs" AND NOT DCMTK_LFS_AVAILABLE)
     # test if the explicitly chosen implementation is really available
-    MESSAGE(WARNING "LFS was enabled but LFS support is not available, focing DCMTK_ENABLE_LFS to \"off\"")
-    SET(DCMTK_ENABLE_LFS "off")
-  ENDIF()
+    message(WARNING "LFS was enabled but LFS support is not available, focing DCMTK_ENABLE_LFS to \"off\"")
+    set(DCMTK_ENABLE_LFS "off")
+  endif()
   # create a list of available LFS types for the CMake GUI
-  SET(AVAILABLE_LFS_TYPES)
-  IF(NOT DEFINED DCMTK_LFS64_AVAILABLE OR DCMTK_LFS64_AVAILABLE)
-    LIST(APPEND AVAILABLE_LFS_TYPES "lfs64")
-  ENDIF()
-  IF(NOT DEFINED DCMTK_LFS_AVAILABLE OR DCMTK_LFS_AVAILABLE)
-    LIST(APPEND AVAILABLE_LFS_TYPES "lfs")
-  ENDIF()
+  set(AVAILABLE_LFS_TYPES)
+  if(NOT DEFINED DCMTK_LFS64_AVAILABLE OR DCMTK_LFS64_AVAILABLE)
+    list(APPEND AVAILABLE_LFS_TYPES "lfs64")
+  endif()
+  if(NOT DEFINED DCMTK_LFS_AVAILABLE OR DCMTK_LFS_AVAILABLE)
+    list(APPEND AVAILABLE_LFS_TYPES "lfs")
+  endif()
   # store the chosen value to the cache (potentially normalizing the given argument)
-  SET(DCMTK_ENABLE_LFS "${DCMTK_ENABLE_LFS}" CACHE STRING "whether to use lfs/lfs64 or not" FORCE)
-  SET_PROPERTY(CACHE DCMTK_ENABLE_LFS  PROPERTY STRINGS "auto" ${AVAILABLE_LFS_TYPES} "off")
+  set(DCMTK_ENABLE_LFS "${DCMTK_ENABLE_LFS}" CACHE STRING "whether to use lfs/lfs64 or not" FORCE)
+  set_property(CACHE DCMTK_ENABLE_LFS  PROPERTY STRINGS "auto" ${AVAILABLE_LFS_TYPES} "off")
   # set values for osconfig.h and add compiler flags and definitions (if necessary)
-  IF(DCMTK_ENABLE_LFS STREQUAL "lfs64")
+  if(DCMTK_ENABLE_LFS STREQUAL "lfs64")
     # set the value for generating osconfig.h
-    SET(DCMTK_LFS_MODE "DCMTK_LFS64" CACHE INTERNAL "" FORCE)
-    IF(NOT DCMTK_LFS64_DEFINITIONS STREQUAL "")
-      ADD_DEFINITIONS(${DCMTK_LFS64_DEFINITIONS})
-    ENDIF()
-    MESSAGE(STATUS "Info: Building DCMTK with explicit large file support (LFS64)")
-  ELSEIF(DCMTK_ENABLE_LFS STREQUAL "lfs")
+    set(DCMTK_LFS_MODE "DCMTK_LFS64" CACHE INTERNAL "" FORCE)
+    if(NOT DCMTK_LFS64_DEFINITIONS STREQUAL "")
+      add_definitions(${DCMTK_LFS64_DEFINITIONS})
+    endif()
+    message(STATUS "Info: Building DCMTK with explicit large file support (LFS64)")
+  elseif(DCMTK_ENABLE_LFS STREQUAL "lfs")
     # set the value for generating osconfig.h
-    SET(DCMTK_LFS_MODE "DCMTK_LFS" CACHE INTERNAL "" FORCE)
-    IF(NOT DCMTK_LFS_FLAGS STREQUAL "")
-      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DCMTK_LFS_FLAGS}")
-      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DCMTK_LFS_FLAGS}")
-    ENDIF()
-    IF(NOT DCMTK_LFS_DEFINITIONS STREQUAL "")
-      ADD_DEFINITIONS(${DCMTK_LFS_DEFINITIONS})
-    ENDIF()
-    MESSAGE(STATUS "Info: Building DCMTK with large file support (LFS)")
-  ELSE()
-    SET(DCMTK_ENABLE_LFS)
-    MESSAGE(STATUS "Info: Building DCMTK without large file support, files >4GB may be inaccesible!")
-  ENDIF()
-ENDFUNCTION(DCMTK_CHECK_ENABLE_LFS)
+    set(DCMTK_LFS_MODE "DCMTK_LFS" CACHE INTERNAL "" FORCE)
+    if(NOT DCMTK_LFS_FLAGS STREQUAL "")
+      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DCMTK_LFS_FLAGS}")
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DCMTK_LFS_FLAGS}")
+    endif()
+    if(NOT DCMTK_LFS_DEFINITIONS STREQUAL "")
+      add_definitions(${DCMTK_LFS_DEFINITIONS})
+    endif()
+    message(STATUS "Info: Building DCMTK with large file support (LFS)")
+  else()
+    set(DCMTK_ENABLE_LFS)
+    message(STATUS "Info: Building DCMTK without large file support, files >4GB may be inaccesible!")
+  endif()
+endfunction()
 
 DCMTK_CHECK_ENABLE_LFS()
 
-IF(WIN32)
+if(WIN32)
   # If someone can tell me how to convince TRY_COMPILE to link against winsock,
   # we could use tests for these. Until then, here is what would be the result:
-  SET(HAVE_INTP_ACCEPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument")
-  SET(HAVE_INTP_GETSOCKOPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument")
-  SET(HAVE_INTP_SELECT 0 CACHE INTERNAL "Set if select() accepts an int* argument")
-ELSE(WIN32)
+  set(HAVE_INTP_ACCEPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument")
+  set(HAVE_INTP_GETSOCKOPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument")
+  set(HAVE_INTP_SELECT 0 CACHE INTERNAL "Set if select() accepts an int* argument")
+else()
   # Check if socket functions accept an int*
   DCMTK_TRY_COMPILE(HAVE_INTP_SOCKET, "socket functions accept an int* argument"
       "
@@ -1106,13 +1135,13 @@ int main()
 
     return 0;
 }")
-  IF(HAVE_INTP_SOCKET)
-    SET(HAVE_INTP_ACCEPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument")
-    SET(HAVE_INTP_GETSOCKOPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument")
-  ELSE(HAVE_INTP_SOCKET)
-    SET(HAVE_INTP_ACCEPT 0 CACHE INTERNAL "Set if socket functions accept an int* argument")
-    SET(HAVE_INTP_GETSOCKOPT 0 CACHE INTERNAL "Set if socket functions accept an int* argument")
-  ENDIF(HAVE_INTP_SOCKET)
+  if(HAVE_INTP_SOCKET)
+    set(HAVE_INTP_ACCEPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument")
+    set(HAVE_INTP_GETSOCKOPT 1 CACHE INTERNAL "Set if socket functions accept an int* argument")
+  else()
+    set(HAVE_INTP_ACCEPT 0 CACHE INTERNAL "Set if socket functions accept an int* argument")
+    set(HAVE_INTP_GETSOCKOPT 0 CACHE INTERNAL "Set if socket functions accept an int* argument")
+  endif()
 
   # Check if select() accepts an int*
   DCMTK_TRY_COMPILE(HAVE_INTP_SELECT "select() accepts an int* argument"
@@ -1140,7 +1169,7 @@ int main()
     return 0;
 }
 ")
-ENDIF(WIN32)
+endif()
 
 # Check for alignment query / specifier support
 DCMTK_TRY_COMPILE(HAVE_GNU_ALIGNOF "__alignof__ is supported"
@@ -1225,19 +1254,110 @@ int main()
     return 0;
 }")
 
+DCMTK_TRY_COMPILE(HAVE_STATIC_ASSERT "the compiler supports static_assert"
+    "#include <cassert>
+int main()
+{
+    static_assert(true, \"good\");
+    return 0;
+}")
+
+function(ANALYZE_ICONV_FLAGS)
+    if(DCMTK_WITH_ICONV OR DCMTK_WITH_STDLIBC_ICONV)
+        set(TEXT "Detecting fixed iconv conversion flags")
+        message(STATUS "${TEXT}")
+        set(EXTRA_ARGS)
+        if(NOT DCMTK_WITH_STDLIBC_ICONV)
+            list(APPEND EXTRA_ARGS
+                CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${LIBICONV_INCDIR}"
+                LINK_LIBRARIES ${LIBICONV_LIBS}
+            )
+        endif()
+        if(LIBICONV_SECOND_ARGUMENT_CONST)
+            list(APPEND EXTRA_ARGS
+                COMPILE_DEFINITIONS "-DLIBICONV_SECOND_ARGUMENT_CONST=${LIBICONV_SECOND_ARGUMENT_CONST}"
+            )
+        endif()
+        DCMTK_TRY_RUN(RUN_RESULT COMPILE_RESULT
+            "${CMAKE_BINARY_DIR}/CMakeTmp/Iconv"
+            "${DCMTK_SOURCE_DIR}/config/tests/iconv.cc"
+            ${EXTRA_ARGS}
+            COMPILE_OUTPUT_VARIABLE CERR
+            RUN_OUTPUT_VARIABLE OUTPUT
+        )
+        if(COMPILE_RESULT)
+            set(DCMTK_ICONV_FLAGS_ANALYZED TRUE CACHE INTERNAL "")
+            if(RUN_RESULT EQUAL 0)
+                message(STATUS "${TEXT} - ${OUTPUT}")
+                set(DCMTK_FIXED_ICONV_CONVERSION_FLAGS "${OUTPUT}" CACHE INTERNAL "")
+            else()
+                message(STATUS "${TEXT} - unknown")
+            endif()
+        else()
+            message(FATAL_ERROR "${CERR}")
+        endif()
+    endif()
+endfunction()
+
+if(NOT DCMTK_ICONV_FLAGS_ANALYZED)
+    analyze_iconv_flags()
+endif()
+
+function(ANALYZE_STDLIBC_ICONV_DEFAULT_ENCODING)
+    if(DCMTK_WITH_STDLIBC_ICONV)
+        set(TEXT "Checking whether iconv_open() accepts \"\" as an argument")
+        message(STATUS "${TEXT}")
+        set(EXTRA_ARGS)
+        DCMTK_TRY_RUN(RUN_RESULT COMPILE_RESULT
+            "${CMAKE_BINARY_DIR}/CMakeTmp/lciconv"
+            "${DCMTK_SOURCE_DIR}/config/tests/lciconv.cc"
+            COMPILE_OUTPUT_VARIABLE CERR
+        )
+        if(COMPILE_RESULT)
+            if(RUN_RESULT EQUAL 0)
+                message(STATUS "${TEXT} - yes")
+                set(DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING 1 CACHE INTERNAL "")
+            else()
+                message(STATUS "${TEXT} - no")
+                set(DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING CACHE INTERNAL "")
+            endif()
+        else()
+            message(FATAL_ERROR "${CERR}")
+        endif()
+    endif()
+endfunction()
+
+if(NOT DEFINED DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING)
+    analyze_stdlibc_iconv_default_encoding()
+endif()
+
+if(HAVE_PASSWD_GECOS AND NOT DEFINED PASSWD_GECOS_IS_DEFINE_TO_PASSWD)
+    DCMTK_TRY_COMPILE(PASSWD_GECOS_IS_DEFINE_TO_PASSWD "pw_gecos is #defined to pw_passwd"
+        "#include <pwd.h>
+int main()
+{
+    struct S { int pw_passwd; };
+    &S::pw_gecos;
+    return 0;
+}")
+    if(PASSWD_GECOS_IS_DEFINE_TO_PASSWD)
+        set(HAVE_PASSWD_GECOS 0 CACHE INTERNAL "Have symbol &passwd::pw_gecos")
+    endif()
+endif()
+
 # Compile config/tests/arith.cc and generate config/arith.h
-FUNCTION(INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES)
-  SET(ARITH_H_FILE "${DCMTK_BINARY_DIR}/config/include/dcmtk/config/arith.h")
-  IF("${DCMTK_SOURCE_DIR}/config/tests/arith.cc" IS_NEWER_THAN "${ARITH_H_FILE}")
-    IF(CMAKE_CROSSCOMPILING)
-      IF(WIN32)
+function(INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES)
+  set(ARITH_H_FILE "${DCMTK_BINARY_DIR}/config/include/dcmtk/config/arith.h")
+  if("${DCMTK_SOURCE_DIR}/config/tests/arith.cc" IS_NEWER_THAN "${ARITH_H_FILE}")
+    if(CMAKE_CROSSCOMPILING)
+      if(WIN32)
         UNIX_TO_WINE_PATH(ARITH_H_FILE "${ARITH_H_FILE}")
-        STRING(REPLACE "\\" "\\\\" ARITH_H_FILE "${ARITH_H_FILE}")
-      ELSEIF(ANDROID)
-        SET(ARITH_H_DESTINATION "${ARITH_H_FILE}")
-        SET(ARITH_H_FILE "${ANDROID_TEMPORARY_FILES_LOCATION}/arith.h")
-      ENDIF()
-    ENDIF(CMAKE_CROSSCOMPILING)
+        string(REPLACE "\\" "\\\\" ARITH_H_FILE "${ARITH_H_FILE}")
+      elseif(ANDROID)
+        set(ARITH_H_DESTINATION "${ARITH_H_FILE}")
+        set(ARITH_H_FILE "${ANDROID_TEMPORARY_FILES_LOCATION}/arith.h")
+      endif()
+    endif()
     DCMTK_TRY_RUN(
       RESULT COMPILED
       "${DCMTK_BINARY_DIR}/CMakeTmp/Arith"
@@ -1247,98 +1367,98 @@ FUNCTION(INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES)
       COMPILE_OUTPUT_VARIABLE CERR
       ARGS "\\\"${ARITH_H_FILE}\\\""
     )
-    IF(COMPILED)
-      IF(NOT RESULT)
-        MESSAGE(STATUS "${OUTPUT}")
-        IF(CMAKE_CROSSCOMPILING)
-          IF(ANDROID)
+    if(COMPILED)
+      if(NOT RESULT)
+        message(STATUS "${OUTPUT}")
+        if(CMAKE_CROSSCOMPILING)
+          if(ANDROID)
             DCMTK_ANDROID_PULL(DCMTK_ANDROID_EMULATOR_INSTANCE "${ARITH_H_FILE}" DESTINATION "${ARITH_H_DESTINATION}")
-          ENDIF()
-        ENDIF(CMAKE_CROSSCOMPILING)
-      ELSE(NOT RESULT)
-        MESSAGE(FATAL_ERROR "${OUTPUT}")
-      ENDIF(NOT RESULT)
-    ELSE(COMPILED)
-      MESSAGE(FATAL_ERROR "${CERR}")
-    ENDIF(COMPILED)
-  ENDIF() # file needs update
-ENDFUNCTION(INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES)
-
-FUNCTION(DCMTK_ADD_CXX11_FLAGS)
-  STRING(FIND "${CMAKE_CXX_FLAGS}" "${DCMTK_CXX11_FLAGS}" INDEX)
-  IF(INDEX EQUAL -1)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DCMTK_CXX11_FLAGS}" PARENT_SCOPE)
-  ENDIF()
-ENDFUNCTION(DCMTK_ADD_CXX11_FLAGS)
-
-FUNCTION(DCMTK_TEST_ENABLE_CXX11)
-  SET(RESULT 0)
-  SET(TEXT_RESULT "disabled")
-  IF(DCMTK_ENABLE_CXX11)
-    IF(DEFINED HAVE_CXX11_TEST_RESULT)
-      IF(HAVE_CXX11_TEST_RESULT)
+          endif()
+        endif()
+      else()
+        message(FATAL_ERROR "${OUTPUT}")
+      endif()
+    else()
+      message(FATAL_ERROR "${CERR}")
+    endif()
+  endif() # file needs update
+endfunction()
+
+function(DCMTK_ADD_CXX11_FLAGS)
+  string(FIND "${CMAKE_CXX_FLAGS}" "${DCMTK_CXX11_FLAGS}" INDEX)
+  if(INDEX EQUAL -1)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DCMTK_CXX11_FLAGS}" PARENT_SCOPE)
+  endif()
+endfunction()
+
+function(DCMTK_TEST_ENABLE_CXX11)
+  set(RESULT 0)
+  set(TEXT_RESULT "disabled")
+  if(DCMTK_ENABLE_CXX11)
+    if(DEFINED HAVE_CXX11_TEST_RESULT)
+      if(HAVE_CXX11_TEST_RESULT)
         DCMTK_ADD_CXX11_FLAGS()
-        SET(RESULT 1)
-        SET(TEXT_RESULT "enabled")
-      ENDIF()
-    ELSE()
+        set(RESULT 1)
+        set(TEXT_RESULT "enabled")
+      endif()
+    else()
       DCMTK_ADD_CXX11_FLAGS() # will automatically be removed by the function scope
-      SET(MESSAGE "Checking whether the compiler supports C++11")
-      MESSAGE(STATUS "${MESSAGE}")
-      TRY_COMPILE(COMPILE_RESULT "${CMAKE_BINARY_DIR}" "${DCMTK_SOURCE_DIR}/config/tests/cxx11.cc")
-      SET(HAVE_CXX11_TEST_RESULT "${COMPILE_RESULT}" CACHE INTERNAL "Caches the configuration test result for C++11 support.")
-      IF(COMPILE_RESULT)
-        SET(RESULT 1)
-        SET(TEXT_RESULT "enabled")
-        MESSAGE(STATUS "${MESSAGE} -- yes")
-      ELSE()
-        MESSAGE(STATUS "${MESSAGE} -- no")
-      ENDIF()
-    ENDIF()
-  ENDIF()
-  SET(HAVE_CXX11 "${RESULT}" CACHE INTERNAL "Set to 1 if the compiler supports C++11 and it should be enabled.")
-  MESSAGE(STATUS "Info: C++11 features ${TEXT_RESULT}")
-  IF(RESULT)
+      set(MESSAGE "Checking whether the compiler supports C++11")
+      message(STATUS "${MESSAGE}")
+      try_compile(COMPILE_RESULT "${CMAKE_BINARY_DIR}" "${DCMTK_SOURCE_DIR}/config/tests/cxx11.cc")
+      set(HAVE_CXX11_TEST_RESULT "${COMPILE_RESULT}" CACHE INTERNAL "Caches the configuration test result for C++11 support.")
+      if(COMPILE_RESULT)
+        set(RESULT 1)
+        set(TEXT_RESULT "enabled")
+        message(STATUS "${MESSAGE} -- yes")
+      else()
+        message(STATUS "${MESSAGE} -- no")
+      endif()
+    endif()
+  endif()
+  set(HAVE_CXX11 "${RESULT}" CACHE INTERNAL "Set to 1 if the compiler supports C++11 and it should be enabled.")
+  message(STATUS "Info: C++11 features ${TEXT_RESULT}")
+  if(RESULT)
     # push C++11 CXX-flags to the parent scope
-    SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE)
-  ENDIF()
-ENDFUNCTION(DCMTK_TEST_ENABLE_CXX11)
-
-FUNCTION(DCMTK_TEST_ENABLE_STL_FEATURE NAME)
-  STRING(TOUPPER "${NAME}" FEATURE)
-  IF(ARGN)
-    SET(SOURCEFILE "${ARGN}")
-  ELSE()
-    SET(SOURCEFILE "${NAME}")
-  ENDIF()
-  IF(DCMTK_ENABLE_STL_${FEATURE} STREQUAL "INFERRED")
-    SET(DCMTK_ENABLE_STL_${FEATURE} ${DCMTK_ENABLE_STL})
-  ENDIF()
-  SET(RESULT 0)
-  SET(TEXT_RESULT "disabled")
-  IF(DCMTK_ENABLE_STL_${FEATURE} STREQUAL "ON")
-    IF(DEFINED HAVE_STL_${FEATURE}_TEST_RESULT)
-      IF(HAVE_STL_${FEATURE}_TEST_RESULT)
-        SET(RESULT 1)
-        SET(TEXT_RESULT "enabled")
-      ENDIF()
-    ELSE()
-      SET(MESSAGE "Checking whether STL ${NAME} works correctly")
-      MESSAGE(STATUS "${MESSAGE}")
+    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE)
+  endif()
+endfunction()
+
+function(DCMTK_TEST_ENABLE_STL_FEATURE NAME)
+  string(TOUPPER "${NAME}" FEATURE)
+  if(ARGN)
+    set(SOURCEFILE "${ARGN}")
+  else()
+    set(SOURCEFILE "${NAME}")
+  endif()
+  if(DCMTK_ENABLE_STL_${FEATURE} STREQUAL "INFERRED")
+    set(DCMTK_ENABLE_STL_${FEATURE} ${DCMTK_ENABLE_STL})
+  endif()
+  set(RESULT 0)
+  set(TEXT_RESULT "disabled")
+  if(DCMTK_ENABLE_STL_${FEATURE} STREQUAL "ON")
+    if(DEFINED HAVE_STL_${FEATURE}_TEST_RESULT)
+      if(HAVE_STL_${FEATURE}_TEST_RESULT)
+        set(RESULT 1)
+        set(TEXT_RESULT "enabled")
+      endif()
+    else()
+      set(MESSAGE "Checking whether STL ${NAME} works correctly")
+      message(STATUS "${MESSAGE}")
       DCMTK_TRY_RUN(RUN_RESULT COMPILE_RESULT "${CMAKE_BINARY_DIR}" "${DCMTK_SOURCE_DIR}/config/tests/${SOURCEFILE}.cc")
-      IF(COMPILE_RESULT AND RUN_RESULT EQUAL 0)
-        SET(RESULT 1)
-        SET(TEXT_RESULT "enabled")
-        MESSAGE(STATUS "${MESSAGE} -- yes")
-      ELSE()
-        MESSAGE(STATUS "${MESSAGE} -- no")
-      ENDIF()
-      SET(HAVE_STL_${FEATURE}_TEST_RESULT ${RESULT} CACHE INTERNAL "Caches the configuration test result for STL ${NAME}")
-    ENDIF()
-  ENDIF()
-  SET(HAVE_STL_${FEATURE} ${RESULT} CACHE INTERNAL "Set to 1 if the compiler/OS provides a working STL ${NAME} implementation.")
-  MESSAGE(STATUS "Info: STL ${NAME} support ${TEXT_RESULT}")
-ENDFUNCTION(DCMTK_TEST_ENABLE_STL_FEATURE)
+      if(COMPILE_RESULT AND RUN_RESULT EQUAL 0)
+        set(RESULT 1)
+        set(TEXT_RESULT "enabled")
+        message(STATUS "${MESSAGE} -- yes")
+      else()
+        message(STATUS "${MESSAGE} -- no")
+      endif()
+      set(HAVE_STL_${FEATURE}_TEST_RESULT ${RESULT} CACHE INTERNAL "Caches the configuration test result for STL ${NAME}")
+    endif()
+  endif()
+  set(HAVE_STL_${FEATURE} ${RESULT} CACHE INTERNAL "Set to 1 if the compiler/OS provides a working STL ${NAME} implementation.")
+  message(STATUS "Info: STL ${NAME} support ${TEXT_RESULT}")
+endfunction()
 
 DCMTK_TEST_ENABLE_CXX11()
 DCMTK_TEST_ENABLE_STL_FEATURE("vector")
@@ -1353,6 +1473,6 @@ DCMTK_TEST_ENABLE_STL_FEATURE("type_traits" "ttraits")
 DCMTK_TEST_ENABLE_STL_FEATURE("tuple")
 DCMTK_TEST_ENABLE_STL_FEATURE("system_error" "syserr")
 
-IF(CMAKE_CROSSCOMPILING)
-  SET(DCMTK_CROSS_COMPILING ${CMAKE_CROSSCOMPILING})
-ENDIF(CMAKE_CROSSCOMPILING)
+if(CMAKE_CROSSCOMPILING)
+  set(DCMTK_CROSS_COMPILING ${CMAKE_CROSSCOMPILING})
+endif()
index feeb096bc49b950cd42e78b755beba011ddbd64a..480ce4f5639eb72d42a926d1fa2f6ee17105510e 100644 (file)
@@ -1,27 +1,27 @@
 # Finish the setup. This should be run after all modules.
 
-IF(BUILD_SINGLE_SHARED_LIBRARY)
+if(BUILD_SINGLE_SHARED_LIBRARY)
   # Collect the object files of all libraries in all modules.
   # The variable ${DCMTK_ALL_LIBRARIES} is set by DCMTK_ADD_LIBRARY().
-  SET(LIBS)
-  FOREACH(LIB ${DCMTK_ALL_LIBRARIES})
-    SET(LIBS ${LIBS} $<TARGET_OBJECTS:${LIB}>)
-  ENDFOREACH(LIB)
+  set(LIBS)
+  foreach(LIB ${DCMTK_ALL_LIBRARIES})
+    set(LIBS ${LIBS} $<TARGET_OBJECTS:${LIB}>)
+  endforeach()
 
   # Build a single "everything-library".
   # The library dependencies are collected by DCMTK_TARGET_LINK_LIBRARIES().
-  ADD_LIBRARY(dcmtk SHARED ${LIBS})
-  TARGET_LINK_LIBRARIES(dcmtk ${DCMTK_LIBRARY_DEPENDENCIES})
-  SET_TARGET_PROPERTIES(dcmtk PROPERTIES ${DCMTK_LIBRARY_PROPERTIES})
+  add_library(dcmtk SHARED ${LIBS})
+  target_link_libraries(dcmtk ${DCMTK_LIBRARY_DEPENDENCIES})
+  set_target_properties(dcmtk PROPERTIES ${DCMTK_LIBRARY_PROPERTIES})
 
   # Export target for build tree
-  SET_PROPERTY(GLOBAL APPEND PROPERTY DCMTK_LIBRARY_TARGETS dcmtk)
+  set_property(GLOBAL APPEND PROPERTY DCMTK_LIBRARY_TARGETS dcmtk)
 
   # Declare installation files. Also export libs and executables to DCMTKTargets.cmake.
-  INSTALL(TARGETS dcmtk
+  install(TARGETS dcmtk
           EXPORT DCMTKTargets
           COMPONENT lib
           RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
           LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
           ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-ENDIF(BUILD_SINGLE_SHARED_LIBRARY)
+endif()
index 543a8e3eb4d58f325481359e6137aeac8c3d629b..db0cd51b25d09817ccf7203612946ccbb6055b9b 100644 (file)
@@ -4,45 +4,45 @@
 # DCMTK_ADD_TESTS - function which registers all tests for a module
 # MODULE - name of the module that we are called for
 #
-FUNCTION(DCMTK_ADD_TESTS MODULE)
-    IF(BUILD_APPS AND DCMTK_RUN_CTEST_SCRIPT)
-        SET(TEST_EXECUTABLE "$<TARGET_FILE:${MODULE}_tests>")
-        IF(CMAKE_CROSSCOMPILING)
-            IF(WIN32)
+function(DCMTK_ADD_TESTS MODULE)
+    if(BUILD_APPS AND DCMTK_RUN_CTEST_SCRIPT)
+        set(TEST_EXECUTABLE "$<TARGET_FILE:${MODULE}_tests>")
+        if(CMAKE_CROSSCOMPILING)
+            if(WIN32)
                 WINE_COMMAND(TEST_COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MODULE}_tests${CMAKE_EXECUTABLE_SUFFIX}")
-                STRING(REPLACE "\\" "\\\\" TEST_COMMAND "${TEST_COMMAND}")
-            ELSEIF(ANDROID)
-                SET(TEST_COMMAND "${ANDROID_TEMPORARY_FILES_LOCATION}/${MODULE}_tests")
-            ELSE()
+                string(REPLACE "\\" "\\\\" TEST_COMMAND "${TEST_COMMAND}")
+            elseif(ANDROID)
+                set(TEST_COMMAND "${ANDROID_TEMPORARY_FILES_LOCATION}/${MODULE}_tests")
+            else()
                 # not reachable, handled by not defining DCMTK_RUN_CTEST_SCRIPT
-            ENDIF()
-        ELSE()
-            SET(TEST_COMMAND "${TEST_EXECUTABLE}")
-        ENDIF()
-        LIST(APPEND DCMTK_TEST_EXECUTABLES "${TEST_EXECUTABLE}")
-        LIST(REMOVE_DUPLICATES DCMTK_TEST_EXECUTABLES)
-        SET(DCMTK_TEST_EXECUTABLES ${DCMTK_TEST_EXECUTABLES} CACHE INTERNAL "List of executables needed to run the unit tests")
-        FILE(STRINGS tests.cc AVAIL_TESTS REGEX "OFTEST_REGISTER\\([^)]*\\)")
-        FOREACH(TEST_LINE ${AVAIL_TESTS})
+            endif()
+        else()
+            set(TEST_COMMAND "${TEST_EXECUTABLE}")
+        endif()
+        list(APPEND DCMTK_TEST_EXECUTABLES "${TEST_EXECUTABLE}")
+        list(REMOVE_DUPLICATES DCMTK_TEST_EXECUTABLES)
+        set(DCMTK_TEST_EXECUTABLES ${DCMTK_TEST_EXECUTABLES} CACHE INTERNAL "List of executables needed to run the unit tests")
+        file(STRINGS tests.cc AVAIL_TESTS REGEX "OFTEST_REGISTER\\([^)]*\\)")
+        foreach(TEST_LINE ${AVAIL_TESTS})
             # TODO: How can we parse tests.cc in a saner way?
-            STRING(REGEX MATCH "OFTEST_REGISTER\\([^)]*" TEST "${TEST_LINE}")
-            STRING(REPLACE "OFTEST_REGISTER(" "" TEST ${TEST})
+            string(REGEX MATCH "OFTEST_REGISTER\\([^)]*" TEST "${TEST_LINE}")
+            string(REPLACE "OFTEST_REGISTER(" "" TEST ${TEST})
             # This assumes that test names are globally unique
-            ADD_TEST(NAME "${TEST}" COMMAND "${CMAKE_COMMAND}" "-DDCMTK_CTEST_TESTCASE_COMMAND=${TEST_COMMAND}" "-DDCMTK_CTEST_TEST_NAME=${TEST}" "-P" "${DCMTK_RUN_CTEST_SCRIPT}")
-            SET_PROPERTY(TEST "${TEST}" PROPERTY LABELS "${MODULE}")
-            IF(CMAKE_VERSION VERSION_LESS 3.0.0)
+            add_test(NAME "${TEST}" COMMAND "${CMAKE_COMMAND}" "-DDCMTK_CTEST_TESTCASE_COMMAND=${TEST_COMMAND}" "-DDCMTK_CTEST_TEST_NAME=${TEST}" "-P" "${DCMTK_RUN_CTEST_SCRIPT}")
+            set_property(TEST "${TEST}" PROPERTY LABELS "${MODULE}")
+            if(CMAKE_VERSION VERSION_LESS 3.0.0)
                 # CMake versions prior 3 seemingly don't understand $<TARGET_FILE:tgt> within a test's REQUIRED_FILES property
-                SET_PROPERTY(TEST "${TEST}" PROPERTY REQUIRED_FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MODULE}_tests${CMAKE_EXECUTABLE_SUFFIX}")
-            ELSE()
-                SET_PROPERTY(TEST "${TEST}" PROPERTY REQUIRED_FILES "${TEST_EXECUTABLE}")
-            ENDIF()
-        ENDFOREACH(TEST_LINE)
-        ADD_CUSTOM_TARGET("${MODULE}-test-exhaustive"
+                set_property(TEST "${TEST}" PROPERTY REQUIRED_FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MODULE}_tests${CMAKE_EXECUTABLE_SUFFIX}")
+            else()
+                set_property(TEST "${TEST}" PROPERTY REQUIRED_FILES "${TEST_EXECUTABLE}")
+            endif()
+        endforeach()
+        add_custom_target("${MODULE}-test-exhaustive"
             COMMAND "${CMAKE_COMMAND}" "-DCONFIG=${DCMTK_CONFIG_GENERATOR_EXPRESSION}" "-P" "${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRunExhaustive.cmake"
             WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
         )
-    ENDIF(BUILD_APPS AND DCMTK_RUN_CTEST_SCRIPT)
-ENDFUNCTION(DCMTK_ADD_TESTS)
+    endif()
+endfunction()
 
 #
 # Setup an executable
@@ -50,25 +50,25 @@ ENDFUNCTION(DCMTK_ADD_TESTS)
 # DCMTK_ADD_EXECUTABLE - macro which adds the needed setup for an executable
 # PROGRAM - name of the executable that we are called for
 #
-MACRO(DCMTK_ADD_EXECUTABLE PROGRAM)
-    IF(BUILD_APPS)
-        ADD_EXECUTABLE(${PROGRAM} ${ARGN})
+macro(DCMTK_ADD_EXECUTABLE PROGRAM)
+    if(BUILD_APPS)
+        add_executable(${PROGRAM} ${ARGN})
 
         # Make wildcard arguments work
-        IF(WIN32 AND NOT MINGW)
-            SET_TARGET_PROPERTIES(${PROGRAM} PROPERTIES LINK_FLAGS ${WIN32_STD_OBJECTS})
-        ENDIF(WIN32 AND NOT MINGW)
+        if(WIN32 AND NOT MINGW)
+            set_target_properties(${PROGRAM} PROPERTIES LINK_FLAGS ${WIN32_STD_OBJECTS})
+        endif()
 
         # Collect executable as part of global DCMTK_EXECUTABLE_TARGETS property
-        SET_PROPERTY(GLOBAL APPEND PROPERTY DCMTK_EXECUTABLE_TARGETS ${PROGRAM})
+        set_property(GLOBAL APPEND PROPERTY DCMTK_EXECUTABLE_TARGETS ${PROGRAM})
 
         # declare installation files, also export DCMTKTargets.cmake
-        INSTALL(TARGETS ${PROGRAM}
+        install(TARGETS ${PROGRAM}
                 EXPORT DCMTKTargets
                 COMPONENT bin
                 DESTINATION ${CMAKE_INSTALL_BINDIR})
-    ENDIF(BUILD_APPS)
-ENDMACRO(DCMTK_ADD_EXECUTABLE)
+    endif()
+endmacro()
 
 #
 # Setup a library
@@ -77,31 +77,31 @@ ENDMACRO(DCMTK_ADD_EXECUTABLE)
 # LIBRARY - name of the library that we are called for
 # extra arguments - names of the library's source files
 #
-MACRO(DCMTK_ADD_LIBRARY LIBRARY)
+macro(DCMTK_ADD_LIBRARY LIBRARY)
     # Actually add the library first
-    ADD_LIBRARY(${LIBRARY}${DCMTK_LIBRARY_SUFFIX} ${DCMTK_LIBRARY_TYPE} ${ARGN})
-    SET(DCMTK_ALL_LIBRARIES ${DCMTK_ALL_LIBRARIES} ${LIBRARY}${DCMTK_LIBRARY_SUFFIX} CACHE INTERNAL "List of all libraries in the DCMTK.")
+    add_library(${LIBRARY}${DCMTK_LIBRARY_SUFFIX} ${DCMTK_LIBRARY_TYPE} ${ARGN})
+    set(DCMTK_ALL_LIBRARIES ${DCMTK_ALL_LIBRARIES} ${LIBRARY}${DCMTK_LIBRARY_SUFFIX} CACHE INTERNAL "List of all libraries in the DCMTK.")
 
     # set proper version information for shared library
-    IF(BUILD_SHARED_LIBS AND NOT BUILD_SINGLE_SHARED_LIBRARY)
-        SET_TARGET_PROPERTIES(${LIBRARY}${DCMTK_LIBRARY_SUFFIX} PROPERTIES ${DCMTK_LIBRARY_PROPERTIES})
-    ELSE(BUILD_SHARED_LIBS AND NOT BUILD_SINGLE_SHARED_LIBRARY)
+    if(BUILD_SHARED_LIBS AND NOT BUILD_SINGLE_SHARED_LIBRARY)
+        set_target_properties(${LIBRARY}${DCMTK_LIBRARY_SUFFIX} PROPERTIES ${DCMTK_LIBRARY_PROPERTIES})
+    else()
         # define the foo_EXPORTS-macro even when we are not building ("normal") shared libs
-        SET_TARGET_PROPERTIES(${LIBRARY}${DCMTK_LIBRARY_SUFFIX} PROPERTIES COMPILE_DEFINITIONS "${LIBRARY}_EXPORTS")
-    ENDIF(BUILD_SHARED_LIBS AND NOT BUILD_SINGLE_SHARED_LIBRARY)
+        set_target_properties(${LIBRARY}${DCMTK_LIBRARY_SUFFIX} PROPERTIES COMPILE_DEFINITIONS "${LIBRARY}_EXPORTS")
+    endif()
 
-    IF(NOT BUILD_SINGLE_SHARED_LIBRARY)
+    if(NOT BUILD_SINGLE_SHARED_LIBRARY)
         # Remember export target for writing it to build tree later
-        SET_PROPERTY(GLOBAL APPEND PROPERTY DCMTK_LIBRARY_TARGETS ${LIBRARY}${DCMTK_LIBRARY_SUFFIX})
+        set_property(GLOBAL APPEND PROPERTY DCMTK_LIBRARY_TARGETS ${LIBRARY}${DCMTK_LIBRARY_SUFFIX})
 
         # Declare installation files
-        INSTALL(TARGETS ${LIBRARY}${DCMTK_LIBRARY_SUFFIX}
+        install(TARGETS ${LIBRARY}${DCMTK_LIBRARY_SUFFIX}
           EXPORT DCMTKTargets
           RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
           LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
           ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib)
-    ENDIF(NOT BUILD_SINGLE_SHARED_LIBRARY)
-ENDMACRO(DCMTK_ADD_LIBRARY)
+    endif()
+endmacro()
 
 #
 # Specify a library's dependencies
@@ -110,11 +110,11 @@ ENDMACRO(DCMTK_ADD_LIBRARY)
 # LIBRARY - name of the library that we are called for
 # extra arguments - names of the library's dependencies
 #
-MACRO(DCMTK_TARGET_LINK_LIBRARIES LIBRARY)
-    SET(DCMTK_LIBRARY_DEPENDENCIES ${DCMTK_LIBRARY_DEPENDENCIES} ${ARGN} CACHE INTERNAL "Dependencies of the DCMTK libraries.")
+macro(DCMTK_TARGET_LINK_LIBRARIES LIBRARY)
+    set(DCMTK_LIBRARY_DEPENDENCIES ${DCMTK_LIBRARY_DEPENDENCIES} ${ARGN} CACHE INTERNAL "Dependencies of the DCMTK libraries.")
     # The name of this macro doesn't match, but it does just what we need here
     DCMTK_TARGET_LINK_MODULES(${LIBRARY} ${ARGN})
-ENDMACRO(DCMTK_TARGET_LINK_LIBRARIES)
+endmacro()
 
 #
 # Link a target against other DCMTK modules
@@ -123,52 +123,52 @@ ENDMACRO(DCMTK_TARGET_LINK_LIBRARIES)
 # TARGET - name of the target that we are called for
 # extra arguments - names of the modules that should be added
 #
-MACRO(DCMTK_TARGET_LINK_MODULES TARGET)
+macro(DCMTK_TARGET_LINK_MODULES TARGET)
     # This macro is called for libraries and apps. Thus, we need some magic.
-    # 1. During "normal builds", always call TARGET_LINK_LIBRARIES()
+    # 1. During "normal builds", always call target_link_libraries()
     # 2. When BUILD_SINGLE_SHARED_LIBRARY, never call it, because neither the
     #    libraries nor the apps really exist in this mode
     # 3. When "just" BUILD_APPS is disabled, only call it for libs, not for apps
     # These rules boil down to: If CMake knows the target (this handles all
     # cases for apps) and we aren't building a single library (case 2)
-    IF(TARGET ${TARGET} AND NOT BUILD_SINGLE_SHARED_LIBRARY)
-        TARGET_LINK_LIBRARIES(${TARGET} ${ARGN})
-    ENDIF(TARGET ${TARGET} AND NOT BUILD_SINGLE_SHARED_LIBRARY)
-ENDMACRO(DCMTK_TARGET_LINK_MODULES TARGET)
+    if(TARGET ${TARGET} AND NOT BUILD_SINGLE_SHARED_LIBRARY)
+        target_link_libraries(${TARGET} ${ARGN})
+    endif()
+endmacro()
 
 # This is an ugly hack to simulate global variables
-SET(DCMTK_ALL_LIBRARIES CACHE INTERNAL "List of all libraries in the DCMTK.")
-SET(DCMTK_LIBRARY_DEPENDENCIES CACHE INTERNAL "Dependencies of the DCMTK libraries.")
+set(DCMTK_ALL_LIBRARIES CACHE INTERNAL "List of all libraries in the DCMTK.")
+set(DCMTK_LIBRARY_DEPENDENCIES CACHE INTERNAL "Dependencies of the DCMTK libraries.")
 
 # Failsafe implementation of UNSET for old CMake versions
-IF(CMAKE_VERSION VERSION_LESS 2.6.3)
-  MACRO(DCMTK_UNSET VAR)
-    SET(${VAR})
-  ENDMACRO(DCMTK_UNSET)
-ELSE(CMAKE_VERSION VERSION_LESS 2.6.3)
-  MACRO(DCMTK_UNSET VAR)
-    UNSET(${VAR})
-  ENDMACRO(DCMTK_UNSET)
-ENDIF(CMAKE_VERSION VERSION_LESS 2.6.3)
+if(CMAKE_VERSION VERSION_LESS 2.6.3)
+  macro(DCMTK_UNSET VAR)
+    set(${VAR})
+  endmacro()
+else()
+  macro(DCMTK_UNSET VAR)
+    unset(${VAR})
+  endmacro()
+endif()
 
-# Failsafe implementation of UNSET(... CACHE) for old CMake versions
-IF(CMAKE_VERSION VERSION_LESS 2.6.3)
-  MACRO(DCMTK_UNSET_CACHE VAR)
-    SET(${VAR} CACHE INTERNAL "")
-  ENDMACRO(DCMTK_UNSET_CACHE)
-ELSE(CMAKE_VERSION VERSION_LESS 2.6.3)
-  MACRO(DCMTK_UNSET_CACHE VAR)
-    UNSET(${VAR} CACHE)
-  ENDMACRO(DCMTK_UNSET_CACHE)
-ENDIF(CMAKE_VERSION VERSION_LESS 2.6.3)
+# Failsafe implementation of unset(... CACHE) for old CMake versions
+if(CMAKE_VERSION VERSION_LESS 2.6.3)
+  macro(DCMTK_UNSET_CACHE VAR)
+    set(${VAR} CACHE INTERNAL "")
+  endmacro()
+else()
+  macro(DCMTK_UNSET_CACHE VAR)
+    unset(${VAR} CACHE)
+  endmacro()
+endif()
 
-# Failsafe implementation of UNSET(... PARENT_SCOPE) for old CMake versions
-IF(CMAKE_VERSION VERSION_LESS 3.0)
-  MACRO(DCMTK_UNSET_PARENT_SCOPE VAR)
-    SET(${VAR} PARENT_SCOPE)
-  ENDMACRO(DCMTK_UNSET_PARENT_SCOPE)
-ELSE(CMAKE_VERSION VERSION_LESS 3.0)
-  MACRO(DCMTK_UNSET_PARENT_SCOPE VAR)
-    UNSET(${VAR} PARENT_SCOPE)
-  ENDMACRO(DCMTK_UNSET_PARENT_SCOPE)
-ENDIF(CMAKE_VERSION VERSION_LESS 3.0)
+# Failsafe implementation of unset(... PARENT_SCOPE) for old CMake versions
+if(CMAKE_VERSION VERSION_LESS 3.0)
+  macro(DCMTK_UNSET_PARENT_SCOPE VAR)
+    set(${VAR} PARENT_SCOPE)
+  endmacro()
+else()
+  macro(DCMTK_UNSET_PARENT_SCOPE VAR)
+    unset(${VAR} PARENT_SCOPE)
+  endmacro()
+endif()
index 40f4b308888ddb2df7884583caf19b3ca09bc9d6..e9f77b54f952e86512237d498a7881dcf01d5fc7 100644 (file)
@@ -2,15 +2,15 @@
 # This should be run before the individual modules are created.
 
 # This file should only run once
-IF(DEFINED DCMTK_CONFIGURATION_DONE)
-  RETURN()
-ENDIF(DEFINED DCMTK_CONFIGURATION_DONE)
-SET(DCMTK_CONFIGURATION_DONE true)
+if(DEFINED DCMTK_CONFIGURATION_DONE)
+  return()
+endif()
+set(DCMTK_CONFIGURATION_DONE true)
 
 # Minimum CMake version required
-IF(CMAKE_BACKWARDS_COMPATIBILITY GREATER 3.10.2)
-  SET(CMAKE_BACKWARDS_COMPATIBILITY 3.10.2 CACHE STRING "Latest version of CMake when this project was released." FORCE)
-ENDIF(CMAKE_BACKWARDS_COMPATIBILITY GREATER 3.10.2)
+if(CMAKE_BACKWARDS_COMPATIBILITY GREATER 3.12.3)
+  set(CMAKE_BACKWARDS_COMPATIBILITY 3.12.3 CACHE STRING "Latest version of CMake when this project was released." FORCE)
+endif()
 
 # CMAKE_BUILD_TYPE is set to value "Release" if none is specified by the
 # selected build file generator. For those generators that support multiple
@@ -25,85 +25,85 @@ ENDIF(CMAKE_BACKWARDS_COMPATIBILITY GREATER 3.10.2)
 # on the command line.  This may be useful if the compiler flags should be
 # controlled manually (e.g. as defined in environment variables like CXXFLAGS)
 # and no CMake defaults related to the selected configuration type kick in.
-IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
-  MESSAGE(STATUS "Setting build type to 'Release' as none was specified.")
-  SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
+if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+  message(STATUS "Setting build type to 'Release' as none was specified.")
+  set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
   # Set the possible values of build type for cmake-gui
-  SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
-ENDIF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+endif()
 
 
 # Basic version information
 # (Starting with version 3.5.5, an odd number at the last position indicates
 #  a development snapshot and an even number indicates an official release.)
-SET(DCMTK_MAJOR_VERSION 3)
-SET(DCMTK_MINOR_VERSION 6)
-SET(DCMTK_BUILD_VERSION 3)
+set(DCMTK_MAJOR_VERSION 3)
+set(DCMTK_MINOR_VERSION 6)
+set(DCMTK_BUILD_VERSION 4)
 # The ABI is not guaranteed to be stable between different snapshots/releases,
 # so this particular version number is increased for each snapshot or release.
-SET(DCMTK_ABI_VERSION 13)
+set(DCMTK_ABI_VERSION 14)
 
 # Package "release" settings (some are currently unused and, therefore, disabled)
-SET(DCMTK_PACKAGE_NAME "dcmtk")
-SET(DCMTK_PACKAGE_DATE "2018-02-05")
-SET(DCMTK_PACKAGE_VERSION "${DCMTK_MAJOR_VERSION}.${DCMTK_MINOR_VERSION}.${DCMTK_BUILD_VERSION}")
-SET(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_MAJOR_VERSION}${DCMTK_MINOR_VERSION}${DCMTK_BUILD_VERSION})
-SET(DCMTK_PACKAGE_VERSION_SUFFIX "")
-#SET(DCMTK_PACKAGE_TARNAME "dcmtk-${DCMTK_PACKAGE_VERSION}")
-#SET(DCMTK_PACKAGE_STRING "dcmtk ${DCMTK_PACKAGE_VERSION}")
-#SET(DCMTK_PACKAGE_BUGREPORT "bugs@dcmtk.org")
-#SET(DCMTK_PACKAGE_URL "http://www.dcmtk.org/")
+set(DCMTK_PACKAGE_NAME "dcmtk")
+set(DCMTK_PACKAGE_DATE "2018-11-29")
+set(DCMTK_PACKAGE_VERSION "${DCMTK_MAJOR_VERSION}.${DCMTK_MINOR_VERSION}.${DCMTK_BUILD_VERSION}")
+set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_MAJOR_VERSION}${DCMTK_MINOR_VERSION}${DCMTK_BUILD_VERSION})
+set(DCMTK_PACKAGE_VERSION_SUFFIX "")
+#set(DCMTK_PACKAGE_TARNAME "dcmtk-${DCMTK_PACKAGE_VERSION}")
+#set(DCMTK_PACKAGE_STRING "dcmtk ${DCMTK_PACKAGE_VERSION}")
+#set(DCMTK_PACKAGE_BUGREPORT "bugs@dcmtk.org")
+#set(DCMTK_PACKAGE_URL "http://www.dcmtk.org/")
 
 # Shared library version information
-SET(DCMTK_LIBRARY_PROPERTIES VERSION "${DCMTK_PACKAGE_VERSION}" SOVERSION "${DCMTK_ABI_VERSION}")
+SET(DCMTK_LIBRARY_PROPERTIES VERSION "${DCMTK_ABI_VERSION}.${DCMTK_PACKAGE_VERSION}" SOVERSION "${DCMTK_ABI_VERSION}")
 
 # General build options and settings
-OPTION(BUILD_APPS "Build command line applications and test programs." ON)
-OPTION(BUILD_SHARED_LIBS "Build with shared libraries." OFF)
-OPTION(BUILD_SINGLE_SHARED_LIBRARY "Build a single DCMTK library." OFF)
-MARK_AS_ADVANCED(BUILD_SINGLE_SHARED_LIBRARY)
-SET(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library postfix for debug builds. Usually left blank.")
+option(BUILD_APPS "Build command line applications and test programs." ON)
+option(BUILD_SHARED_LIBS "Build with shared libraries." OFF)
+option(BUILD_SINGLE_SHARED_LIBRARY "Build a single DCMTK library." OFF)
+mark_as_advanced(BUILD_SINGLE_SHARED_LIBRARY)
+set(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library postfix for debug builds. Usually left blank.")
 # add our CMake modules to the module path, but prefer the ones from CMake.
-LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules" "${CMAKE_CURRENT_SOURCE_DIR}/${DCMTK_CMAKE_INCLUDE}/CMake/")
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules" "${CMAKE_CURRENT_SOURCE_DIR}/${DCMTK_CMAKE_INCLUDE}/CMake/")
 # newer CMake versions will warn if a module exists in its and the project's module paths, which is now always
 # the case since above line adds CMake's module path to the project's one. It, therefore, doesn't matter whether
 # we set the policy to OLD or NEW, since in both cases CMake's own module will be preferred. We just set
 # the policy to silence the warning.
-IF(POLICY CMP0017)
-    CMAKE_POLICY(SET CMP0017 NEW)
-ENDIF()
-IF(BUILD_SINGLE_SHARED_LIBRARY)
+if(POLICY CMP0017)
+    cmake_policy(SET CMP0017 NEW)
+endif()
+if(BUILD_SINGLE_SHARED_LIBRARY)
   # When we are building a single shared lib, we are building shared libs :-)
-  SET(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
-ENDIF(BUILD_SINGLE_SHARED_LIBRARY)
+  set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
+endif()
 
 # DCMTK build options
-OPTION(DCMTK_WITH_TIFF "Configure DCMTK with support for TIFF." ON)
-OPTION(DCMTK_WITH_PNG "Configure DCMTK with support for PNG." ON)
-OPTION(DCMTK_WITH_XML "Configure DCMTK with support for XML." ON)
-OPTION(DCMTK_WITH_ZLIB "Configure DCMTK with support for ZLIB." ON)
-OPTION(DCMTK_WITH_OPENSSL "Configure DCMTK with support for OPENSSL." ON)
-OPTION(DCMTK_WITH_SNDFILE "Configure DCMTK with support for SNDFILE." ON)
-OPTION(DCMTK_WITH_ICONV "Configure DCMTK with support for ICONV." ON)
-OPTION(DCMTK_WITH_ICU "Configure DCMTK with support for ICU." ON)
-IF(NOT WIN32)
-  OPTION(DCMTK_WITH_WRAP "Configure DCMTK with support for WRAP." ON)
-ENDIF(NOT WIN32)
-OPTION(DCMTK_ENABLE_PRIVATE_TAGS "Configure DCMTK with support for DICOM private tags coming with DCMTK." OFF)
-OPTION(DCMTK_WITH_THREADS "Configure DCMTK with support for multi-threading." ON)
-OPTION(DCMTK_WITH_DOXYGEN "Build API documentation with DOXYGEN." ON)
-OPTION(DCMTK_GENERATE_DOXYGEN_TAGFILE "Generate a tag file with DOXYGEN." OFF)
-OPTION(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS "Build with wide char file I/O functions." OFF)
-OPTION(DCMTK_WIDE_CHAR_MAIN_FUNCTION "Build command line tools with wide char main function." OFF)
-OPTION(DCMTK_ENABLE_STL "Enable use of native STL classes and algorithms instead of DCMTK's own implementations." OFF)
-OPTION(DCMTK_ENABLE_CXX11 "Enable use of native C++11 features (eg. move semantics)." OFF)
-
-MACRO(DCMTK_INFERABLE_OPTION OPTION DESCRIPTION)
-  SET("${OPTION}" INFERRED CACHE STRING "${DESCRIPTION}")
-  SET_PROPERTY(CACHE "${OPTION}" PROPERTY STRINGS "INFERRED" "ON" "OFF")
+option(DCMTK_WITH_TIFF "Configure DCMTK with support for TIFF." ON)
+option(DCMTK_WITH_PNG "Configure DCMTK with support for PNG." ON)
+option(DCMTK_WITH_XML "Configure DCMTK with support for XML." ON)
+option(DCMTK_WITH_ZLIB "Configure DCMTK with support for ZLIB." ON)
+option(DCMTK_WITH_OPENSSL "Configure DCMTK with support for OPENSSL." ON)
+option(DCMTK_WITH_SNDFILE "Configure DCMTK with support for SNDFILE." ON)
+option(DCMTK_WITH_ICONV "Configure DCMTK with support for ICONV." ON)
+option(DCMTK_WITH_ICU "Configure DCMTK with support for ICU." ON)
+if(NOT WIN32)
+  option(DCMTK_WITH_WRAP "Configure DCMTK with support for WRAP." ON)
+endif()
+option(DCMTK_ENABLE_PRIVATE_TAGS "Configure DCMTK with support for DICOM private tags coming with DCMTK." OFF)
+option(DCMTK_WITH_THREADS "Configure DCMTK with support for multi-threading." ON)
+option(DCMTK_WITH_DOXYGEN "Build API documentation with DOXYGEN." ON)
+option(DCMTK_GENERATE_DOXYGEN_TAGFILE "Generate a tag file with DOXYGEN." OFF)
+option(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS "Build with wide char file I/O functions." OFF)
+option(DCMTK_WIDE_CHAR_MAIN_FUNCTION "Build command line tools with wide char main function." OFF)
+option(DCMTK_ENABLE_STL "Enable use of native STL classes and algorithms instead of DCMTK's own implementations." OFF)
+option(DCMTK_ENABLE_CXX11 "Enable use of native C++11 features (eg. move semantics)." OFF)
+
+macro(DCMTK_INFERABLE_OPTION OPTION DESCRIPTION)
+  set("${OPTION}" INFERRED CACHE STRING "${DESCRIPTION}")
+  set_property(CACHE "${OPTION}" PROPERTY STRINGS "INFERRED" "ON" "OFF")
   # currently, all inferable options are advanced options
-  MARK_AS_ADVANCED("${OPTION}")
-ENDMACRO(DCMTK_INFERABLE_OPTION)
+  mark_as_advanced("${OPTION}")
+endmacro()
 
 DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_VECTOR "Enable use of STL vector.")
 DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_ALGORITHM "Enable use of STL algorithm.")
@@ -121,122 +121,122 @@ DCMTK_INFERABLE_OPTION(DCMTK_ENABLE_STL_SYSTEM_ERROR "Enable use of STL system_e
 # disabled. Loading of external dictionary via run-time is, per default,
 # configured the the opposite way since most users won't be interested in using
 # the external default dictionary if it is already compiled in.
-IF(WIN32 OR MINGW)
-  OPTION(DCMTK_ENABLE_BUILTIN_DICTIONARY "Configure DCMTK with compiled-in data dictionary." ON)
-  OPTION(DCMTK_ENABLE_EXTERNAL_DICTIONARY "Configure DCMTK to load external dictionary from default path on startup." OFF)
-ELSE(WIN32 or MINGW) # built-in dictionary turned off on Unix per default
-  OPTION(DCMTK_ENABLE_BUILTIN_DICTIONARY "Configure DCMTK with compiled-in data dictionary." OFF)
-  OPTION(DCMTK_ENABLE_EXTERNAL_DICTIONARY "Configure DCMTK to load external dictionary from default path on startup." ON)
-ENDIF(WIN32 OR MINGW)
+if(WIN32 OR MINGW)
+  option(DCMTK_ENABLE_BUILTIN_DICTIONARY "Configure DCMTK with compiled-in data dictionary." ON)
+  option(DCMTK_ENABLE_EXTERNAL_DICTIONARY "Configure DCMTK to load external dictionary from default path on startup." ON)
+else() # built-in dictionary turned off on Unix per default
+  option(DCMTK_ENABLE_BUILTIN_DICTIONARY "Configure DCMTK with compiled-in data dictionary." OFF)
+  option(DCMTK_ENABLE_EXTERNAL_DICTIONARY "Configure DCMTK to load external dictionary from default path on startup." ON)
+endif()
 if (NOT DCMTK_ENABLE_EXTERNAL_DICTIONARY AND NOT DCMTK_ENABLE_BUILTIN_DICTIONARY)
-  MESSAGE(WARNING "Either external or built-in dictionary should be enabled, otherwise dictionary must be loaded manually on startup!")
-ENDIF(NOT DCMTK_ENABLE_EXTERNAL_DICTIONARY AND NOT DCMTK_ENABLE_BUILTIN_DICTIONARY)
+  message(WARNING "Either external or built-in dictionary should be enabled, otherwise dictionary must be loaded manually on startup!")
+endif()
 
 # Mark various settings as "advanced"
-MARK_AS_ADVANCED(CMAKE_DEBUG_POSTFIX)
-MARK_AS_ADVANCED(FORCE EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
-MARK_AS_ADVANCED(SNDFILE_DIR DCMTK_WITH_SNDFILE) # not yet needed in public DCMTK
-MARK_AS_ADVANCED(DCMTK_GENERATE_DOXYGEN_TAGFILE)
-IF(NOT WIN32)
+mark_as_advanced(CMAKE_DEBUG_POSTFIX)
+mark_as_advanced(FORCE EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
+mark_as_advanced(SNDFILE_DIR DCMTK_WITH_SNDFILE) # not yet needed in public DCMTK
+mark_as_advanced(DCMTK_GENERATE_DOXYGEN_TAGFILE)
+if(NOT WIN32)
   # support for wide char file I/O functions is currently Windows-specific
-  MARK_AS_ADVANCED(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS)
+  mark_as_advanced(DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS)
   # support for wide char main function is Windows-specific
-  MARK_AS_ADVANCED(DCMTK_WIDE_CHAR_MAIN_FUNCTION)
-ENDIF(NOT WIN32)
+  mark_as_advanced(DCMTK_WIDE_CHAR_MAIN_FUNCTION)
+endif()
 
-ENABLE_TESTING()
+enable_testing()
 
 #-----------------------------------------------------------------------------
 # Include appropriate modules and set required variables for cross compiling
 #-----------------------------------------------------------------------------
 
-IF(CMAKE_CROSSCOMPILING)
-  IF(WIN32)
-    INCLUDE("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseWine.cmake")
+if(CMAKE_CROSSCOMPILING)
+  if(WIN32)
+    include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseWine.cmake")
     DCMTK_SETUP_WINE()
-  ELSEIF(ANDROID)
-    INCLUDE("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseAndroidSDK.cmake")
+  elseif(ANDROID)
+    include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkUseAndroidSDK.cmake")
     # Ensure the configuration variables for the Android device emulator exist in the cache.
     DCMTK_SETUP_ANDROID_EMULATOR()
-  ENDIF()
-ENDIF(CMAKE_CROSSCOMPILING)
+  endif()
+endif()
 
 #-----------------------------------------------------------------------------
 # Generic utilities used for configuring DCMTK
 #-----------------------------------------------------------------------------
 
-INCLUDE("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkMacros.cmake")
+include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkMacros.cmake")
 
 #-----------------------------------------------------------------------------
 # Prepare external dependencies for cross compiling
 # (i.e. start the emulator if required)
 #-----------------------------------------------------------------------------
 
-IF(CMAKE_CROSSCOMPILING)
-  UNSET(DCMTK_UNIT_TESTS_UNSUPPORTED_WARN_ONCE CACHE)
-  IF(ANDROID)
-    UNSET(DCMTK_TRY_RUN_ANDROID_RUNTIME_INSTALLED CACHE)
+if(CMAKE_CROSSCOMPILING)
+  unset(DCMTK_UNIT_TESTS_UNSUPPORTED_WARN_ONCE CACHE)
+  if(ANDROID)
+    unset(DCMTK_TRY_RUN_ANDROID_RUNTIME_INSTALLED CACHE)
     DCMTK_ANDROID_START_EMULATOR(DCMTK_ANDROID_EMULATOR_INSTANCE)
-  ENDIF()
-ENDIF(CMAKE_CROSSCOMPILING)
+  endif()
+endif()
 
 #-----------------------------------------------------------------------------
 # Installation sub-directories
 #-----------------------------------------------------------------------------
 
 # Set project name variable to package name for GnuInstallDirs
-SET(PROJECT_NAME "${DCMTK_PACKAGE_NAME}")
+set(PROJECT_NAME "${DCMTK_PACKAGE_NAME}")
 # Provides CMake cache variables with reasonable defaults to create a GNU style installation
 # directory structure
-INCLUDE(GNUInstallDirs)
+include(GNUInstallDirs)
 # CMake's files (DCMTKTarget.cmake, DCMTKConfigVersion.cmake and DCMTKConfig.cmake) are installed
 # to different installation paths under Unix- and Windows-based systems
-IF(UNIX)
-  SET(DCMTK_INSTALL_CMKDIR "${CMAKE_INSTALL_LIBDIR}/cmake/dcmtk")
-ELSEIF(WIN32)
-  SET(DCMTK_INSTALL_CMKDIR "cmake")
-ENDIF(UNIX)
+if(UNIX)
+  set(DCMTK_INSTALL_CMKDIR "${CMAKE_INSTALL_LIBDIR}/cmake/dcmtk")
+elseif(WIN32)
+  set(DCMTK_INSTALL_CMKDIR "cmake")
+endif()
 
 #-----------------------------------------------------------------------------
 # Build directories
 #-----------------------------------------------------------------------------
-SET(DCMTK_BUILD_CMKDIR "${CMAKE_BINARY_DIR}")
+set(DCMTK_BUILD_CMKDIR "${CMAKE_BINARY_DIR}")
 
 #-----------------------------------------------------------------------------
 # Start with clean DCMTKTargets.cmake, filled in GenerateCMakeExports.cmake
 #-----------------------------------------------------------------------------
-FILE(WRITE "${DCMTK_BUILD_CMKDIR}/DCMTKTargets.cmake" "")
+file(WRITE "${DCMTK_BUILD_CMKDIR}/DCMTKTargets.cmake" "")
 
 #-----------------------------------------------------------------------------
 # Platform-independent settings
 #-----------------------------------------------------------------------------
 
 # pass optional build date to compiler
-#SET(DCMTK_BUILD_DATE "\\\"YYYY-MM-DD\\\"")
-IF(DCMTK_BUILD_DATE)
+#set(DCMTK_BUILD_DATE "\\\"YYYY-MM-DD\\\"")
+if(DCMTK_BUILD_DATE)
 
-    IF(COMMAND CMAKE_POLICY)
+    if(COMMAND CMAKE_POLICY)
         # Works around warnings about escaped quotes in ADD_DEFINITIONS statements
-        CMAKE_POLICY(SET CMP0005 OLD)
-    ENDIF(COMMAND CMAKE_POLICY)
+        cmake_policy(SET CMP0005 OLD)
+    endif()
 
     # Xcode needs one escaping layer more than (as far as we know) everyone else - we gotta go deeper!
-    IF(CMAKE_GENERATOR MATCHES Xcode)
-        STRING(REPLACE "\\" "\\\\" DCMTK_BUILD_DATE "${DCMTK_BUILD_DATE}")
-    ENDIF()
-    ADD_DEFINITIONS(-DDCMTK_BUILD_DATE=${DCMTK_BUILD_DATE})
-ENDIF(DCMTK_BUILD_DATE)
+    if(CMAKE_GENERATOR MATCHES Xcode)
+        string(REPLACE "\\" "\\\\" DCMTK_BUILD_DATE "${DCMTK_BUILD_DATE}")
+    endif()
+    add_definitions(-DDCMTK_BUILD_DATE=${DCMTK_BUILD_DATE})
+endif()
 
 # make OFString(NULL) safe by default
-ADD_DEFINITIONS(-DUSE_NULL_SAFE_OFSTRING)
+add_definitions(-DUSE_NULL_SAFE_OFSTRING)
 
 # tell the DCMTK that we are building the DCMTK
-ADD_DEFINITIONS(-DDCMTK_BUILD_IN_PROGRESS)
+add_definitions(-DDCMTK_BUILD_IN_PROGRESS)
 
 # build output files in these directories
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
 
 #-----------------------------------------------------------------------------
 # Platform-specific settings
@@ -244,102 +244,102 @@ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
 
 # set project wide flags for compiler and linker
 
-IF(WIN32)
-  OPTION(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS "Overwrite compiler flags with DCMTK's WIN32 package default values." ON)
-ELSE(WIN32)
-  SET(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS OFF)
-ENDIF(WIN32)
+if(WIN32)
+  option(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS "Overwrite compiler flags with DCMTK's WIN32 package default values." ON)
+else()
+  set(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS OFF)
+endif()
 
-IF(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS AND NOT BUILD_SHARED_LIBS)
+if(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS AND NOT BUILD_SHARED_LIBS)
 
   # settings for Microsoft Visual Studio
-  IF(CMAKE_GENERATOR MATCHES "Visual Studio .*")
+  if(CMAKE_GENERATOR MATCHES "Visual Studio .*")
     # get Visual Studio Version
-    STRING(REGEX REPLACE "Visual Studio ([0-9]+).*" "\\1" VS_VERSION "${CMAKE_GENERATOR}")
+    string(REGEX REPLACE "Visual Studio ([0-9]+).*" "\\1" VS_VERSION "${CMAKE_GENERATOR}")
     # these settings never change even for C or C++
-    SET(CMAKE_C_FLAGS_DEBUG "/MTd /Z7 /Od")
-    SET(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /MT /O2")
-    SET(CMAKE_C_FLAGS_MINSIZEREL "/DNDEBUG /MT /O2")
-    SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/DNDEBUG /MTd /Z7 /Od")
-    SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od")
-    SET(CMAKE_CXX_FLAGS_RELEASE "/DNDEBUG /MT /O2")
-    SET(CMAKE_CXX_FLAGS_MINSIZEREL "/DNDEBUG /MT /O2")
-    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/DNDEBUG /MTd /Z7 /Od")
+    set(CMAKE_C_FLAGS_DEBUG "/MTd /Z7 /Od")
+    set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /MT /O2")
+    set(CMAKE_C_FLAGS_MINSIZEREL "/DNDEBUG /MT /O2")
+    set(CMAKE_C_FLAGS_RELWITHDEBINFO "/DNDEBUG /MTd /Z7 /Od")
+    set(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od")
+    set(CMAKE_CXX_FLAGS_RELEASE "/DNDEBUG /MT /O2")
+    set(CMAKE_CXX_FLAGS_MINSIZEREL "/DNDEBUG /MT /O2")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/DNDEBUG /MTd /Z7 /Od")
     # specific settings for the various Visual Studio versions
-    IF(VS_VERSION EQUAL 6)
-      SET(CMAKE_C_FLAGS "/nologo /W3 /GX /Gy /YX")
-      SET(CMAKE_CXX_FLAGS "/nologo /W3 /GX /Gy /YX /Zm500") # /Zm500 increments heap size which is needed on some system to compile templates in dcmimgle
-    ENDIF(VS_VERSION EQUAL 6)
-    IF(VS_VERSION EQUAL 7)
-      SET(CMAKE_C_FLAGS "/nologo /W3 /Gy")
-      SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy")
-    ENDIF(VS_VERSION EQUAL 7)
-    IF(VS_VERSION GREATER 7)
-      SET(CMAKE_C_FLAGS "/nologo /W3 /Gy /EHsc")
-      SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy /EHsc")
-    ENDIF(VS_VERSION GREATER 7)
-  ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio .*")
+    if(VS_VERSION EQUAL 6)
+      set(CMAKE_C_FLAGS "/nologo /W3 /GX /Gy /YX")
+      set(CMAKE_CXX_FLAGS "/nologo /W3 /GX /Gy /YX /Zm500") # /Zm500 increments heap size which is needed on some system to compile templates in dcmimgle
+    endif()
+    if(VS_VERSION EQUAL 7)
+      set(CMAKE_C_FLAGS "/nologo /W3 /Gy")
+      set(CMAKE_CXX_FLAGS "/nologo /W3 /Gy")
+    endif()
+    if(VS_VERSION GREATER 7)
+      set(CMAKE_C_FLAGS "/nologo /W3 /Gy /EHsc")
+      set(CMAKE_CXX_FLAGS "/nologo /W3 /Gy /EHsc")
+    endif()
+  endif()
 
   # settings for Borland C++
-  IF(CMAKE_GENERATOR MATCHES "Borland Makefiles")
+  if(CMAKE_GENERATOR MATCHES "Borland Makefiles")
     # further settings required? not tested for a very long time!
-    SET(CMAKE_STANDARD_LIBRARIES "import32.lib cw32mt.lib")
-  ENDIF(CMAKE_GENERATOR MATCHES "Borland Makefiles")
+    set(CMAKE_STANDARD_LIBRARIES "import32.lib cw32mt.lib")
+  endif()
 
-ENDIF(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS AND NOT BUILD_SHARED_LIBS)
+endif()
 
-IF(BUILD_SHARED_LIBS)
-  SET(DCMTK_SHARED ON)
-  IF(BUILD_SINGLE_SHARED_LIBRARY)
+if(BUILD_SHARED_LIBS)
+  set(DCMTK_SHARED ON)
+  if(BUILD_SINGLE_SHARED_LIBRARY)
     # We can't build apps, because there is no way to tell CMake to link apps
     # against the library.
-    SET(BUILD_APPS OFF CACHE BOOL "" FORCE)
+    set(BUILD_APPS OFF CACHE BOOL "" FORCE)
     # We are building static code that can be used in a shared lib
-    SET(DCMTK_BUILD_SINGLE_SHARED_LIBRARY ON)
+    set(DCMTK_BUILD_SINGLE_SHARED_LIBRARY ON)
     # Make CMake build object libraries. They are just a list of object files
     # which aren't linked together yet.
-    SET(DCMTK_LIBRARY_TYPE OBJECT)
+    set(DCMTK_LIBRARY_TYPE OBJECT)
     # Static and shared libraries can have dependencies in CMake. Object
     # libraries cannot. Since CMake saves dependencies in its cache, we have to
     # make sure that it doesn't get confused when a "normal" library turns into
     # an object library. Do this via a suffix.
-    SET(DCMTK_LIBRARY_SUFFIX _obj)
+    set(DCMTK_LIBRARY_SUFFIX _obj)
     # This uses object libraries which are new in CMake 2.8.8
-    CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-  ENDIF(BUILD_SINGLE_SHARED_LIBRARY)
+    cmake_minimum_required(VERSION 2.8.8)
+  endif()
 
-  OPTION(USE_COMPILER_HIDDEN_VISIBILITY
+  option(USE_COMPILER_HIDDEN_VISIBILITY
       "Use hidden visibility support if available" ON)
-  MARK_AS_ADVANCED(USE_COMPILER_HIDDEN_VISIBILITY)
+  mark_as_advanced(USE_COMPILER_HIDDEN_VISIBILITY)
 
-  INCLUDE(CheckCXXCompilerFlag)
+  include(CheckCXXCompilerFlag)
   CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" GXX_SUPPORTS_VISIBILITY)
   # This "NOT WIN32" is needed due to a CMake bug that was fixed in
   # CMake 2.8.x. CHECK_CXX_COMPILER_FLAG() always says "ok" with MSC.
-  IF(GXX_SUPPORTS_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY AND NOT WIN32)
-    SET(HAVE_HIDDEN_VISIBILITY ON)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
-  ELSE(GXX_SUPPORTS_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY AND NOT WIN32)
-    SET(HAVE_HIDDEN_VISIBILITY)
-  ENDIF(GXX_SUPPORTS_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY AND NOT WIN32)
-ENDIF(BUILD_SHARED_LIBS)
-
-IF(WIN32)   # special handling for Windows systems
-
-  IF(MINGW)
+  if(GXX_SUPPORTS_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY AND NOT WIN32)
+    set(HAVE_HIDDEN_VISIBILITY ON)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+  else()
+    set(HAVE_HIDDEN_VISIBILITY)
+  endif()
+endif()
+
+if(WIN32)   # special handling for Windows systems
+
+  if(MINGW)
     # Avoid auto-importing warnings on MinGW
-    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--enable-auto-import")
-  ELSE(MINGW)
-    IF(NOT BORLAND)
-      IF(NOT CYGWIN)
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--enable-auto-import")
+  else()
+    if(NOT BORLAND)
+      if(NOT CYGWIN)
         # Disable min() and max() macros pre-defined by Microsoft. We define our own
         # version in oflimits.h and on Windows that could result in name clashes in
         # Visual Studio.
-        ADD_DEFINITIONS(-DNOMINMAX)
+        add_definitions(-DNOMINMAX)
         # On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security warnings.
-        IF(NOT DCMTK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
-          ADD_DEFINITIONS(
+        if(NOT DCMTK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
+          add_definitions(
             -D_CRT_FAR_MAPPINGS_NO_DEPRECATE
             -D_CRT_IS_WCTYPE_NO_DEPRECATE
             -D_CRT_MANAGED_FP_NO_DEPRECATE
@@ -351,85 +351,85 @@ IF(WIN32)   # special handling for Windows systems
             -D_CRT_VCCLRIT_NO_DEPRECATE
             -D_SCL_SECURE_NO_DEPRECATE
             )
-        ENDIF(NOT DCMTK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
-      ENDIF(NOT CYGWIN)
-    ENDIF(NOT BORLAND)
-  ENDIF(MINGW)
+        endif()
+      endif()
+    endif()
+  endif()
 
-ELSE(WIN32)   # ... for non-Windows systems
+else()   # ... for non-Windows systems
 
   # Compiler flags for Mac OS X
-  IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE")
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE")
+  if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE")
   # Compiler flags for NetBSD
-  ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_NETBSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L")
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_NETBSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L")
+  elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_NETBSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_NETBSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L")
   # Solaris, FreeBSD and newer versions of OpenBSD fail with these flags
-  ELSEIF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD" OR ${CMAKE_SYSTEM_VERSION} VERSION_LESS 4))
+  elseif(NOT CMAKE_SYSTEM_NAME MATCHES "SunOS" AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD" AND (NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD" OR CMAKE_SYSTEM_VERSION VERSION_LESS 4))
     # Compiler flags for all other non-Windows systems
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L")
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L")
-  ENDIF()
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L")
+  endif()
 
-  OPTION(DCMTK_FORCE_FPIC_ON_UNIX "Add -fPIC compiler flag on unix 64 bit machines to allow linking from dynamic libraries even if DCMTK is built statically" OFF)
-  MARK_AS_ADVANCED(DCMTK_FORCE_FPIC_ON_UNIX)
+  option(DCMTK_FORCE_FPIC_ON_UNIX "Add -fPIC compiler flag on unix 64 bit machines to allow linking from dynamic libraries even if DCMTK is built statically" OFF)
+  mark_as_advanced(DCMTK_FORCE_FPIC_ON_UNIX)
 
   # Setting for IA64 / x86_64 which needs -fPIC compiler flag required for shared library build on these platforms
-  IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND DCMTK_FORCE_FPIC_ON_UNIX)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
-  ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND DCMTK_FORCE_FPIC_ON_UNIX)
+  if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND DCMTK_FORCE_FPIC_ON_UNIX)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+  endif()
 
-ENDIF(WIN32)
+endif()
 
 # define libraries and object files that must be linked to most Windows applications
-IF(WIN32)
-  SET(WIN32_STD_LIBRARIES iphlpapi ws2_32 netapi32 wsock32)
-  IF(NOT DEFINED MINGW)
+if(WIN32)
+  set(WIN32_STD_LIBRARIES iphlpapi ws2_32 netapi32 wsock32)
+  if(NOT DEFINED MINGW)
     # additional object file needed for wildcard expansion; for wchar_t* support, use 'wsetargv'
-    SET(WIN32_STD_OBJECTS setargv)
-  ENDIF(NOT DEFINED MINGW)
+    set(WIN32_STD_OBJECTS setargv)
+  endif()
   # settings for Borland C++
-  IF(CMAKE_CXX_COMPILER MATCHES bcc32)
+  if(CMAKE_CXX_COMPILER MATCHES bcc32)
     # to be checked: further settings required?
-    SET(CMAKE_STANDARD_LIBRARIES "import32.lib cw32mt.lib")
-  ENDIF(CMAKE_CXX_COMPILER MATCHES bcc32)
-ENDIF(WIN32)
+    set(CMAKE_STANDARD_LIBRARIES "import32.lib cw32mt.lib")
+  endif()
+endif()
 
 # add definition of "DEBUG" to debug mode (since CMake does not do this automatically)
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
 
 # determine which flags are required to enable C++11 features (if any)
-IF(NOT DEFINED DCMTK_CXX11_FLAGS)
-  IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
-    SET(DCMTK_CXX11_FLAGS "-std=c++11")
-  ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
-    IF(CMAKE_HOST_WIN32)
-      SET(DCMTK_CXX11_FLAGS "/Qstd=c++11")
-    ELSE()
-      SET(DCMTK_CXX11_FLAGS "-std=c++11")
-    ENDIF()
-  ELSE()
-    SET(DCMTK_CXX11_FLAGS "")
-  ENDIF()
-  SET(DCMTK_CXX11_FLAGS "${DCMTK_CXX11_FLAGS}" CACHE STRING "The flags to add to CMAKE_CXX_FLAGS for enabling C++11 (if any).")
-  MARK_AS_ADVANCED(DCMTK_CXX11_FLAGS)
-ENDIF(NOT DEFINED DCMTK_CXX11_FLAGS)
+if(NOT DEFINED DCMTK_CXX11_FLAGS)
+  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
+    set(DCMTK_CXX11_FLAGS "-std=c++11")
+  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+    if(CMAKE_HOST_WIN32)
+      set(DCMTK_CXX11_FLAGS "/Qstd=c++11")
+    else()
+      set(DCMTK_CXX11_FLAGS "-std=c++11")
+    endif()
+  else()
+    set(DCMTK_CXX11_FLAGS "")
+  endif()
+  set(DCMTK_CXX11_FLAGS "${DCMTK_CXX11_FLAGS}" CACHE STRING "The flags to add to CMAKE_CXX_FLAGS for enabling C++11 (if any).")
+  mark_as_advanced(DCMTK_CXX11_FLAGS)
+endif()
 
 #-----------------------------------------------------------------------------
 # Third party libraries
 #-----------------------------------------------------------------------------
 
-INCLUDE(${DCMTK_CMAKE_INCLUDE}CMake/3rdparty.cmake)
+include(${DCMTK_CMAKE_INCLUDE}CMake/3rdparty.cmake)
 
 #-----------------------------------------------------------------------------
 # DCMTK libraries
 #-----------------------------------------------------------------------------
 
-INCLUDE(${DCMTK_CMAKE_INCLUDE}CMake/GenerateDCMTKConfigure.cmake)
+include(${DCMTK_CMAKE_INCLUDE}CMake/GenerateDCMTKConfigure.cmake)
 
 #-----------------------------------------------------------------------------
 # Dart configuration (disabled per default)
@@ -438,56 +438,56 @@ INCLUDE(${DCMTK_CMAKE_INCLUDE}CMake/GenerateDCMTKConfigure.cmake)
 # Includes build targets Experimental, Nightly and Continuous which are the standard
 # groups pre-configured in Dashboard. In CTest these groups are called "Tracks".
 #
-# INCLUDE(${CMAKE_ROOT}/Modules/Dart.cmake)
-# IF(BUILD_TESTING)
-#   ENABLE_TESTING()
-# ENDIF(BUILD_TESTING)
+# include(${CMAKE_ROOT}/Modules/Dart.cmake)
+# if(BUILD_TESTING)
+#   enable_testing()
+# endif()
 
 #-----------------------------------------------------------------------------
 # Thread support
 #-----------------------------------------------------------------------------
 
 # See dcmtk/config/configure.in
-IF(WITH_THREADS)
-  ADD_DEFINITIONS(-D_REENTRANT)
-  IF(HAVE_PTHREAD_RWLOCK)
-    IF(APPLE)
-      ADD_DEFINITIONS(-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE)
-    ENDIF(APPLE)
-    IF("${CMAKE_SYSTEM_NAME}" MATCHES "^IRIX")
-      ADD_DEFINITIONS(-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT)
-    ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "^IRIX")
-  ENDIF(HAVE_PTHREAD_RWLOCK)
-
-  IF(HAVE_PTHREAD_H)
+if(WITH_THREADS)
+  add_definitions(-D_REENTRANT)
+  if(HAVE_PTHREAD_RWLOCK)
+    if(APPLE)
+      add_definitions(-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE)
+    endif()
+    if(CMAKE_SYSTEM_NAME MATCHES "^IRIX")
+      add_definitions(-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT)
+    endif()
+  endif()
+
+  if(HAVE_PTHREAD_H)
     CHECK_LIBRARY_EXISTS(pthread pthread_key_create "" HAVE_LIBPTHREAD)
-    IF(HAVE_LIBPTHREAD)
-      SET(THREAD_LIBS pthread)
-    ENDIF(HAVE_LIBPTHREAD)
+    if(HAVE_LIBPTHREAD)
+      set(THREAD_LIBS pthread)
+    endif()
     CHECK_LIBRARY_EXISTS(rt sem_init "" HAVE_LIBRT)
-    IF(HAVE_LIBRT)
-      SET(THREAD_LIBS ${THREAD_LIBS} rt)
-    ENDIF(HAVE_LIBRT)
-  ENDIF(HAVE_PTHREAD_H)
-ENDIF(WITH_THREADS)
+    if(HAVE_LIBRT)
+      set(THREAD_LIBS ${THREAD_LIBS} rt)
+    endif()
+  endif()
+endif()
 
 #-----------------------------------------------------------------------------
 # Test for socket libraries if needed (Solaris)
 #-----------------------------------------------------------------------------
 
-SET(SOCKET_LIBS)
+set(SOCKET_LIBS)
 
-FUNCTION(DCMTK_TEST_SOCKET_LIBRARY NAME SYMBOL)
-  STRING(TOUPPER "${NAME}" VARNAME)
+function(DCMTK_TEST_SOCKET_LIBRARY NAME SYMBOL)
+  string(TOUPPER "${NAME}" VARNAME)
   CHECK_LIBRARY_EXISTS("${NAME}" "main" "" "HAVE_LIB${VARNAME}_MAIN")
-  IF(NOT HAVE_LIB${VARNAME}_MAIN)
+  if(NOT HAVE_LIB${VARNAME}_MAIN)
     CHECK_LIBRARY_EXISTS("${NAME}" "${SYMBOL}" "" "HAVE_LIB${VARNAME}")
-  ENDIF(NOT HAVE_LIB${VARNAME}_MAIN)
-  IF(HAVE_LIB${VARNAME} OR HAVE_LIB${VARNAME}_MAIN)
-    LIST(APPEND SOCKET_LIBS "${NAME}")
-    SET(SOCKET_LIBS "${SOCKET_LIBS}" PARENT_SCOPE)
-  ENDIF(HAVE_LIB${VARNAME} OR HAVE_LIB${VARNAME}_MAIN)
-ENDFUNCTION(DCMTK_TEST_SOCKET_LIBRARY)
+  endif()
+  if(HAVE_LIB${VARNAME} OR HAVE_LIB${VARNAME}_MAIN)
+    list(APPEND SOCKET_LIBS "${NAME}")
+    set(SOCKET_LIBS "${SOCKET_LIBS}" PARENT_SCOPE)
+  endif()
+endfunction()
 
 DCMTK_TEST_SOCKET_LIBRARY(nsl "gethostbyname")
 DCMTK_TEST_SOCKET_LIBRARY(socket "socket")
@@ -496,16 +496,16 @@ DCMTK_TEST_SOCKET_LIBRARY(socket "socket")
 # Test if SunPro compiler and add features
 #-----------------------------------------------------------------------------
 
-IF(CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -features=tmplrefstatic")
-ENDIF()
+if(CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -features=tmplrefstatic")
+endif()
 
 #-----------------------------------------------------------------------------
 # workaround for using the deprecated generator expression $<CONFIGURATION>
 # with old CMake versions that do not understand $<CONFIG>
 #-----------------------------------------------------------------------------
-IF(CMAKE_VERSION VERSION_LESS 3.0.0)
-  SET(DCMTK_CONFIG_GENERATOR_EXPRESSION "$<CONFIGURATION>" CACHE INTERNAL "the generator expression to use for retriving the current config")
-ELSE()
-  SET(DCMTK_CONFIG_GENERATOR_EXPRESSION "$<CONFIG>" CACHE INTERNAL "the generator expression to use for retriving the current config")
-ENDIF()
+if(CMAKE_VERSION VERSION_LESS 3.0.0)
+  set(DCMTK_CONFIG_GENERATOR_EXPRESSION "$<CONFIGURATION>" CACHE INTERNAL "the generator expression to use for retriving the current config")
+else()
+  set(DCMTK_CONFIG_GENERATOR_EXPRESSION "$<CONFIG>" CACHE INTERNAL "the generator expression to use for retriving the current config")
+endif()
index 0010b0b67f08693d85aae661b2c640c4558c2d53..df5f3b85d732c6255e396e0ff2d67f983e036b20 100644 (file)
@@ -5,39 +5,39 @@
 # MESSAGE - Description of the thing that we are checking for
 # SOURCE - Code to compile
 #
-# All extra arguments are passed to TRY_COMPILE().
+# All extra arguments are passed to try_compile().
 #
 
-MACRO(DCMTK_TRY_COMPILE VAR MESSAGE SOURCE)
-    SET(DCMTK_TRY_COMPILE_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx")
+macro(DCMTK_TRY_COMPILE VAR MESSAGE SOURCE)
+    set(DCMTK_TRY_COMPILE_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx")
 
     # Do nothing if the variable is already set
-    IF(NOT DEFINED "${VAR}")
-        MESSAGE(STATUS "Checking whether ${MESSAGE}")
-        FILE(WRITE "${DCMTK_TRY_COMPILE_FILE}" "${SOURCE}\n")
-        IF(DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS)
-            SET(DCMTK_TRY_COMPILE_CMAKE_FLAGS CMAKE_FLAGS ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS})
-        ELSE()
+    if(NOT DEFINED "${VAR}")
+        message(STATUS "Checking whether ${MESSAGE}")
+        file(WRITE "${DCMTK_TRY_COMPILE_FILE}" "${SOURCE}\n")
+        if(DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS)
+            set(DCMTK_TRY_COMPILE_CMAKE_FLAGS CMAKE_FLAGS ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS})
+        else()
             DCMTK_UNSET(DCMTK_TRY_COMPILE_CMAKE_FLAGS)
-        ENDIF()
-        TRY_COMPILE(${VAR}
+        endif()
+        try_compile(${VAR}
                     "${CMAKE_BINARY_DIR}"
                     "${DCMTK_TRY_COMPILE_FILE}"
                     ${DCMTK_TRY_COMPILE_CMAKE_FLAGS}
                     OUTPUT_VARIABLE OUTPUT
                     ${ARGN})
-        IF(${VAR})
-            MESSAGE(STATUS "Checking whether ${MESSAGE} -- yes")
-            SET(${VAR} 1 CACHE INTERNAL "${MESSAGE}")
-            FILE(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log"
+        if(${VAR})
+            message(STATUS "Checking whether ${MESSAGE} -- yes")
+            set(${VAR} 1 CACHE INTERNAL "${MESSAGE}")
+            file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log"
                  "${MESSAGE} passed with the following output:\n"
                  "${OUTPUT}\n")
-        ELSE(${VAR})
-            MESSAGE(STATUS "Checking whether ${MESSAGE} -- no")
-            SET(${VAR} 0 CACHE INTERNAL "${MESSAGE}")
-            FILE(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
+        else()
+            message(STATUS "Checking whether ${MESSAGE} -- no")
+            set(${VAR} 0 CACHE INTERNAL "${MESSAGE}")
+            file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
                  "${MESSAGE} failed with the following output:\n"
                  "${OUTPUT}\n")
-        ENDIF(${VAR})
-    ENDIF(NOT DEFINED "${VAR}")
-ENDMACRO(DCMTK_TRY_COMPILE)
+        endif()
+    endif()
+endmacro()
index 3a425f29dea407ad47481759de9a829e98a2cc41..86f7bd8b278ec547de255598ebe266c9114122e6 100644 (file)
@@ -1,64 +1,67 @@
 #
-# Wrapper implementation of TRY_RUN(), with some support for
+# Wrapper implementation of try_run(), with some support for
 # cross-compiling
 #
-# Usage and syntax is equivalent to CMake's TRY_RUN().
+# Usage and syntax is equivalent to CMake's try_run().
 #
 
 # CMakeParseArguments was introduced in CMake 2.8.3.
-# DCMTK_TRY_RUN will revert to CMake's internal TRY_RUN()
+# DCMTK_TRY_RUN will revert to CMake's internal try_run()
 # for versions prior to 2.8.3, as arguments can't be parsed
 # in that case. This means cross compiling support will be
 # disabled for CMake versions prior to 2.8.3.
-IF(CMAKE_VERSION VERSION_LESS 2.8.3)
+if(CMAKE_VERSION VERSION_LESS 2.8.3)
 
-MACRO(DCMTK_TRY_RUN)
-    TRY_RUN(${ARGN})
-ENDMACRO(DCMTK_TRY_RUN)
+macro(DCMTK_TRY_RUN)
+    try_run(${ARGN})
+endmacro()
 
-ELSE(CMAKE_VERSION VERSION_LESS 2.8.3)
+else()
 
-INCLUDE(CMakeParseArguments)
+include(CMakeParseArguments)
 
-FUNCTION(DCMTK_TRY_RUN_CROSS RUN_RESULT_VAR COMPILE_RESULT_VAR bindir srcfile)
-    CMAKE_PARSE_ARGUMENTS(DCMTK_TRY_RUN
+function(DCMTK_TRY_RUN_CROSS RUN_RESULT_VAR COMPILE_RESULT_VAR bindir srcfile)
+    set(PASSTHROUGH_ARGS COMPILE_DEFINITIONS LINK_LIBRARIES)
+    cmake_parse_arguments(DCMTK_TRY_RUN
             ""
             "COMPILE_OUTPUT_VARIABLE;RUN_OUTPUT_VARIABLE;OUTPUT_VARIABLE"
-            "CMAKE_FLAGS;COMPILE_DEFINITIONS;ARGS"
+            "CMAKE_FLAGS;${PASSTHROUGH_ARGS};ARGS"
             ${ARGN}
     )
-    GET_FILENAME_COMPONENT(OUTPUT_EXECUTABLE_NAME "${srcfile}" NAME)
-    SET(OUTPUT_EXECUTABLE_NAME "${OUTPUT_EXECUTABLE_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
-    SET(OUTPUT_EXECUTABLE "${bindir}/${OUTPUT_EXECUTABLE_NAME}")
-    SET(TRY_COMPILE_ARGS "${COMPILE_RESULT_VAR}" "${bindir}" "${srcfile}")
-    IF(DCMTK_TRY_RUN_CMAKE_FLAGS)
-        LIST(APPEND TRY_COMPILE_ARGS CMAKE_FLAGS ${DCMTK_TRY_RUN_CMAKE_FLAGS} ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS})
-    ELSEIF(DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS)
-        LIST(APPEND TRY_COMPILE_ARGS CMAKE_FLAGS ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS})
-    ENDIF()
-    IF(DCMTK_TRY_RUN_COMPILE_DEFINITIONS)
-        LIST(APPEND TRY_COMPILE_ARGS COMPILE_DEFINITIONS ${DCMTK_TRY_RUN_COMPILE_DEFINITIONS})
-    ENDIF()
-    IF(DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE)
-        LIST(APPEND TRY_COMPILE_ARGS OUTPUT_VARIABLE ${DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE})
-    ENDIF()
-    TRY_COMPILE(${TRY_COMPILE_ARGS} COPY_FILE "${OUTPUT_EXECUTABLE}")
-    SET("${COMPILE_RESULT_VAR}" ${${COMPILE_RESULT_VAR}} PARENT_SCOPE)
-    IF(DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE)
-        SET("${DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE}" ${${DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE}} PARENT_SCOPE)
-    ENDIF()
-    IF(${COMPILE_RESULT_VAR})
-        IF(WIN32)
+    get_filename_component(OUTPUT_EXECUTABLE_NAME "${srcfile}" NAME)
+    set(OUTPUT_EXECUTABLE_NAME "${OUTPUT_EXECUTABLE_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
+    set(OUTPUT_EXECUTABLE "${bindir}/${OUTPUT_EXECUTABLE_NAME}")
+    set(TRY_COMPILE_ARGS "${COMPILE_RESULT_VAR}" "${bindir}" "${srcfile}")
+    if(DCMTK_TRY_RUN_CMAKE_FLAGS)
+        list(APPEND TRY_COMPILE_ARGS CMAKE_FLAGS ${DCMTK_TRY_RUN_CMAKE_FLAGS} ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS})
+    elseif(DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS)
+        list(APPEND TRY_COMPILE_ARGS CMAKE_FLAGS ${DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS})
+    endif()
+    foreach(ARG ${PASSTHROUGH_ARGS})
+        if(DCMTK_TRY_RUN_${ARG})
+            list(APPEND TRY_COMPILE_ARGS "${ARG}" ${DCMTK_TRY_RUN_${ARG}})
+        endif()
+    endforeach()
+    if(DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE)
+        list(APPEND TRY_COMPILE_ARGS OUTPUT_VARIABLE ${DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE})
+    endif()
+    try_compile(${TRY_COMPILE_ARGS} COPY_FILE "${OUTPUT_EXECUTABLE}")
+    set("${COMPILE_RESULT_VAR}" ${${COMPILE_RESULT_VAR}} PARENT_SCOPE)
+    if(DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE)
+        set("${DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE}" ${${DCMTK_TRY_RUN_COMPILE_OUTPUT_VARIABLE}} PARENT_SCOPE)
+    endif()
+    if(${COMPILE_RESULT_VAR})
+        if(WIN32)
             WINE_COMMAND(CMD "${OUTPUT_EXECUTABLE}" ${DCMTK_TRY_RUN_ARGS})
             WINE_DETACHED("${RUN_RESULT_VAR}" "${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}" "${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}" "${WINE_WINE_PROGRAM}" ${CMD})
-        ELSEIF(ANDROID)
+        elseif(ANDROID)
             DCMTK_ANDROID_WAIT_FOR_EMULATOR(DCMTK_ANDROID_EMULATOR_INSTANCE)
-            IF(NOT DCMTK_TRY_RUN_ANDROID_RUNTIME_INSTALLED)
+            if(NOT DCMTK_TRY_RUN_ANDROID_RUNTIME_INSTALLED)
                 DCMTK_ANDROID_FIND_RUNTIME_LIBRARIES(ANDROID_RUNTIME_LIBRARIES)
-                SET(ANDROID_RUNTIME_LIBRARIES ${ANDROID_RUNTIME_LIBRARIES} CACHE INTERNAL "")
+                set(ANDROID_RUNTIME_LIBRARIES ${ANDROID_RUNTIME_LIBRARIES} CACHE INTERNAL "")
                 DCMTK_ANDROID_PUSH(DCMTK_ANDROID_EMULATOR_INSTANCE ${ANDROID_RUNTIME_LIBRARIES} DESTINATION "${ANDROID_TEMPORARY_FILES_LOCATION}")
-                SET(DCMTK_TRY_RUN_ANDROID_RUNTIME_INSTALLED TRUE CACHE INTERNAL "")
-            ENDIF()
+                set(DCMTK_TRY_RUN_ANDROID_RUNTIME_INSTALLED TRUE CACHE INTERNAL "")
+            endif()
             DCMTK_ANDROID_PUSH(DCMTK_ANDROID_EMULATOR_INSTANCE "${OUTPUT_EXECUTABLE}" DESTINATION "${ANDROID_TEMPORARY_FILES_LOCATION}/${OUTPUT_EXECUTABLE_NAME}")
             DCMTK_ANDROID_SHELL(DCMTK_ANDROID_EMULATOR_INSTANCE
                 COMMAND chmod 755 "${ANDROID_TEMPORARY_FILES_LOCATION}/${OUTPUT_EXECUTABLE_NAME}"
@@ -71,22 +74,22 @@ FUNCTION(DCMTK_TRY_RUN_CROSS RUN_RESULT_VAR COMPILE_RESULT_VAR bindir srcfile)
                 OUTPUT_VARIABLE "${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}"
                 ERROR_VARIABLE "${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}"
             )
-        ELSE()
-            MESSAGE(WARNING "Emulation for your target platform is not available, please fill in the required configure test results manually.")
-            TRY_RUN("${RUN_RESULT_VAR}" "${COMPILE_RESULT_VAR}" "${bindir}" "${srcfile}" ${ARGN})
-            RETURN()
-        ENDIF()
-        SET("${RUN_RESULT_VAR}" ${${RUN_RESULT_VAR}} PARENT_SCOPE)
-        SET("${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}" ${${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}} PARENT_SCOPE)
-    ENDIF()
-ENDFUNCTION(DCMTK_TRY_RUN_CROSS)
+        else()
+            message(WARNING "Emulation for your target platform is not available, please fill in the required configure test results manually.")
+            try_run("${RUN_RESULT_VAR}" "${COMPILE_RESULT_VAR}" "${bindir}" "${srcfile}" ${ARGN})
+            return()
+        endif()
+        set("${RUN_RESULT_VAR}" ${${RUN_RESULT_VAR}} PARENT_SCOPE)
+        set("${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}" ${${DCMTK_TRY_RUN_RUN_OUTPUT_VARIABLE}} PARENT_SCOPE)
+    endif()
+endfunction()
 
-MACRO(DCMTK_TRY_RUN)
-    IF(CMAKE_CROSSCOMPILING)
+macro(DCMTK_TRY_RUN)
+    if(CMAKE_CROSSCOMPILING)
         DCMTK_TRY_RUN_CROSS(${ARGN})
-    ELSE(CMAKE_CROSSCOMPILING)
-        TRY_RUN(${ARGN})
-    ENDIF(CMAKE_CROSSCOMPILING)
-ENDMACRO(DCMTK_TRY_RUN)
+    else()
+        try_run(${ARGN})
+    endif()
+endmacro()
 
-ENDIF(CMAKE_VERSION VERSION_LESS 2.8.3)
+endif()
index 57fab9b1a1f524b9170b35b56b8b524a6fd5d780..dec15b94df13e50bdeeb6ac9c3e8af1922ffed7e 100644 (file)
@@ -35,7 +35,7 @@
 #    tools of the NDK (e. g. 'adb') by referring to the
 #    instance with the value of EMULATOR_NAME.
 
-INCLUDE(CMakeParseArguments)
+include(CMakeParseArguments)
 
 #
 # 'Unpacks' an Android emulator instance handle object to
@@ -50,18 +50,18 @@ INCLUDE(CMakeParseArguments)
 # is not a valid emulator instance handle.
 # All additional arguments will be ignored.
 #
-MACRO(DCMTK_ANDROID_GET_OBJECT_PROPERTIES VAR)
-    LIST(LENGTH ${VAR} ${VAR}_LENGTH)
-    IF(${VAR}_LENGTH EQUAL 3)
-        LIST(GET ${VAR} 0 EMULATOR_STATE)
-        LIST(GET ${VAR} 1 EMULATOR_UUID)
-        LIST(GET ${VAR} 2 EMULATOR_NAME)
-    ELSE()
-        UNSET(EMULATOR_STATE)
-        UNSET(EMULATOR_UUID)
-        UNSET(EMULATOR_NAME)
-    ENDIF()
-ENDMACRO(DCMTK_ANDROID_GET_OBJECT_PROPERTIES)
+macro(DCMTK_ANDROID_GET_OBJECT_PROPERTIES VAR)
+    list(LENGTH ${VAR} ${VAR}_LENGTH)
+    if(${VAR}_LENGTH EQUAL 3)
+        list(GET ${VAR} 0 EMULATOR_STATE)
+        list(GET ${VAR} 1 EMULATOR_UUID)
+        list(GET ${VAR} 2 EMULATOR_NAME)
+    else()
+        unset(EMULATOR_STATE)
+        unset(EMULATOR_UUID)
+        unset(EMULATOR_NAME)
+    endif()
+endmacro()
 
 #
 # Stores the properties of an emulator instance inside an
@@ -73,9 +73,9 @@ ENDMACRO(DCMTK_ANDROID_GET_OBJECT_PROPERTIES)
 # EMULATOR_NAME  - the name to set
 # All additional arguments will be ignored.
 #
-MACRO(DCMTK_ANDROID_SET_OBJECT_PROPERTIES VAR EMULATOR_STATE EMULATOR_UUID EMULATOR_NAME)
-    SET(${VAR} "${EMULATOR_STATE}" "${EMULATOR_UUID}" "${EMULATOR_NAME}" CACHE INTERNAL "")
-ENDMACRO(DCMTK_ANDROID_SET_OBJECT_PROPERTIES)
+macro(DCMTK_ANDROID_SET_OBJECT_PROPERTIES VAR EMULATOR_STATE EMULATOR_UUID EMULATOR_NAME)
+    set(${VAR} "${EMULATOR_STATE}" "${EMULATOR_UUID}" "${EMULATOR_NAME}" CACHE INTERNAL "")
+endmacro()
 
 #
 # Destroys an instance handle object.
@@ -83,9 +83,9 @@ ENDMACRO(DCMTK_ANDROID_SET_OBJECT_PROPERTIES)
 #       shall be object destroyed
 # All additional arguments will be ignored.
 #
-MACRO(DCMTK_ANDROID_DESTROY_OBJECT VAR)
-    UNSET("${VAR}" CACHE)
-ENDMACRO(DCMTK_ANDROID_DESTROY_OBJECT)
+macro(DCMTK_ANDROID_DESTROY_OBJECT VAR)
+    unset("${VAR}" CACHE)
+endmacro()
 
 #
 # Tries to detect any required shared objects within the NDK
@@ -95,21 +95,21 @@ ENDMACRO(DCMTK_ANDROID_DESTROY_OBJECT)
 # required (e. g. when they are linked statically).
 # All additional arguments will be ignored.
 #
-FUNCTION(DCMTK_ANDROID_FIND_RUNTIME_LIBRARIES VAR)
-    SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
-    FOREACH(DIR ${ANDROID_STL_INCLUDE_DIRS})
-        IF(CMAKE_VERSION VERSION_LESS 2.8.11)
-            GET_FILENAME_COMPONENT(DIR "${DIR}" PATH)
-        ELSE()
-            GET_FILENAME_COMPONENT(DIR "${DIR}" DIRECTORY)
-        ENDIF()
-        LIST(APPEND ANDROID_STL_LIBRARY_DIRS "${DIR}")
-    ENDFOREACH()
-    FIND_LIBRARY(ANDROID_STL_SHARED_OBJECT ${ANDROID_STL} PATHS ${ANDROID_STL_LIBRARY_DIRS} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-    IF(ANDROID_STL_SHARED_OBJECT)
-        SET("${VAR}" ${ANDROID_STL_SHARED_OBJECT} PARENT_SCOPE)
-    ENDIF()
-ENDFUNCTION(DCMTK_ANDROID_FIND_RUNTIME_LIBRARIES)
+function(DCMTK_ANDROID_FIND_RUNTIME_LIBRARIES VAR)
+    set(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
+    foreach(DIR ${ANDROID_STL_INCLUDE_DIRS})
+        if(CMAKE_VERSION VERSION_LESS 2.8.11)
+            get_filename_component(DIR "${DIR}" PATH)
+        else()
+            get_filename_component(DIR "${DIR}" DIRECTORY)
+        endif()
+        list(APPEND ANDROID_STL_LIBRARY_DIRS "${DIR}")
+    endforeach()
+    find_library(ANDROID_STL_SHARED_OBJECT ${ANDROID_STL} PATHS ${ANDROID_STL_LIBRARY_DIRS} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+    if(ANDROID_STL_SHARED_OBJECT)
+        set("${VAR}" ${ANDROID_STL_SHARED_OBJECT} PARENT_SCOPE)
+    endif()
+endfunction()
 
 #
 # Tries to detect the required executables and scripts automatically,
@@ -119,38 +119,38 @@ ENDFUNCTION(DCMTK_ANDROID_FIND_RUNTIME_LIBRARIES)
 # successful.
 # All arguments will be ignored.
 #
-FUNCTION(DCMTK_SETUP_ANDROID_EMULATOR)
-    IF(NOT ANDROID_TEMPORARY_FILES_LOCATION)
-        SET(ANDROID_TEMPORARY_FILES_LOCATION "/cache" CACHE STRING "The path on the Android device that should be used for temporary files")
-    ENDIF()
-    IF(NOT ANDROID_SDK_ROOT)
-        IF(CMAKE_HOST_SYSTEM MATCHES "Windows.*")
-            FILE(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_SDK_SEARCH_PATHS)
-            SET(ANDROID_SDK_ROOT "${ANDROID_SDK_SEARCH_PATHS}/android-sdk" CACHE PATH "Location of the Android SDK")
-        ELSE()
-            SET(ANDROID_SDK_ROOT "/opt/android-sdk" CACHE PATH "Location of the Android SDK")
-        ENDIF()
-    ENDIF()
-    FIND_PROGRAM(ANDROID_EMULATOR_PROGRAM emulator PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-    IF(CMAKE_HOST_SYSTEM MATCHES "Windows.*")
-        FIND_PROGRAM(ANDROID_ANDROID_PROGRAM android.bat PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-    ELSE()
-        FIND_PROGRAM(ANDROID_ANDROID_PROGRAM android PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-    ENDIF()
-    FIND_PROGRAM(ANDROID_ADB_PROGRAM adb PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES platform-tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-    IF(NOT ANDROID_EMULATOR_PROGRAM OR NOT ANDROID_ANDROID_PROGRAM OR NOT ANDROID_ADB_PROGRAM)
-        MESSAGE(FATAL_ERROR
+function(DCMTK_SETUP_ANDROID_EMULATOR)
+    if(NOT ANDROID_TEMPORARY_FILES_LOCATION)
+        set(ANDROID_TEMPORARY_FILES_LOCATION "/cache" CACHE STRING "The path on the Android device that should be used for temporary files")
+    endif()
+    if(NOT ANDROID_SDK_ROOT)
+        if(CMAKE_HOST_SYSTEM MATCHES "Windows.*")
+            file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_SDK_SEARCH_PATHS)
+            set(ANDROID_SDK_ROOT "${ANDROID_SDK_SEARCH_PATHS}/android-sdk" CACHE PATH "Location of the Android SDK")
+        else()
+            set(ANDROID_SDK_ROOT "/opt/android-sdk" CACHE PATH "Location of the Android SDK")
+        endif()
+    endif()
+    find_program(ANDROID_EMULATOR_PROGRAM emulator PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+    if(CMAKE_HOST_SYSTEM MATCHES "Windows.*")
+        find_program(ANDROID_ANDROID_PROGRAM android.bat PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+    else()
+        find_program(ANDROID_ANDROID_PROGRAM android PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+    endif()
+    find_program(ANDROID_ADB_PROGRAM adb PATHS ${ANDROID_SDK_ROOT} PATH_SUFFIXES platform-tools NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+    if(NOT ANDROID_EMULATOR_PROGRAM OR NOT ANDROID_ANDROID_PROGRAM OR NOT ANDROID_ADB_PROGRAM)
+        message(FATAL_ERROR
             "Failed to detect the Android SDK, please set ANDROID_SDK_ROOT to the location of your Android SDK"
             "or set the missing tools manually!"
         )
-    ELSE()
-        EXECUTE_PROCESS(COMMAND "${ANDROID_ANDROID_PROGRAM}" list avd RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_QUIET)
-        STRING(REGEX MATCHALL "Name:[ \t]*[^\r\n]*" ANDROID_AVAILABLE_AVDS ${OUTPUT})
-        STRING(REGEX REPLACE "Name:[ \t]*([^\r\n;]*)" "\\1" ANDROID_AVAILABLE_AVDS "${ANDROID_AVAILABLE_AVDS}")
-        SET(ANDROID_EMULATOR_AVD "${ANDROID_EMULATOR_AVD}" CACHE STRING "Android emulator Android Virtual Device (AVD) configuration" FORCE)
-        SET_PROPERTY(CACHE ANDROID_EMULATOR_AVD PROPERTY STRINGS ${ANDROID_AVAILABLE_AVDS})
-    ENDIF()
-ENDFUNCTION(DCMTK_SETUP_ANDROID_EMULATOR)
+    else()
+        execute_process(COMMAND "${ANDROID_ANDROID_PROGRAM}" list avd RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_QUIET)
+        string(REGEX MATCHALL "Name:[ \t]*[^\r\n]*" ANDROID_AVAILABLE_AVDS ${OUTPUT})
+        string(REGEX REPLACE "Name:[ \t]*([^\r\n;]*)" "\\1" ANDROID_AVAILABLE_AVDS "${ANDROID_AVAILABLE_AVDS}")
+        set(ANDROID_EMULATOR_AVD "${ANDROID_EMULATOR_AVD}" CACHE STRING "Android emulator Android Virtual Device (AVD) configuration" FORCE)
+        set_property(CACHE ANDROID_EMULATOR_AVD PROPERTY STRINGS ${ANDROID_AVAILABLE_AVDS})
+    endif()
+endfunction()
 
 #
 # Enumerates all currently available Android devices
@@ -165,33 +165,33 @@ ENDFUNCTION(DCMTK_SETUP_ANDROID_EMULATOR)
 #           instructions)
 # Will ignore all additional arguments.
 #
-FUNCTION(DCMTK_ANDROID_LIST_EMULATORS ONLINE OFFLINE)
+function(DCMTK_ANDROID_LIST_EMULATORS ONLINE OFFLINE)
     DCMTK_SETUP_ANDROID_EMULATOR()
-    IF(ANDROID_ADB_PROGRAM)
-        EXECUTE_PROCESS(
+    if(ANDROID_ADB_PROGRAM)
+        execute_process(
             COMMAND "${ANDROID_ADB_PROGRAM}" devices
             RESULT_VARIABLE RESULT
             OUTPUT_VARIABLE DEVICES_RAW
             ERROR_QUIET
         )
-        STRING(REPLACE "\n" ";" DEVICES "${DEVICES_RAW}")
-        FOREACH(DEVICE ${DEVICES})
-            STRING(REGEX REPLACE "(.+)\t(.+)" "\\1;\\2" DS "${DEVICE}")
-            LIST(LENGTH DS DSL)
-            IF(DSL EQUAL 2)
-                LIST(GET DS 0 EMULATOR_NAME)
-                LIST(GET DS 1 EMULATOR_STATE)
-                IF(EMULATOR_STATE MATCHES "^device$")
-                    LIST(APPEND "${ONLINE}" ${EMULATOR_NAME})
-                ELSE()
-                    LIST(APPEND "${OFFLINE}" ${EMULATOR_NAME})
-                ENDIF()
-            ENDIF()
-        ENDFOREACH()
-    ENDIF()
-    SET("${ONLINE}" ${${ONLINE}} PARENT_SCOPE)
-    SET("${OFFLINE}" ${${OFFLINE}} PARENT_SCOPE)
-ENDFUNCTION(DCMTK_ANDROID_LIST_EMULATORS)
+        string(REPLACE "\n" ";" DEVICES "${DEVICES_RAW}")
+        foreach(DEVICE ${DEVICES})
+            string(REGEX REPLACE "(.+)\t(.+)" "\\1;\\2" DS "${DEVICE}")
+            list(LENGTH DS DSL)
+            if(DSL EQUAL 2)
+                list(GET DS 0 EMULATOR_NAME)
+                list(GET DS 1 EMULATOR_STATE)
+                if(EMULATOR_STATE MATCHES "^device$")
+                    list(APPEND "${ONLINE}" ${EMULATOR_NAME})
+                else()
+                    list(APPEND "${OFFLINE}" ${EMULATOR_NAME})
+                endif()
+            endif()
+        endforeach()
+    endif()
+    set("${ONLINE}" ${${ONLINE}} PARENT_SCOPE)
+    set("${OFFLINE}" ${${OFFLINE}} PARENT_SCOPE)
+endfunction()
 
 #
 # Generate a random ID that is hopefully unique
@@ -200,19 +200,19 @@ ENDFUNCTION(DCMTK_ANDROID_LIST_EMULATORS)
 #       the generated UUID as a string value
 # Will ignore all additional arguments.
 #
-IF(CMAKE_VERSION VERSION_LESS 2.8.11)
-MACRO(DCMTK_ANDROID_EMULATOR_GENERATE_UUID VAR)
-    STRING(RANDOM LENGTH 20 ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ${VAR})
-ENDMACRO(DCMTK_ANDROID_EMULATOR_GENERATE_UUID)
-ELSE(CMAKE_VERSION VERSION_LESS 2.8.11)
-FUNCTION(DCMTK_ANDROID_EMULATOR_GENERATE_UUID VAR)
-    STRING(RANDOM LENGTH 20 RAND)
-    STRING(TIMESTAMP TM)
-    SET(${VAR} "${TM}${RAND}")
-    STRING(MD5 ${VAR} ${${VAR}})
-    SET(${VAR} ${${VAR}} PARENT_SCOPE)
-ENDFUNCTION(DCMTK_ANDROID_EMULATOR_GENERATE_UUID)
-ENDIF(CMAKE_VERSION VERSION_LESS 2.8.11)
+if(CMAKE_VERSION VERSION_LESS 2.8.11)
+macro(DCMTK_ANDROID_EMULATOR_GENERATE_UUID VAR)
+    string(RANDOM LENGTH 20 ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ${VAR})
+endmacro()
+else()
+function(DCMTK_ANDROID_EMULATOR_GENERATE_UUID VAR)
+    string(RANDOM LENGTH 20 RAND)
+    string(TIMESTAMP TM)
+    set(${VAR} "${TM}${RAND}")
+    string(MD5 ${VAR} ${${VAR}})
+    set(${VAR} ${${VAR}} PARENT_SCOPE)
+endfunction()
+endif()
 
 #
 # Tries to query the UUID property of an accessible Android device.
@@ -222,21 +222,21 @@ ENDIF(CMAKE_VERSION VERSION_LESS 2.8.11)
 # is accessible or the device is offline.
 # Will ignore all additional arguments.
 #
-FUNCTION(DCMTK_ANDROID_GET_EMULATOR_UUID EMULATOR_NAME VAR)
-    EXECUTE_PROCESS(
+function(DCMTK_ANDROID_GET_EMULATOR_UUID EMULATOR_NAME VAR)
+    execute_process(
         COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" shell getprop "ro.emu.uuid"
         RESULT_VARIABLE RESULT
         OUTPUT_VARIABLE OUTPUT
         ERROR_QUIET
     )
     DCMTK_UNSET_PARENT_SCOPE(${VAR})
-    IF(NOT RESULT)
-        STRING(STRIP "${OUTPUT}" UUID)
-        IF(UUID)
-            SET("${VAR}" ${UUID} PARENT_SCOPE)
-        ENDIF()
-    ENDIF()
-ENDFUNCTION(DCMTK_ANDROID_GET_EMULATOR_UUID)
+    if(NOT RESULT)
+        string(STRIP "${OUTPUT}" UUID)
+        if(UUID)
+            set("${VAR}" ${UUID} PARENT_SCOPE)
+        endif()
+    endif()
+endfunction()
 
 #
 # Retrieves the name of the emulator instance referred to by
@@ -249,40 +249,40 @@ ENDFUNCTION(DCMTK_ANDROID_GET_EMULATOR_UUID)
 # one has been found.
 # Will ignore all additional arguments.
 #
-FUNCTION(DCMTK_ANDROID_GET_EMULATOR_NAME VAR EMULATOR_UUID)
+function(DCMTK_ANDROID_GET_EMULATOR_NAME VAR EMULATOR_UUID)
     DCMTK_ANDROID_LIST_EMULATORS(ONLINE_EMULATORS OFFLINE_EMULATORS)
-    FOREACH(EMULATOR ${ONLINE_EMULATORS})
+    foreach(EMULATOR ${ONLINE_EMULATORS})
         DCMTK_ANDROID_GET_EMULATOR_UUID("${EMULATOR}" UUID)
-        IF(EMULATOR_UUID STREQUAL UUID)
-            SET("${VAR}" "${EMULATOR}" PARENT_SCOPE)
-            RETURN()
-        ENDIF()
-    ENDFOREACH()
-    WHILE(OFFLINE_EMULATORS)
-        LIST(GET OFFLINE_EMULATORS 0 EMULATOR)
-        LIST(REMOVE_AT OFFLINE_EMULATORS 0)
-        EXECUTE_PROCESS(
+        if(EMULATOR_UUID STREQUAL UUID)
+            set("${VAR}" "${EMULATOR}" PARENT_SCOPE)
+            return()
+        endif()
+    endforeach()
+    while(OFFLINE_EMULATORS)
+        list(GET OFFLINE_EMULATORS 0 EMULATOR)
+        list(REMOVE_AT OFFLINE_EMULATORS 0)
+        execute_process(
             COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR}" wait-for-device
             TIMEOUT 1
             RESULT_VARIABLE RESULT
             OUTPUT_QUIET
             ERROR_QUIET
         )
-        IF(NOT RESULT)
+        if(NOT RESULT)
             DCMTK_ANDROID_GET_EMULATOR_UUID("${EMULATOR}" UUID)
-            IF(UUID)
-                IF(EMULATOR_UUID STREQUAL UUID)
-                    SET("${VAR}" "${EMULATOR}" PARENT_SCOPE)
-                    RETURN()
-                ENDIF()
-            ELSE()
-                LIST(APPEND OFFLINE_EMULATORS "${EMULATOR}")
-            ENDIF()
-        ELSE()
-            LIST(APPEND OFFLINE_EMULATORS "${EMULATOR}")
-        ENDIF()
-    ENDWHILE()
-ENDFUNCTION()
+            if(UUID)
+                if(EMULATOR_UUID STREQUAL UUID)
+                    set("${VAR}" "${EMULATOR}" PARENT_SCOPE)
+                    return()
+                endif()
+            else()
+                list(APPEND OFFLINE_EMULATORS "${EMULATOR}")
+            endif()
+        else()
+            list(APPEND OFFLINE_EMULATORS "${EMULATOR}")
+        endif()
+    endwhile()
+endfunction()
 
 #
 # Sets up and starts a new emulator instance or reuses an
@@ -295,53 +295,53 @@ ENDFUNCTION()
 # if VAR does not refer to a valid emulator instance.
 # Will ignore all additional arguments.
 #
-FUNCTION(DCMTK_ANDROID_START_EMULATOR VAR)
+function(DCMTK_ANDROID_START_EMULATOR VAR)
     DCMTK_SETUP_ANDROID_EMULATOR()
-    IF(NOT ANDROID_EMULATOR_AVD)
-        MESSAGE(FATAL_ERROR "Please select which Android emulator Android Virtual Device (AVD) configuration to use!")
-    ELSE()
+    if(NOT ANDROID_EMULATOR_AVD)
+        message(FATAL_ERROR "Please select which Android emulator Android Virtual Device (AVD) configuration to use!")
+    else()
         DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}")
-        IF(NOT EMULATOR_STATE)
+        if(NOT EMULATOR_STATE)
             DCMTK_ANDROID_EMULATOR_GENERATE_UUID(EMULATOR_UUID)
-        ELSEIF(EMULATOR_STATE STREQUAL "RUNNING")
+        elseif(EMULATOR_STATE STREQUAL "RUNNING")
             DCMTK_ANDROID_GET_EMULATOR_UUID("${EMULATOR_NAME}" UUID)
             # Do nothing if the running emulator instance is ok and can be reused.
             # Otherwise restart it.
-            IF(UUID STREQUAL EMULATOR_UUID)
-                MESSAGE(STATUS "Reusing already running Android device emulator...")
-                RETURN()
-            ENDIF()
-        ELSEIF(EMULATOR_STATE STREQUAL "STARTING")
+            if(UUID STREQUAL EMULATOR_UUID)
+                message(STATUS "Reusing already running Android device emulator...")
+                return()
+            endif()
+        elseif(EMULATOR_STATE STREQUAL "STARTING")
             # Is it really starting, or has somebody aborted it?
-            MESSAGE(STATUS "Found previously started Android device emulator, checking if it's still present...")
+            message(STATUS "Found previously started Android device emulator, checking if it's still present...")
             DCMTK_ANDROID_GET_EMULATOR_NAME(EMULATOR_NAME "${EMULATOR_UUID}")
-            IF(EMULATOR_NAME)
-              MESSAGE(STATUS "Found previously started Android device emulator, checking if it's still present... yes")
+            if(EMULATOR_NAME)
+              message(STATUS "Found previously started Android device emulator, checking if it's still present... yes")
               DCMTK_ANDROID_SET_OBJECT_PROPERTIES(${VAR} RUNNING "${EMULATOR_UUID}" "${EMULATOR_NAME}")
-              RETURN()
-            ENDIF()
-            MESSAGE(STATUS "Found previously started Android device emulator, checking if it's still present... no")
-        ENDIF()
-        MESSAGE(STATUS "Starting the Android device emulator...")
-        IF(CMAKE_HOST_SYSTEM MATCHES "Windows.*")
-            SET(COMMAND sh -c "${ANDROID_EMULATOR_PROGRAM} -avd ${ANDROID_EMULATOR_AVD} -no-boot-anim -prop ro.emu.uuid=${EMULATOR_UUID} >${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/android-emulator.log 2>&1 < /dev/null &")
-        ELSE()
-            SET(COMMAND sh -c "${ANDROID_EMULATOR_PROGRAM} -avd ${ANDROID_EMULATOR_AVD} -no-window -no-boot-anim -prop ro.emu.uuid=${EMULATOR_UUID} >${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/android-emulator.log 2>&1 < /dev/null &")
-        ENDIF()
-        EXECUTE_PROCESS(
+              return()
+            endif()
+            message(STATUS "Found previously started Android device emulator, checking if it's still present... no")
+        endif()
+        message(STATUS "Starting the Android device emulator...")
+        if(CMAKE_HOST_SYSTEM MATCHES "Windows.*")
+            set(COMMAND sh -c "${ANDROID_EMULATOR_PROGRAM} -avd ${ANDROID_EMULATOR_AVD} -no-boot-anim -prop ro.emu.uuid=${EMULATOR_UUID} >${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/android-emulator.log 2>&1 < /dev/null &")
+        else()
+            set(COMMAND sh -c "${ANDROID_EMULATOR_PROGRAM} -avd ${ANDROID_EMULATOR_AVD} -no-window -no-boot-anim -prop ro.emu.uuid=${EMULATOR_UUID} >${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/android-emulator.log 2>&1 < /dev/null &")
+        endif()
+        execute_process(
             COMMAND ${COMMAND}
             RESULT_VARIABLE RESULT
             OUTPUT_QUIET
             ERROR_QUIET
         )
-        IF(NOT RESULT)
+        if(NOT RESULT)
             DCMTK_ANDROID_SET_OBJECT_PROPERTIES("${VAR}" STARTING "${EMULATOR_UUID}" "")
-        ELSE()
+        else()
             DCMTK_ANDROID_DESTROY_OBJECT("${VAR}")
-            MESSAGE(FATAL_ERROR "Error starting Android emulator.")
-        ENDIF()
-    ENDIF()
-ENDFUNCTION(DCMTK_ANDROID_START_EMULATOR)
+            message(FATAL_ERROR "Error starting Android emulator.")
+        endif()
+    endif()
+endfunction()
 
 #
 # Restart adb/the emulated device in root mode so that we gain write access to
@@ -351,8 +351,8 @@ ENDFUNCTION(DCMTK_ANDROID_START_EMULATOR)
 # EMULATOR_NAME - the name of the emulated device that shall be rooted.
 # Will ignore all additional arguments.
 #
-FUNCTION(DCMTK_ANDROID_ADB_ROOT EMULATOR_NAME)
-    EXECUTE_PROCESS(
+function(DCMTK_ANDROID_ADB_ROOT EMULATOR_NAME)
+    execute_process(
         COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" root
         OUTPUT_QUIET
         ERROR_QUIET
@@ -360,16 +360,16 @@ FUNCTION(DCMTK_ANDROID_ADB_ROOT EMULATOR_NAME)
     # the SDK was seemingly designed by a five year old, the device will
     # become invisible while it is being rooted, therefore, wait until
     # it is ready again
-    SET(STATUS 1)
-    WHILE(STATUS)
-        EXECUTE_PROCESS(
+    set(STATUS 1)
+    while(STATUS)
+        execute_process(
             COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" wait-for-device
             RESULT_VARIABLE STATUS
             OUTPUT_QUIET
             ERROR_QUIET
         )
-    ENDWHILE()
-ENDFUNCTION(DCMTK_ANDROID_ADB_ROOT)
+    endwhile()
+endfunction()
 
 #
 # Waits until the given emulator instance becomes online (RUNNING).
@@ -382,23 +382,23 @@ ENDFUNCTION(DCMTK_ANDROID_ADB_ROOT)
 # not become online.
 # Will ignore all additional arguments.
 #
-FUNCTION(DCMTK_ANDROID_WAIT_FOR_EMULATOR VAR)
+function(DCMTK_ANDROID_WAIT_FOR_EMULATOR VAR)
     DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}")
-    IF(NOT EMULATOR_STATE)
-        MESSAGE(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.")
-    ELSEIF(EMULATOR_STATE STREQUAL "RUNNING")
+    if(NOT EMULATOR_STATE)
+        message(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.")
+    elseif(EMULATOR_STATE STREQUAL "RUNNING")
         # Emulator is running, no need to wait!
-    ELSEIF(EMULATOR_STATE STREQUAL "STOPPED")
-        MESSAGE(WARNING "The Android emulator has stopped, aborting...")
-    ELSE()
-        MESSAGE(STATUS "Waiting until the Android device emulator is ready to receive instructions...")
-        WHILE(NOT EMULATOR_NAME)
+    elseif(EMULATOR_STATE STREQUAL "STOPPED")
+        message(WARNING "The Android emulator has stopped, aborting...")
+    else()
+        message(STATUS "Waiting until the Android device emulator is ready to receive instructions...")
+        while(NOT EMULATOR_NAME)
             DCMTK_ANDROID_GET_EMULATOR_NAME(EMULATOR_NAME "${EMULATOR_UUID}")
-        ENDWHILE()
+        endwhile()
         DCMTK_ANDROID_ADB_ROOT("${EMULATOR_NAME}")
         DCMTK_ANDROID_SET_OBJECT_PROPERTIES("${VAR}" RUNNING "${EMULATOR_UUID}" "${EMULATOR_NAME}")
-    ENDIF()
-ENDFUNCTION(DCMTK_ANDROID_WAIT_FOR_EMULATOR)
+    endif()
+endfunction()
 
 #
 # Prepare a command that will shutdown the given Android emulator when
@@ -411,13 +411,13 @@ ENDFUNCTION(DCMTK_ANDROID_WAIT_FOR_EMULATOR)
 # be generated for the current host platform (Windows).
 # Will ignore all additional arguments.
 #
-MACRO(DCMTK_ANDROID_STOP_EMULATOR_COMMAND VAR EMULATOR_NAME)
-    IF(CMAKE_HOST_SYSTEM MATCHES "Windows.*")
-        UNSET("${VAR}")
-    ELSE()
-        SET("${VAR}" "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" emu kill)
-    ENDIF()
-ENDMACRO(DCMTK_ANDROID_STOP_EMULATOR_COMMAND)
+macro(DCMTK_ANDROID_STOP_EMULATOR_COMMAND VAR EMULATOR_NAME)
+    if(CMAKE_HOST_SYSTEM MATCHES "Windows.*")
+        unset("${VAR}")
+    else()
+        set("${VAR}" "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" emu kill)
+    endif()
+endmacro()
 
 #
 # Prepare an emulator shutdown message or a warning message if automated
@@ -425,13 +425,13 @@ ENDMACRO(DCMTK_ANDROID_STOP_EMULATOR_COMMAND)
 # VAR - the name of the variable that will be set to the generated message
 # Will ignore all additional arguments.
 #
-MACRO(DCMTK_ANDROID_EMULATOR_SHUTDOWN_MESSAGE VAR)
-    IF(CMAKE_HOST_SYSTEM MATCHES "Windows.*")
-        SET("${VAR}" WARNING "The Android device emulator can't be terminated automatically under Windows, please shutdown \"${EMULATOR_NAME}\" manually!")
-    ELSE()
-        SET("${VAR}" STATUS "Shutting down the Android device emulator...")
-    ENDIF()
-ENDMACRO(DCMTK_ANDROID_EMULATOR_SHUTDOWN_MESSAGE)
+macro(DCMTK_ANDROID_EMULATOR_SHUTDOWN_MESSAGE VAR)
+    if(CMAKE_HOST_SYSTEM MATCHES "Windows.*")
+        set("${VAR}" WARNING "The Android device emulator can't be terminated automatically under Windows, please shutdown \"${EMULATOR_NAME}\" manually!")
+    else()
+        set("${VAR}" STATUS "Shutting down the Android device emulator...")
+    endif()
+endmacro()
 
 #
 # Stops the emulator and sets its state to STOPPED when successful.
@@ -441,34 +441,34 @@ ENDMACRO(DCMTK_ANDROID_EMULATOR_SHUTDOWN_MESSAGE)
 # won't modify its state in that case.
 # Will ignore all additional arguments.
 #
-FUNCTION(DCMTK_ANDROID_STOP_EMULATOR VAR)
+function(DCMTK_ANDROID_STOP_EMULATOR VAR)
     DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}")
-    IF(NOT EMULATOR_STATE)
-        MESSAGE(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.")
-    ELSEIF(EMULATOR_STATE STREQUAL "STARTING")
+    if(NOT EMULATOR_STATE)
+        message(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.")
+    elseif(EMULATOR_STATE STREQUAL "STARTING")
         # Can't tell it to stop if it is not done starting
         DCMTK_ANDROID_WAIT_FOR_EMULATOR("${VAR}")
-    ELSEIF(EMULATOR_STATE STREQUAL "STOPPED")
+    elseif(EMULATOR_STATE STREQUAL "STOPPED")
         # Emulator is already stopped, do nothing
-        RETURN()
-    ENDIF()
+        return()
+    endif()
     DCMTK_ANDROID_EMULATOR_SHUTDOWN_MESSAGE(MESSAGE)
-    MESSAGE(${MESSAGE})
-    IF(NOT CMAKE_HOST_SYSTEM MATCHES "Windows.*")
+    message(${MESSAGE})
+    if(NOT CMAKE_HOST_SYSTEM MATCHES "Windows.*")
         DCMTK_ANDROID_STOP_EMULATOR_COMMAND(COMMAND "${EMULATOR_NAME}")
-        EXECUTE_PROCESS(
+        execute_process(
           COMMAND ${COMMAND}
           RESULT_VARIABLE RESULT
           OUTPUT_QUIET
           ERROR_QUIET
         )
-        IF(NOT RESULT)
+        if(NOT RESULT)
             DCMTK_ANDROID_SET_OBJECT_PROPERTIES("${VAR}" STOPPED "${EMULATOR_UUID}" "")
-        ELSE()
-            MESSAGE(WARNING "Unable to stop the android device emulator, please shutdown \"${EMULATOR_NAME}\" manually!")
-        ENDIF()
-    ENDIF()
-ENDFUNCTION(DCMTK_ANDROID_STOP_EMULATOR)
+        else()
+            message(WARNING "Unable to stop the android device emulator, please shutdown \"${EMULATOR_NAME}\" manually!")
+        endif()
+    endif()
+endfunction()
 
 #
 # Uploads local files to the given Android device using 'adb push'.
@@ -476,26 +476,26 @@ ENDFUNCTION(DCMTK_ANDROID_STOP_EMULATOR)
 #       device
 # Requires the device to be running.
 # Additional arguments will be parsed and interpreted similar to
-# CMake's FILE(COPY ...) command.
+# CMake's file(COPY ...) command.
 #
-FUNCTION(DCMTK_ANDROID_PUSH VAR)
+function(DCMTK_ANDROID_PUSH VAR)
     DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}")
-    IF(NOT EMULATOR_STATE)
-        MESSAGE(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.")
-    ELSEIF(EMULATOR_STATE STREQUAL "RUNNING")
-        CMAKE_PARSE_ARGUMENTS(DCMTK_ANDROID_PUSH "" "" "DESTINATION" ${ARGN})
-        FOREACH(LOCAL_FILE ${DCMTK_ANDROID_PUSH_UNPARSED_ARGUMENTS})
-            EXECUTE_PROCESS(
+    if(NOT EMULATOR_STATE)
+        message(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.")
+    elseif(EMULATOR_STATE STREQUAL "RUNNING")
+        cmake_parse_arguments(DCMTK_ANDROID_PUSH "" "" "DESTINATION" ${ARGN})
+        foreach(LOCAL_FILE ${DCMTK_ANDROID_PUSH_UNPARSED_ARGUMENTS})
+            execute_process(
                 COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" push "${LOCAL_FILE}" "${DCMTK_ANDROID_PUSH_DESTINATION}"
                 RESULT_VARIABLE RESULT
                 OUTPUT_QUIET
                 ERROR_QUIET
             )
-        ENDFOREACH()
-    ELSE()
-        MESSAGE(AUTHOR_WARNING "Error: the Android emulator \"${VAR}\" is not ready to receive commands")
-    ENDIF()
-ENDFUNCTION(DCMTK_ANDROID_PUSH)
+        endforeach()
+    else()
+        message(AUTHOR_WARNING "Error: the Android emulator \"${VAR}\" is not ready to receive commands")
+    endif()
+endfunction()
 
 #
 # Downloads remote files from the given Android device using 'adb pull'.
@@ -503,26 +503,26 @@ ENDFUNCTION(DCMTK_ANDROID_PUSH)
 #       device
 # Requires the device to be running.
 # Additional arguments will be parsed and interpreted similar to
-# CMake's FILE(COPY ...) command.
+# CMake's file(COPY ...) command.
 #
-FUNCTION(DCMTK_ANDROID_PULL VAR)
+function(DCMTK_ANDROID_PULL VAR)
     DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}")
-    IF(NOT EMULATOR_STATE)
-        MESSAGE(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.")
-    ELSEIF(EMULATOR_STATE STREQUAL "RUNNING")
-        CMAKE_PARSE_ARGUMENTS(DCMTK_ANDROID_PULL "" "" "DESTINATION" ${ARGN})
-        FOREACH(REMOTE_FILE ${DCMTK_ANDROID_PULL_UNPARSED_ARGUMENTS})
-            EXECUTE_PROCESS(
+    if(NOT EMULATOR_STATE)
+        message(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.")
+    elseif(EMULATOR_STATE STREQUAL "RUNNING")
+        cmake_parse_arguments(DCMTK_ANDROID_PULL "" "" "DESTINATION" ${ARGN})
+        foreach(REMOTE_FILE ${DCMTK_ANDROID_PULL_UNPARSED_ARGUMENTS})
+            execute_process(
                 COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" pull "${REMOTE_FILE}" "${DCMTK_ANDROID_PULL_DESTINATION}"
                 RESULT_VARIABLE RESULT
                 OUTPUT_QUIET
                 ERROR_QUIET
             )
-        ENDFOREACH()
-    ELSE()
-        MESSAGE(AUTHOR_WARNING "Error: the Android emulator \"${VAR}\" is not ready to receive commands")
-    ENDIF()
-ENDFUNCTION(DCMTK_ANDROID_PULL)
+        endforeach()
+    else()
+        message(AUTHOR_WARNING "Error: the Android emulator \"${VAR}\" is not ready to receive commands")
+    endif()
+endfunction()
 
 #
 # Executes a shell command on the given Android device using 'adb shell'.
@@ -530,14 +530,14 @@ ENDFUNCTION(DCMTK_ANDROID_PULL)
 #       device
 # Requires the device to be running.
 # Additional arguments will be parsed and interpreted similar to
-# CMake's EXECUTE_PROCESS(...) command.
+# CMake's execute_process(...) command.
 #
-FUNCTION(DCMTK_ANDROID_SHELL VAR)
+function(DCMTK_ANDROID_SHELL VAR)
     DCMTK_ANDROID_GET_OBJECT_PROPERTIES("${VAR}")
-    IF(NOT EMULATOR_STATE)
-        MESSAGE(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.")
-    ELSEIF(EMULATOR_STATE STREQUAL "RUNNING")
-        CMAKE_PARSE_ARGUMENTS(DCMTK_ANDROID_SHELL
+    if(NOT EMULATOR_STATE)
+        message(AUTHOR_WARNING "Error: ${VAR} is not a valid Android emulator instance handle.")
+    elseif(EMULATOR_STATE STREQUAL "RUNNING")
+        cmake_parse_arguments(DCMTK_ANDROID_SHELL
             "OUTPUT_QUIET;ERROR_QUIET"
             "RESULT_VARIABLE;OUTPUT_VARIABLE;ERROR_VARIABLE;WORKING_DIRECTORY"
             "COMMAND"
@@ -545,52 +545,52 @@ FUNCTION(DCMTK_ANDROID_SHELL VAR)
         )
 
         # Prepare commandline
-        SET(COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" shell)
-        IF(DCMTK_ANDROID_SHELL_WORKING_DIRECTORY)
-            LIST(APPEND COMMAND "cd" "${DCMTK_ANDROID_SHELL_WORKING_DIRECTORY}" "&&")
-        ENDIF()
-        LIST(APPEND COMMAND "${DCMTK_ANDROID_SHELL_COMMAND}")
+        set(COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" shell)
+        if(DCMTK_ANDROID_SHELL_WORKING_DIRECTORY)
+            list(APPEND COMMAND "cd" "${DCMTK_ANDROID_SHELL_WORKING_DIRECTORY}" "&&")
+        endif()
+        list(APPEND COMMAND "${DCMTK_ANDROID_SHELL_COMMAND}")
 
         # Inspect output variable parameters
-        IF(DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE)
-            SET(PUSH_OUTPUT_VAR TRUE)
-            IF(DCMTK_ANDROID_SHELL_ERROR_VARIABLE)
-                IF(DCMTK_ANDROID_SHELL_ERROR_VARIABLE STREQUAL DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE)
-                    SET(STREAMS_MERGED TRUE)
-                ELSE()
-                    SET(PUSH_ERROR_VAR TRUE)
-                ENDIF()
-            ELSE()
-                SET(DCMTK_ANDROID_SHELL_ERROR_VARIABLE DCMTK_ANDROID_SHELL_ERROR_MESSAGE_BUFFER)
-            ENDIF()
-        ELSE()
-            SET(DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE DCMTK_ANDROID_SHELL_OUTPUT_MESSAGE_BUFFER)
-            IF(DCMTK_ANDROID_SHELL_ERROR_VARIABLE)
-                SET(PUSH_ERROR_VAR TRUE)
-            ELSE()
-                SET(STREAMS_MERGED TRUE)
-            ENDIF()
-        ENDIF()
+        if(DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE)
+            set(PUSH_OUTPUT_VAR TRUE)
+            if(DCMTK_ANDROID_SHELL_ERROR_VARIABLE)
+                if(DCMTK_ANDROID_SHELL_ERROR_VARIABLE STREQUAL DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE)
+                    set(STREAMS_MERGED TRUE)
+                else()
+                    set(PUSH_ERROR_VAR TRUE)
+                endif()
+            else()
+                set(DCMTK_ANDROID_SHELL_ERROR_VARIABLE DCMTK_ANDROID_SHELL_ERROR_MESSAGE_BUFFER)
+            endif()
+        else()
+            set(DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE DCMTK_ANDROID_SHELL_OUTPUT_MESSAGE_BUFFER)
+            if(DCMTK_ANDROID_SHELL_ERROR_VARIABLE)
+                set(PUSH_ERROR_VAR TRUE)
+            else()
+                set(STREAMS_MERGED TRUE)
+            endif()
+        endif()
 
         # Prefix to prevent collision of output capturing files
-        IF(CMAKE_VERSION VERSION_LESS 2.8.7)
-            STRING(RANDOM LENGTH 20 ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" PREFIX)
-        ELSE()
-            STRING(MD5 PREFIX "${DCMTK_ANDROID_SHELL_COMMAND}")
-        ENDIF()
+        if(CMAKE_VERSION VERSION_LESS 2.8.7)
+            string(RANDOM LENGTH 20 ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" PREFIX)
+        else()
+            string(MD5 PREFIX "${DCMTK_ANDROID_SHELL_COMMAND}")
+        endif()
 
         # Prepare output redirection (buffering)
-        IF(STREAMS_MERGED)
-            LIST(APPEND COMMAND > "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_output" 2>&1)
-        ELSE()
-            LIST(APPEND COMMAND > "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_output" 2> "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_error")
-        ENDIF()
+        if(STREAMS_MERGED)
+            list(APPEND COMMAND > "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_output" 2>&1)
+        else()
+            list(APPEND COMMAND > "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_output" 2> "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_error")
+        endif()
 
         # Prepare capturing the result
-        LIST(APPEND COMMAND "\;" echo -n $? > "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_result")
+        list(APPEND COMMAND "\;" echo -n $? > "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_result")
 
         # Run the command
-        EXECUTE_PROCESS(
+        execute_process(
           COMMAND ${COMMAND}
           RESULT_VARIABLE ADB_RESULT
           OUTPUT_VARIABLE ADB_OUTPUT
@@ -598,50 +598,50 @@ FUNCTION(DCMTK_ANDROID_SHELL VAR)
         )
 
         # Deal with it
-        IF(ADB_RESULT)
-            MESSAGE(WARNING "Error sending command to the Android emulator, adb reported the error: ${ADB_OUTPUT}")
-            IF(DCMTK_ANDROID_SHELL_RESULT_VARIABLE)
-                SET("${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}" ${ADB_RESULT} PARENT_SCOPE)
-            ENDIF()
-        ELSE(ADB_RESULT)
+        if(ADB_RESULT)
+            message(WARNING "Error sending command to the Android emulator, adb reported the error: ${ADB_OUTPUT}")
+            if(DCMTK_ANDROID_SHELL_RESULT_VARIABLE)
+                set("${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}" ${ADB_RESULT} PARENT_SCOPE)
+            endif()
+        else()
             # Receive results
             DCMTK_ANDROID_PULL("${VAR}" "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_output" "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_error" "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_result"
                 DESTINATION "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}"
             )
             # Cleanup temp files
-            EXECUTE_PROCESS(
+            execute_process(
                 COMMAND "${ANDROID_ADB_PROGRAM}" -s "${EMULATOR_NAME}" shell rm "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_output" "\;" rm "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_error" "\;" rm "${ANDROID_TEMPORARY_FILES_LOCATION}/${PREFIX}_result"
                 RESULT_VARIABLE RESULT_QUIET
                 OUTPUT_QUIET
                 ERROR_QUIET
             )
             # Analyze results
-            IF(DCMTK_ANDROID_SHELL_RESULT_VARIABLE)
-                FILE(READ "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_result" "${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}")
-                SET("${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}" ${${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}} PARENT_SCOPE)
-            ENDIF()
-            IF(NOT DCMTK_ANDROID_SHELL_OUTPUT_QUIET OR (STREAMS_MERGED AND NOT DCMTK_ANDROID_SHELL_ERROR_QUIET))
-                FILE(READ "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_output" "${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}")
-                IF(PUSH_OUTPUT_VAR)
-                    SET("${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}" ${${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}} PARENT_SCOPE)
-                ELSE()
-                    MESSAGE("${${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}}")
-                ENDIF()
-            ENDIF()
-            IF(NOT DCMTK_ANDROID_SHELL_ERROR_QUIET AND NOT STREAMS_MERGED)
-                FILE(READ "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_error" "${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}")
-                IF(PUSH_ERROR_VAR)
-                    SET("${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}" ${${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}} PARENT_SCOPE)
-                ELSE()
-                    MESSAGE("${${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}}")
-                ENDIF()
-            ENDIF()
+            if(DCMTK_ANDROID_SHELL_RESULT_VARIABLE)
+                file(READ "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_result" "${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}")
+                set("${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}" ${${DCMTK_ANDROID_SHELL_RESULT_VARIABLE}} PARENT_SCOPE)
+            endif()
+            if(NOT DCMTK_ANDROID_SHELL_OUTPUT_QUIET OR (STREAMS_MERGED AND NOT DCMTK_ANDROID_SHELL_ERROR_QUIET))
+                file(READ "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_output" "${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}")
+                if(PUSH_OUTPUT_VAR)
+                    set("${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}" ${${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}} PARENT_SCOPE)
+                else()
+                    message("${${DCMTK_ANDROID_SHELL_OUTPUT_VARIABLE}}")
+                endif()
+            endif()
+            if(NOT DCMTK_ANDROID_SHELL_ERROR_QUIET AND NOT STREAMS_MERGED)
+                file(READ "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_error" "${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}")
+                if(PUSH_ERROR_VAR)
+                    set("${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}" ${${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}} PARENT_SCOPE)
+                else()
+                    message("${${DCMTK_ANDROID_SHELL_ERROR_VARIABLE}}")
+                endif()
+            endif()
             # Cleanup temp files
-            FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_result")
-            FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_output")
-            FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_error")
-        ENDIF(ADB_RESULT)
-    ELSE()
-        MESSAGE(AUTHOR_WARNING "Error: the Android emulator \"${VAR}\" is not ready to receive commands")
-    ENDIF()
-ENDFUNCTION(DCMTK_ANDROID_SHELL)
+            file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_result")
+            file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_output")
+            file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_error")
+        endif()
+    else()
+        message(AUTHOR_WARNING "Error: the Android emulator \"${VAR}\" is not ready to receive commands")
+    endif()
+endfunction()
index 34336424adce9811578d910d099dee02f5f4b048..5011033c5784f218f0d7aeeb3014370c470b862c 100644 (file)
@@ -8,52 +8,52 @@
 # error that will halt the configuration process if that is not possible.
 # All arguments will be ignored.
 #
-FUNCTION(DCMTK_SETUP_WINE)
-    FIND_PROGRAM(WINE_WINE_PROGRAM wine)
-    FIND_PROGRAM(WINE_WINEPATH_PROGRAM winepath)
-    IF(NOT WINE_CPP_RUNTIME)
-        SET(v 1)
-        UNSET(CMAKE_FIND_LIBRARY_SUFFIXES)
-        WHILE(${v} LESS 14)
-            LIST(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "-${v}.dll")
-            MATH(EXPR v "${v} + 1")
-        ENDWHILE()
-        FIND_LIBRARY(CPP_RUNTIME stdc++ DOC "Location of the C++ runtime library used during target emulation")
-        IF(NOT CPP_RUNTIME)
-            MESSAGE(FATAL_ERROR "Please set the C++ runtime location (required for running applications targeting Windows).")
-        ELSE()
-            GET_FILENAME_COMPONENT(CPP_RUNTIME_LOCATION ${CPP_RUNTIME} PATH)
+function(DCMTK_SETUP_WINE)
+    find_program(WINE_WINE_PROGRAM wine)
+    find_program(WINE_WINEPATH_PROGRAM winepath)
+    if(NOT WINE_CPP_RUNTIME)
+        set(v 1)
+        unset(CMAKE_FIND_LIBRARY_SUFFIXES)
+        while(${v} LESS 14)
+            list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "-${v}.dll")
+            math(EXPR v "${v} + 1")
+        endwhile()
+        find_library(CPP_RUNTIME stdc++ DOC "Location of the C++ runtime library used during target emulation")
+        if(NOT CPP_RUNTIME)
+            message(FATAL_ERROR "Please set the C++ runtime location (required for running applications targeting Windows).")
+        else()
+            get_filename_component(CPP_RUNTIME_LOCATION ${CPP_RUNTIME} PATH)
             UNIX_TO_WINE_PATH(RT ${CPP_RUNTIME_LOCATION})
-            SET(WINE_CPP_RUNTIME ${RT} CACHE INTERNAL "C++ RT in Wine path format")
-        ENDIF()
-    ENDIF()
-    IF(NOT WINE_WINE_PROGRAM OR NOT WINE_WINEPATH_PROGRAM)
-        MESSAGE(FATAL_ERROR
+            set(WINE_CPP_RUNTIME ${RT} CACHE INTERNAL "C++ RT in Wine path format")
+        endif()
+    endif()
+    if(NOT WINE_WINE_PROGRAM OR NOT WINE_WINEPATH_PROGRAM)
+        message(FATAL_ERROR
             "Some wine related executables could not be detected automatically. "
             "Please set WINE_WINE_PROGRAM and WINE_WINEPATH_PROGRAM appropriately."
         )
-    ENDIF()
+    endif()
     # prepare wine prefix for configure and unit tests
-    IF(NOT DCMTK_WINEPREFIX)
-        SET(DCMTK_WINEPREFIX "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix" CACHE INTERNALE "the path of the wineprefix to use for configuration and unit tests")
-        MESSAGE(STATUS "Info: Preparing wine prefix for configuration and unit tests: ${DCMTK_WINEPREFIX}")
-        STRING(REPLACE "\\" "\\\\" WINE_CPP_RUNTIME "${WINE_CPP_RUNTIME}")
-        SET(WINE_PATH_REG "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkWinePath.reg")
-        CONFIGURE_FILE("${DCMTK_SOURCE_DIR}/CMake/dcmtkWinePath.reg.in" "${WINE_PATH_REG}" ESCAPE_QUOTES @ONLY)
-        SET(ENV{WINEPREFIX} "${DCMTK_WINEPREFIX}")
-        EXECUTE_PROCESS(COMMAND "${WINE_WINE_PROGRAM}" "regedit" "${WINE_PATH_REG}"
+    if(NOT DCMTK_WINEPREFIX)
+        set(DCMTK_WINEPREFIX "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix" CACHE INTERNALE "the path of the wineprefix to use for configuration and unit tests")
+        message(STATUS "Info: Preparing wine prefix for configuration and unit tests: ${DCMTK_WINEPREFIX}")
+        string(REPLACE "\\" "\\\\" WINE_CPP_RUNTIME "${WINE_CPP_RUNTIME}")
+        set(WINE_PATH_REG "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkWinePath.reg")
+        configure_file("${DCMTK_SOURCE_DIR}/CMake/dcmtkWinePath.reg.in" "${WINE_PATH_REG}" ESCAPE_QUOTES @ONLY)
+        set(ENV{WINEPREFIX} "${DCMTK_WINEPREFIX}")
+        execute_process(COMMAND "${WINE_WINE_PROGRAM}" "regedit" "${WINE_PATH_REG}"
             OUTPUT_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix.log"
             ERROR_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix.log"
             OUTPUT_VARIABLE RESULT
         )
-        IF(RESULT)
-            SET(DCMTK_WINEPREFIX CACHE INTERNAL "error, see ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix.log")
-            MESSAGE(FATAL_ERROR "Failed to setup the wineprefix, see \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix.log\"")
-        ENDIF()
-    ELSE()
-        SET(ENV{WINEPREFIX} "${DCMTK_WINEPREFIX}")
-    ENDIF()
-ENDFUNCTION(DCMTK_SETUP_WINE)
+        if(RESULT)
+            set(DCMTK_WINEPREFIX CACHE INTERNAL "error, see ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix.log")
+            message(FATAL_ERROR "Failed to setup the wineprefix, see \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/wineprefix.log\"")
+        endif()
+    else()
+        set(ENV{WINEPREFIX} "${DCMTK_WINEPREFIX}")
+    endif()
+endfunction()
 
 #
 # Helper function to detach the output and error streams from a wine process, so
@@ -63,36 +63,36 @@ ENDFUNCTION(DCMTK_SETUP_WINE)
 # ERROR_VAR - the variable that will hold the error output of the launched process.
 # ARGN - the command to execute.
 #
-FUNCTION(WINE_DETACHED VAR OUTPUT_VAR ERROR_VAR)
+function(WINE_DETACHED VAR OUTPUT_VAR ERROR_VAR)
     # Prefix to prevent collision of output capturing files
-    IF(CMAKE_VERSION VERSION_LESS 2.8.7)
-        STRING(RANDOM LENGTH 20 ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" PREFIX)
-    ELSE()
-        STRING(MD5 PREFIX "${ARGN}")
-    ENDIF()
-    SET(OUTPUT_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_output")
-    IF(OUTPUT_VAR STREQUAL ERROR_VAR)
-        SET(ERROR_FILE "${OUTPUT_FILE}")
-    ELSE()
-        SET(ERROR_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_error")
-    ENDIF()
-    EXECUTE_PROCESS(
+    if(CMAKE_VERSION VERSION_LESS 2.8.7)
+        string(RANDOM LENGTH 20 ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" PREFIX)
+    else()
+        string(MD5 PREFIX "${ARGN}")
+    endif()
+    set(OUTPUT_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_output")
+    if(OUTPUT_VAR STREQUAL ERROR_VAR)
+        set(ERROR_FILE "${OUTPUT_FILE}")
+    else()
+        set(ERROR_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PREFIX}_error")
+    endif()
+    execute_process(
         COMMAND ${ARGN}
         OUTPUT_FILE "${OUTPUT_FILE}"
         ERROR_FILE "${ERROR_FILE}"
         RESULT_VARIABLE RESULT
     )
-    FILE(READ "${OUTPUT_FILE}" OUTPUT)
-    SET("${OUTPUT_VAR}" ${OUTPUT} PARENT_SCOPE)
-    IF(OUTPUT_VAR STREQUAL ERROR_VAR)
-        FILE(REMOVE "${OUTPUT_FILE}")
-    ELSE()
-        FILE(READ "${ERROR_FILE}" ERROR)
-        SET("${ERROR_VAR}" ${ERROR} PARENT_SCOPE)
-        FILE(REMOVE "${OUTPUT_FILE}" "${ERROR_FILE}")
-    ENDIF()
-    SET("${VAR}" ${RESULT} PARENT_SCOPE)
-ENDFUNCTION(WINE_DETACHED)
+    file(READ "${OUTPUT_FILE}" OUTPUT)
+    set("${OUTPUT_VAR}" ${OUTPUT} PARENT_SCOPE)
+    if(OUTPUT_VAR STREQUAL ERROR_VAR)
+        file(REMOVE "${OUTPUT_FILE}")
+    else()
+        file(READ "${ERROR_FILE}" ERROR)
+        set("${ERROR_VAR}" ${ERROR} PARENT_SCOPE)
+        file(REMOVE "${OUTPUT_FILE}" "${ERROR_FILE}")
+    endif()
+    set("${VAR}" ${RESULT} PARENT_SCOPE)
+endfunction()
 
 #
 # Uses 'winepath' to translate a host path or filename to the location it can be
@@ -102,16 +102,16 @@ ENDFUNCTION(WINE_DETACHED)
 # Will unset VAR if an error occurred.
 # Additional arguments will be ignored.
 #
-FUNCTION(UNIX_TO_WINE_PATH VAR PATH)
+function(UNIX_TO_WINE_PATH VAR PATH)
     WINE_DETACHED(ERROR RESULT STDERR "${WINE_WINEPATH_PROGRAM}" "-w" "${PATH}")
-    IF(NOT ERROR)
-        STRING(REPLACE "\n" "" RESULT ${RESULT})
-        SET(${VAR} ${RESULT} PARENT_SCOPE)
-    ELSE()
-        UNSET(${VAR} PARENT_SCOPE)
-        MESSAGE(WARNING "Unable to convert path to Wine format: ${STDERR}")
-    ENDIF()
-ENDFUNCTION()
+    if(NOT ERROR)
+        string(REPLACE "\n" "" RESULT ${RESULT})
+        set(${VAR} ${RESULT} PARENT_SCOPE)
+    else()
+        unset(${VAR} PARENT_SCOPE)
+        message(WARNING "Unable to convert path to Wine format: ${STDERR}")
+    endif()
+endfunction()
 
 #
 # Create a command (as string) to run a given command in the emulated Windows
@@ -120,8 +120,8 @@ ENDFUNCTION()
 # COMMAND - the command to run, e. g. 'dir'
 # Additional arguments will be appended to the command.
 #
-FUNCTION(WINE_COMMAND VAR COMMAND)
+function(WINE_COMMAND VAR COMMAND)
     UNIX_TO_WINE_PATH(CMD ${COMMAND})
-    SEPARATE_ARGUMENTS(ARGS WINDOWS_COMMAND "${ARGN}")
-    SET(${VAR} "${CMD}" ${ARGS} PARENT_SCOPE)
-ENDFUNCTION()
+    separate_arguments(ARGS WINDOWS_COMMAND "${ARGN}")
+    set(${VAR} "${CMD}" ${ARGS} PARENT_SCOPE)
+endfunction()
index c837cc86ea32c582e05ee01231809a4240e2879f..f80e4c8b3eba49457b09f0cde5b6f89c27d0708e 100644 (file)
 /* Define if your system has a prototype for finite in math.h */
 #cmakedefine HAVE_PROTOTYPE_FINITE @HAVE_PROTOTYPE_FINITE@
 
+/* Define to 1 if your has a prototype for `TryAcquireSRWLockShared' in windows.h (Win32 only). */
+#cmakedefine HAVE_PROTOTYPE_TRYACQUIRESRWLOCKSHARED @HAVE_PROTOTYPE_TRYACQUIRESRWLOCKSHARED@
+
 /* Define if your system has a prototype for std::finite in cmath */
 #cmakedefine HAVE_PROTOTYPE_STD__FINITE @HAVE_PROTOTYPE_STD__FINITE@
 
 /* Define to 1 if `strerror_r' returns a char*. */
 #cmakedefine HAVE_CHARP_STRERROR_R @HAVE_CHARP_STRERROR_R@
 
+/* Define to 1 if you have the <streambuf.h> header file. */
+#cmakedefine HAVE_STREAMBUF_H @HAVE_STREAMBUF_H@
+
 /* Define to 1 if you have the <strings.h> header file. */
 #cmakedefine HAVE_STRINGS_H @HAVE_STRINGS_H@
 
 /* Define if the second argument to iconv() is const */
 #cmakedefine LIBICONV_SECOND_ARGUMENT_CONST @LIBICONV_SECOND_ARGUMENT_CONST@
 
+/* Try to define the iconv behavior as conversion flags */
+#cmakedefine DCMTK_FIXED_ICONV_CONVERSION_FLAGS @DCMTK_FIXED_ICONV_CONVERSION_FLAGS@
+
+/* Define if iconv_open() accepts "" as an argument */
+#cmakedefine DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING @DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING@
+
 /* Define if we are compiling with libpng support */
 #cmakedefine WITH_LIBPNG
 
@@ -1073,6 +1085,9 @@ typedef unsigned long ulong;
 /* Define if the compiler supports operator delete (std::nothrow) */
 #cmakedefine HAVE_NOTHROW_DELETE @HAVE_NOTHROW_DELETE@
 
+/* Define if the compiler supports static_assert */
+#cmakedefine HAVE_STATIC_ASSERT @HAVE_STATIC_ASSERT@
+
 /* Define if your system has a prototype for std::vfprintf in stdarg.h */
 #cmakedefine HAVE_PROTOTYPE_STD__VFPRINTF @HAVE_PROTOTYPE_STD__VFPRINTF@
 
index 91f68e14027f408ade6158c1ce44ffe8d6ceac99..9f1e02be262e52744e9db5b041ef5be35987e2c7 100644 (file)
@@ -1,20 +1,20 @@
 # Declare project
-PROJECT(DCMTK)
+project(DCMTK)
 
 # Minimum CMake version required
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
+cmake_minimum_required(VERSION 2.8.5)
 
 # Disables a warning emitted by CMake 3.7.2. The same setting is performed
 # again in CMake/dcmtkPrepare.cmake (included below), but the warning is still
 # emitted if it is not set here (it only goes away if the policy is set in
 # both files).
 # We do not entirely understand this behavior, perhaps it is a bug in CMake?
-IF(POLICY CMP0017)
-    CMAKE_POLICY(SET CMP0017 NEW)
-ENDIF()
+if(POLICY CMP0017)
+    cmake_policy(SET CMP0017 NEW)
+endif()
 
 # Check the build system
-INCLUDE(CMake/dcmtkPrepare.cmake NO_POLICY_SCOPE)
+include(CMake/dcmtkPrepare.cmake NO_POLICY_SCOPE)
 
 #-----------------------------------------------------------------------------
 # General project settings to configure DCMTK build process
@@ -22,7 +22,7 @@ INCLUDE(CMake/dcmtkPrepare.cmake NO_POLICY_SCOPE)
 
 # Modules to be built
 
-SET(DCMTK_MODULES ofstd oflog dcmdata dcmimgle
+set(DCMTK_MODULES ofstd oflog dcmdata dcmimgle
   dcmimage dcmjpeg dcmjpls dcmtls dcmnet dcmsr
   dcmsign dcmwlm dcmqrdb dcmpstat dcmrt dcmiod dcmfg dcmseg dcmtract dcmpmap
   CACHE STRING "List of modules that should be built.")
@@ -31,19 +31,19 @@ SET(DCMTK_MODULES ofstd oflog dcmdata dcmimgle
 # Include directories
 #-----------------------------------------------------------------------------
 
-SET(DCMTK_INCLUDE_DIR "${DCMTK_BINARY_DIR}/config/include")
-FOREACH(inc ${DCMTK_MODULES})
-  LIST(APPEND DCMTK_INCLUDE_DIR "${DCMTK_SOURCE_DIR}/${inc}/include")
-ENDFOREACH(inc)
+set(DCMTK_INCLUDE_DIR "${DCMTK_BINARY_DIR}/config/include")
+foreach(inc ${DCMTK_MODULES})
+  list(APPEND DCMTK_INCLUDE_DIR "${DCMTK_SOURCE_DIR}/${inc}/include")
+endforeach()
 
-INCLUDE_DIRECTORIES(${DCMTK_INCLUDE_DIR})
+include_directories(${DCMTK_INCLUDE_DIR})
 
 #-----------------------------------------------------------------------------
 # Prepare osconfig.h
 #-----------------------------------------------------------------------------
 
 # add the osconfig.h.in file
-CONFIGURE_FILE("${DCMTK_SOURCE_DIR}/CMake/osconfig.h.in"
+configure_file("${DCMTK_SOURCE_DIR}/CMake/osconfig.h.in"
                "${DCMTK_BINARY_DIR}/config/include/dcmtk/config/osconfig.h")
 
 #-----------------------------------------------------------------------------
@@ -56,19 +56,19 @@ INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES()
 # Unit test related configuration/setup
 # ----------------------------------------------------------------------------
 
-IF(CMAKE_CROSSCOMPILING)
-  IF(WIN32)
-    SET(DCMTK_RUN_CTEST_SCRIPT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkCTestRunWine.cmake" CACHE INTERNAL "path to the CMake script for launching a unit test as a detached Wine process in the prepared wineprefix")
-  ELSEIF(ANDROID)
-    SET(DCMTK_RUN_CTEST_SCRIPT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkCTestRunAndroid.cmake" CACHE INTERNAL "path to the CMake script for launching a unit test via the android emulator")
-  ELSE()
-    MESSAGE(WARNING "Emulation for your target platform is not available, CTest will not be able to execute the unit tests!")
-  ENDIF()
-ELSE(CMAKE_CROSSCOMPILING)
-  SET(DCMTK_RUN_CTEST_SCRIPT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkCTestRun.cmake" CACHE INTERNAL "path to the CMake script for launching a unit test")
-ENDIF(CMAKE_CROSSCOMPILING)
+if(CMAKE_CROSSCOMPILING)
+  if(WIN32)
+    set(DCMTK_RUN_CTEST_SCRIPT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkCTestRunWine.cmake" CACHE INTERNAL "path to the CMake script for launching a unit test as a detached Wine process in the prepared wineprefix")
+  elseif(ANDROID)
+    set(DCMTK_RUN_CTEST_SCRIPT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkCTestRunAndroid.cmake" CACHE INTERNAL "path to the CMake script for launching a unit test via the android emulator")
+  else()
+    message(WARNING "Emulation for your target platform is not available, CTest will not be able to execute the unit tests!")
+  endif()
+else()
+  set(DCMTK_RUN_CTEST_SCRIPT "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/dcmtkCTestRun.cmake" CACHE INTERNAL "path to the CMake script for launching a unit test")
+endif()
 # Add a target to run the unit tests in exhaustive mode
-ADD_CUSTOM_TARGET("test-exhaustive"
+add_custom_target("test-exhaustive"
     COMMAND "${CMAKE_COMMAND}" "-DCONFIG=${DCMTK_CONFIG_GENERATOR_EXPRESSION}" "-P"
         "${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRunExhaustive.cmake"
     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
@@ -79,26 +79,26 @@ ADD_CUSTOM_TARGET("test-exhaustive"
 #-----------------------------------------------------------------------------
 
 # Recurse into subdirectories
-FOREACH(module config doxygen ${DCMTK_MODULES})
-  ADD_SUBDIRECTORY(${module})
-ENDFOREACH(module)
-INCLUDE(CMake/dcmtkAfterModules.cmake NO_POLICY_SCOPE)
+foreach(module config doxygen ${DCMTK_MODULES})
+  add_subdirectory(${module})
+endforeach()
+include(CMake/dcmtkAfterModules.cmake NO_POLICY_SCOPE)
 
 #-----------------------------------------------------------------------------
 # Installation tasks
 #-----------------------------------------------------------------------------
 
 # Install global headers
-INSTALL(FILES "${DCMTK_BINARY_DIR}/config/include/dcmtk/config/osconfig.h"
+install(FILES "${DCMTK_BINARY_DIR}/config/include/dcmtk/config/osconfig.h"
               "${DCMTK_BINARY_DIR}/config/include/dcmtk/config/arith.h"
         DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk/config"
         COMPONENT include)
 
 # Install DCMTK's general documentation files
-INSTALL(FILES ANNOUNCE CHANGES COPYRIGHT CREDITS FAQ HISTORY VERSION
+install(FILES ANNOUNCE CHANGES COPYRIGHT CREDITS FAQ HISTORY VERSION
         DESTINATION "${CMAKE_INSTALL_DOCDIR}"
         COMPONENT doc)
-INSTALL(DIRECTORY docs/ DESTINATION "${CMAKE_INSTALL_DOCDIR}"
+install(DIRECTORY docs/ DESTINATION "${CMAKE_INSTALL_DOCDIR}"
         COMPONENT doc FILES_MATCHING PATTERN "CHANGES.???")
 
 #-----------------------------------------------------------------------------
@@ -114,79 +114,79 @@ INSTALL(DIRECTORY docs/ DESTINATION "${CMAKE_INSTALL_DOCDIR}"
 # under the main install dir (handled directly below).
 
 # Only create fully-fledged CMake export files if we have the related commands
-INCLUDE(CMake/CheckCMakeCommandExists.cmake)
-INCLUDE(CMakePackageConfigHelpers OPTIONAL)
+include(CMake/CheckCMakeCommandExists.cmake)
+include(CMakePackageConfigHelpers OPTIONAL)
 CHECK_CMAKE_COMMAND_EXISTS("CONFIGURE_PACKAGE_CONFIG_FILE")
 CHECK_CMAKE_COMMAND_EXISTS("WRITE_BASIC_PACKAGE_VERSION_FILE")
 
-IF(HAVE_CONFIGURE_PACKAGE_CONFIG_FILE AND HAVE_WRITE_BASIC_PACKAGE_VERSION_FILE)
+if(HAVE_CONFIGURE_PACKAGE_CONFIG_FILE AND HAVE_WRITE_BASIC_PACKAGE_VERSION_FILE)
 
   # Create and configure CMake export files
-  INCLUDE(CMake/GenerateCMakeExports.cmake)
+  include(CMake/GenerateCMakeExports.cmake)
 
   # ${DCMTK_INSTALL_CONFIG} and ${DCMTK_CONFIG_VERSION} are
   # defined within CMake/GenerateCMakeExports.cmake.
   # Install DCMTKTargets.cmake to install tree
-  INSTALL(EXPORT DCMTKTargets FILE DCMTKTargets.cmake
+  install(EXPORT DCMTKTargets FILE DCMTKTargets.cmake
           DESTINATION "${DCMTK_INSTALL_CMKDIR}" COMPONENT cmake)
 
   # Install DCMTKConfig.cmake and DCMTKConfigVersion.cmake
-  INSTALL(FILES "${DCMTK_INSTALL_CONFIG}" "${DCMTK_CONFIG_VERSION}"
+  install(FILES "${DCMTK_INSTALL_CONFIG}" "${DCMTK_CONFIG_VERSION}"
           DESTINATION "${DCMTK_INSTALL_CMKDIR}" COMPONENT cmake)
 
-ELSE(HAVE_CONFIGURE_PACKAGE_CONFIG_FILE AND HAVE_WRITE_BASIC_PACKAGE_VERSION_FILE)
+else()
 
   # Warning that we use old "configure_file" command
-  MESSAGE(STATUS "Warning: Using old CONFIGURE_FILE() mechanism to produce DCMTKConfig.cmake")
+  message(STATUS "Warning: Using old configure_file() mechanism to produce DCMTKConfig.cmake")
 
   # Actually configure file
-  CONFIGURE_FILE("${DCMTK_SOURCE_DIR}/CMake/DCMTKConfig.old_cmake.in"
+  configure_file("${DCMTK_SOURCE_DIR}/CMake/DCMTKConfig.old_cmake.in"
                  "${DCMTK_BINARY_DIR}/DCMTKConfig.cmake" @ONLY)
 
   # Install DCMTKConfig.cmake and DCMTKConfigVersion.cmake
-  INSTALL(FILES "${DCMTK_BINARY_DIR}/DCMTKConfig.cmake" "${DCMTK_BINARY_DIR}/DCMTKConfigVersion.cmake"
+  install(FILES "${DCMTK_BINARY_DIR}/DCMTKConfig.cmake" "${DCMTK_BINARY_DIR}/DCMTKConfigVersion.cmake"
           DESTINATION "${DCMTK_INSTALL_CMKDIR}"
           COMPONENT cmake)
 
-ENDIF(HAVE_CONFIGURE_PACKAGE_CONFIG_FILE AND HAVE_WRITE_BASIC_PACKAGE_VERSION_FILE)
+endif()
 
 #-----------------------------------------------------------------------------
 # Configure files needed for running the unit tests and cleanup
 #-----------------------------------------------------------------------------
 
-IF(CMAKE_CROSSCOMPILING)
-  IF(WIN32)
-    STRING(REPLACE ";" "${ENVIRONMENT_PATH_SEPARATOR}" DCMDICTPATH "${DCMTK_DICOM_DICTIONARIES}")
-    CONFIGURE_FILE("${DCMTK_SOURCE_DIR}/CMake/CTest/CTestCustomWine.cmake.in"
+if(CMAKE_CROSSCOMPILING)
+  if(WIN32)
+    string(REPLACE ";" "${ENVIRONMENT_PATH_SEPARATOR}" DCMDICTPATH "${DCMTK_DICOM_DICTIONARIES}")
+    configure_file("${DCMTK_SOURCE_DIR}/CMake/CTest/CTestCustomWine.cmake.in"
       "${DCMTK_BINARY_DIR}/CTestCustom.cmake" ESCAPE_QUOTES @ONLY
     )
-    CONFIGURE_FILE("${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRunWine.cmake.in"
+    configure_file("${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRunWine.cmake.in"
       "${DCMTK_RUN_CTEST_SCRIPT}" ESCAPE_QUOTES @ONLY
     )
-  ELSEIF(ANDROID)
+  elseif(ANDROID)
     DCMTK_ANDROID_STOP_EMULATOR(DCMTK_ANDROID_EMULATOR_INSTANCE)
     # Prepare setting environment variable DCMDICTPATH
-    SET(DICTIONARIES ${DCMTK_DICOM_DICTIONARIES})
-    LIST(GET DICTIONARIES 0 DCMDICTPATH)
-    LIST(REMOVE_AT DICTIONARIES 0)
-    GET_FILENAME_COMPONENT(DCMDICTPATH "${DCMDICTPATH}" NAME)
-    SET(DCMDICTPATH "${ANDROID_TEMPORARY_FILES_LOCATION}/${DCMDICTPATH}")
-    FOREACH(DICTIONARY ${DICTIONARIES})
-        GET_FILENAME_COMPONENT(FILE "${DICTIONARY}" NAME)
-        SET(DCMDICTPATH "${DCMDICTPATH}:${ANDROID_TEMPORARY_FILES_LOCATION}/${FILE}")
-    ENDFOREACH()
-    CONFIGURE_FILE("${DCMTK_SOURCE_DIR}/CMake/CTest/CTestCustomAndroid.cmake.in"
+    set(DICTIONARIES ${DCMTK_DICOM_DICTIONARIES})
+    list(GET DICTIONARIES 0 DCMDICTPATH)
+    list(REMOVE_AT DICTIONARIES 0)
+    get_filename_component(DCMDICTPATH "${DCMDICTPATH}" NAME)
+    set(DCMDICTPATH "${ANDROID_TEMPORARY_FILES_LOCATION}/${DCMDICTPATH}")
+    foreach(DICTIONARY ${DICTIONARIES})
+        get_filename_component(FILE "${DICTIONARY}" NAME)
+        set(DCMDICTPATH "${DCMDICTPATH}:${ANDROID_TEMPORARY_FILES_LOCATION}/${FILE}")
+    endforeach()
+    configure_file("${DCMTK_SOURCE_DIR}/CMake/CTest/CTestCustomAndroid.cmake.in"
       "${DCMTK_BINARY_DIR}/CTestCustom.cmake" ESCAPE_QUOTES @ONLY
     )
-    CONFIGURE_FILE("${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRunAndroid.cmake.in"
+    configure_file("${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRunAndroid.cmake.in"
       "${DCMTK_RUN_CTEST_SCRIPT}" ESCAPE_QUOTES @ONLY
     )
-  ELSE()
+  else()
     # nothing to do
-  ENDIF()
-ELSE(CMAKE_CROSSCOMPILING)
-  STRING(REPLACE ";" "${ENVIRONMENT_PATH_SEPARATOR}" DCMDICTPATH "${DCMTK_DICOM_DICTIONARIES}")
-  CONFIGURE_FILE("${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRun.cmake.in"
+  endif()
+else()
+  string(REPLACE ";" "${ENVIRONMENT_PATH_SEPARATOR}" DCMDICTPATH "${DCMTK_DICOM_DICTIONARIES}")
+  configure_file("${DCMTK_SOURCE_DIR}/CMake/CTest/dcmtkCTestRun.cmake.in"
     "${DCMTK_RUN_CTEST_SCRIPT}" ESCAPE_QUOTES @ONLY
   )
-ENDIF(CMAKE_CROSSCOMPILING)
+endif()
index fd2f3ab9e7fdc3e63c5632852ac3d18bded9f074..603c5fb161f1ef6450b2624415c3f7defb776dd3 100644 (file)
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -5,7 +5,7 @@ Unless otherwise specified, the DCMTK software package has the following
 copyright:
 
 /*
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.
  *
  *  This software and supporting documentation were developed by
@@ -478,7 +478,7 @@ The dcmrt sub-package is covered by the following copyright:
 ---------------------------------------------------------------------------
 
 Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany
-Copyright (C) 2013-2017, J. Riesmeier, Oldenburg, Germany
+Copyright (C) 2013-2018, J. Riesmeier, Oldenburg, Germany
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -511,7 +511,7 @@ Parts of the dcmsr sub-package are covered by the following copyright:
 
 ---------------------------------------------------------------------------
 
-Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff --git a/INSTALL b/INSTALL
index 2140c577a3db2d2e40cd09cadb7458da1ef795a2..3d0c87f1bfa23e2a5c868cda13335884059f9650 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -8,9 +8,9 @@ PRE-REQUISITES
 
 The DICOM toolkit (DCMTK) needs to be compiled with a C++ compiler.  We
 recommend using the GNU C++ compiler in versions higher than 4.2.1 (most of the
-development was done using GNU C++ 4.9.2 on Linux 3.16).  The software is also
-known to compile using the SUNPro C++ compiler, Clang and Microsoft Visual
-Studio.
+development for this release was done using GNU C++ 6.3.0 on Debian Linux).
+The software is also known to compile using the SUNPro C++ compiler,
+Clang and Microsoft Visual Studio.
 
 Compatibility with other C++ compilers is unknown, however, we have tried to
 keep language demands to a minimum (newer C++ features such as Exceptions and
@@ -39,15 +39,16 @@ system / hardware / compiler combinations:
    Windows 7       / Intel x86    / Microsoft Visual C++ 2013 Express (VS 12)
    Windows 7       / Intel x86    / Microsoft Visual C++ 2015 Community (VS 14)
    Windows 7       / Intel x86    / Microsoft Visual C++ 2017 Community (VS 15)
-   Windows 7       / Intel x86    / MinGW gcc 4.9.1 (i686-w64-mingw32)
+   Windows 7       / Intel x86    / MinGW gcc 7.3.0 (i686-w64-mingw32)
    Windows 10      / Intel x86    / Microsoft Visual C++ 2015 Community (VS 14)
    Windows 7       / amd64|x86_64 / Microsoft Visual C++ 2010 Express (VS 10)
    Windows 7       / amd64|x86_64 / Microsoft Visual C++ 2012 Express (VS 11)
    Windows 7       / amd64|x86_64 / Microsoft Visual C++ 2013 Express (VS 12)
    Windows 7       / amd64|x86_64 / Microsoft Visual C++ 2015 Community (VS 14)
    Windows 7       / amd64|x86_64 / Microsoft Visual C++ 2017 Community (VS 15)
-   Windows 7       / amd64|x86_64 / MinGW gcc 4.9.1 (x86_64-w64-mingw32)
+   Windows 7       / amd64|x86_64 / MinGW gcc 8.2.0 (x86_64-w64-mingw32)
    Windows 10      / amd64|x86_64 / Microsoft Visual C++ 2015 Community (VS 14)
+   Windows 10      / amd64|x86_64 / Microsoft Visual C++ 2017 Community (VS 15)
 
 Unix (or lookalikes)
 --------------------
@@ -56,34 +57,27 @@ The current DCMTK software release successfully compiles on the following
 operating system / hardware / compiler combinations using the instructions
 given below:
 
-   FreeBSD 10.1    / amd64|x86_64 / Clang 3.4.1
-   Linux 4.11.9    / amd64|x86_64 / Clang 5.0.1       (Arch Linux)
-   Linux 4.11.9    / amd64|x86_64 / GNU gcc 7.2.1     (Arch Linux)
+   FreeBSD 11.2    / amd64|x86_64 / Clang 6.0.0
+   Linux 4.19.4    / amd64|x86_64 / Clang 7.0.0       (Arch Linux)
+   Linux 4.19.4    / amd64|x86_64 / GNU gcc 8.2.1     (Arch Linux)
    Linux 3.10.0    / amd64|x86_64 / Clang 3.4.2       (CentOS 7.3)
    Linux 3.10.0    / amd64|x86_64 / GNU gcc 4.8.5     (CentOS 7.3)
-   Linux 3.16.0    / amd64|x86_64 / Clang 3.5.0       (Debian 8.8)
    Linux 3.2.0     / amd64|x86_64 / GNU gcc 4.4.7     (Debian 7.11)
-   Linux 3.2.0     / amd64|x86_64 / GNU gcc 4.7.2     (Debian 7.11)
    Linux 3.2.0     / amd64|x86_64 / GNU gcc 4.8.4     (Debian 7.11)
-   Linux 3.19.0    / amd64|x86_64 / Clang 3.9.1       (Linux Mint 17.3)
-   Linux 3.19.0    / amd64|x86_64 / GNU gcc 4.8.5     (Linux Mint 17.3)
-   Linux 3.19.0    / amd64|x86_64 / GNU gcc 5.4.1     (Linux Mint 17.3)
-   Linux 3.19.0    / amd64|x86_64 / GNU gcc 6.3.0     (Linux Mint 17.3)
-   Linux 4.9.0     / Intel x86    / Clang 3.8.1       (Debian 9.0)
-   Linux 4.9.0     / Intel x86    / GNU gcc 6.3.0     (Debian 9.0)
-   Linux 4.10.0    / amd64|x86_64 / GNU gcc 6.3.0     (Ubuntu 17.04)
-   Linux 4.10.0    / amd64|x86_64 / Clang 4.0.0       (Ubuntu 17.04)
-   MacOS X 10.10.4 / amd64|x86_64 / Apple Clang 6.0
-   NetBSD 7.0      / amd64|x86_64 / Clang 4.0.0
-   NetBSD 7.0      / amd64|x86_64 / GNU gcc 4.8.5
+   Linux 4.9.0     / Intel x86    / Clang 3.8.1       (Debian 9.6)
+   Linux 4.9.0     / Intel x86    / GNU gcc 6.3.0     (Debian 9.6)
+   Linux 3.13.0    / amd64|x86_64 / Clang 3.9.1       (Linux Mint 17.3)
+   Linux 3.13.0    / amd64|x86_64 / GNU gcc 4.8.5     (Linux Mint 17.3)
+   Linux 3.13.0    / amd64|x86_64 / GNU gcc 5.5.0     (Linux Mint 17.3)
+   Linux 3.13.0    / amd64|x86_64 / GNU gcc 6.5.0     (Linux Mint 17.3)
+   NetBSD 8.0      / amd64|x86_64 / Clang 5.0.2
+   NetBSD 8.0      / amd64|x86_64 / GNU gcc 5.5.0
    OpenBSD 6.0     / amd64|x86_64 / Clang 3.8.0
    OpenBSD 6.0     / amd64|x86_64 / GNU gcc 4.2.1
-   OpenIndiana     / Intel x86    / Clang 4.0.0       (OpenIndiana 2017.04)
-   OpenIndiana     / Intel x86    / GNU gcc 4.9.4     (OpenIndiana 2017.04)
+   OpenIndiana     / Intel x86    / GNU gcc 7.3.0     (OpenIndiana 2018.04)
    Solaris 11.3    / Intel x86    / GNU gcc 4.8.2
-   Solaris 11.3    / Intel x86    / SunPro CC 5.14    (Oracle Developer Studio 12.5)
-   Solaris 11.3    / Intel x86    / SunPro CC 5.15    (Oracle Developer Studio 12.6)
-   Windows 7       / amd64|x86_64 / CygWin 2.8.0      (gcc 6.3.0)
+   Solaris 11.3    / Intel x86    / SunPro CC 5.14    (Oracle Dev. Studio 12.5)
+   Solaris 11.3    / Intel x86    / SunPro CC 5.15    (Oracle Dev. Studio 12.6)
 
 Cross Compiling
 ---------------
@@ -91,7 +85,7 @@ Cross Compiling
 The current DCMTK release can be cross-compiled targeting the following
 platforms:
 
-  Android          / arm64        / GNU gcc 4.9.2     (API 24, ABI arm64-v8a)
+  Android          / arm64        / GNU gcc 6.3.0     (API 24, ABI arm64-v8a)
 
 Cross compiling support with running configuration and unit tests is currently
 only provided using CMake and requires the use of the Android emulator or Wine
@@ -108,6 +102,17 @@ yourself.
 Other Platforms
 ---------------
 
+The previous minor release DCMTK 3.6.3 was also tested on the following
+platforms that may still work, but were not tested again for this minor release:
+
+   Linux 3.16.0    / amd64|x86_64 / Clang 3.5.0       (Debian 8.8)
+   Linux 3.2.0     / amd64|x86_64 / GNU gcc 4.7.2     (Debian 7.11)
+   Linux 4.10.0    / amd64|x86_64 / GNU gcc 6.3.0     (Ubuntu 17.04)
+   Linux 4.10.0    / amd64|x86_64 / Clang 4.0.0       (Ubuntu 17.04)
+   MacOS X 10.10.4 / amd64|x86_64 / Apple Clang 6.0
+   Windows 7       / amd64|x86_64 / CygWin 2.8.0      (gcc 6.3.0)
+   OpenIndiana     / Intel x86    / Clang 4.0.0       (OpenIndiana 2017.04)
+
 The previous release DCMTK 3.6.2 was also tested on the following platforms
 that may still work, but were not tested again for this minor release:
 
@@ -143,26 +148,30 @@ Platform Notes
 OPENSSL SUPPORT
 ===============
 
-Starting with release 3.4.2, DCMTK supports the "DICOM Security Enhancements
-One", i.e. DICOM network transmission "tunneled" through a secure TLSv1
-transport connection.  DCMTK relies on the OpenSSL toolkit (www.openssl.org)
-for the underlying cryptographic routines and the TLS protocol implementation.
-This release of DCMTK is known to compile with the OpenSSL releases 0.9.8 to
-1.1.0g, although other releases may work as well.
+Starting with release 3.4.2, DCMTK supports encrypted network transmissions
+using the Transport Layer Security (TLS) protocol as defined in DICOM part 15.
+DCMTK relies on the OpenSSL toolkit (www.openssl.org) for the underlying
+cryptographic routines and the TLS protocol implementation.
 
-When using Autoconf, if support for security enhancements is desired, a compiled
-version of the OpenSSL libraries and include files must be available during
-compilation of DCMTK.  By default, DCMTK checks whether OpenSSL is installed
-in the standard path and enables support automatically if present.
+This release of DCMTK requires OpenSSL release 1.0.1 or newer, since older
+versions do not support the TLS 1.2 protocol required by the more recent
+DICOM security profiles. We recommend the use of OpenSSL 1.0.2 or newer,
+however, since some optional functions recommended by RFC 7525 / BCP 195
+are only available starting with this OpenSSL release. Furthermore, users
+should make care that the most recent OpenSSL patch level is applied.
 
 When using CMake, if support for security enhancements is desired, a compiled
 version of the OpenSSL libraries and include files must be available during
-compilation of DCMTK, and the OpenSSL support must be switched on explicitly
-(using CMake, see below).  By default, DCMTK checks whether OpenSSL is installed
+compilation of DCMTK.  By default, DCMTK checks whether OpenSSL is installed
 and enables support automatically if present.  By default, DCMTK checks the
 standard paths on Unix platforms.  For Windows platforms, check the discussion
 on CMake below.
 
+When using Autoconf, if support for security enhancements is desired, a compiled
+version of the OpenSSL libraries and include files must be available during
+compilation of DCMTK.  By default, DCMTK checks whether OpenSSL is installed
+in the standard path and enables support automatically if present.
+
 
 ZLIB SUPPORT
 ============
@@ -171,37 +180,37 @@ Starting with release 3.5.2, DCMTK supports the "Deflated Explicit VR Little
 Endian" Transfer Syntax, i.e. ZIP-compressed network transmission and media
 storage.  DCMTK relies on the zlib toolkit (www.zlib.org) for the underlying
 compression routines.  This release of DCMTK is known to compile with the zlib
-releases 1.2.3 to 1.2.11, although other releases may work as well.
+releases 1.2.8 to 1.2.11, although other releases may work as well.
+
+When using CMake, a compiled version of the zlib libraries and include files
+must be available during compilation of DCMTK.  See discussion on CMake below.
 
 When using Autoconf, if support for zlib compression is desired, a compiled
 version of the zlib library and include files must be available during
 compilation of DCMTK.  By default, DCMTK checks whether zlib is installed in
 the standard path and enables support automatically if present.
 
-When using CMake, a compiled version of the zlib libraries and include files
-must be available during compilation of DCMTK.  See discussion on CMake below.
-
 
 LIBTIFF SUPPORT
 ===============
 
 Starting with release 3.5.1, DCMTK supports the conversion of DICOM images to
 TIFF.  DCMTK relies on the libtiff toolkit (www.libtiff.org) for this purpose.
-This release of DCMTK is known to compile with the libtiff releases 3.7.4 to
-4.0.9, although other releases may work as well.  However, libtiff releases
+This release of DCMTK is known to compile with the libtiff releases 3.8.2 to
+4.10.0, although other releases may work as well.  However, libtiff releases
 prior to version 3.7.0 will not work since the TIFFCleanup() function was not
 yet available.  On Windows, libtiff 3.7.4 or higher is required due to
 incompatible API changes in libtiff.
 
+When using CMake, a compiled version of the libtiff libraries and include files
+must be available during compilation of DCMTK.  See discussion on CMake below.
+
 When using Autoconf, if support for TIFF export is desired, a compiled version
 of the libtiff libraries and include files must be available during compilation
 of DCMTK, and the libtiff support must be switched on explicitly.  By default,
 DCMTK checks whether libtiff is installed in the standard path and enables
 support automatically if present.
 
-When using CMake, a compiled version of the libtiff libraries and include files
-must be available during compilation of DCMTK.  See discussion on CMake below.
-
 
 LIBPNG SUPPORT
 ==============
@@ -209,7 +218,11 @@ LIBPNG SUPPORT
 Starting with release 3.5.3, DCMTK supports the conversion of DICOM images to
 PNG.  DCMTK relies on the libpng toolkit (www.libpng.org) for this purpose.
 This release of DCMTK is known to compile with the current libpng releases
-1.2.8 to 1.6.31, although other releases may work as well.
+1.2.50 to 1.6.35, although other releases may work as well.
+
+When using CMake, a compiled version of the libpng libraries and include
+files must be available during compilation of DCMTK.  See discussion on CMake
+below.
 
 When using Autoconf, if support for PNG export is desired, a compiled version of
 the libpng libraries and include files must be available during compilation of
@@ -217,10 +230,6 @@ DCMTK, and the libpng support must be switched on explicitly.  By default, DCMTK
 checks whether libpng is installed in the standard path and enables support
 automatically if present.  It should be noted that libpng requires zlib.
 
-When using CMake, a compiled version of the libpng libraries and include
-files must be available during compilation of DCMTK.  See discussion on CMake
-below.
-
 
 LIBXML2 SUPPORT
 ===============
@@ -228,17 +237,17 @@ LIBXML2 SUPPORT
 Starting with release 3.5.3, DCMTK supports the conversion of XML documents to
 DICOM files.  DCMTK relies on the libxml2 toolkit (www.libxml.org) for this
 purpose.  This release of DCMTK is known to compile with the libxml2 releases
-2.6.26 to 2.9.7, although other releases may work as well.
+2.9.4 to 2.9.7, although other releases may work as well.
+
+When using CMake, if support for XML import is desired, a compiled version of
+the libxml2 (and possibly iconv) libraries and include files must be available
+during compilation of DCMTK.  See discussion on CMake below.
 
 When using Autoconf, if support for XML import is desired, a compiled version of
 the libxml2 (and possibly iconv) libraries and include files must be available
 during compilation of DCMTK.  By default, DCMTK checks whether libxml2 is
 installed in the standard path and enables support automatically if present.
 
-When using CMake, if support for XML import is desired, a compiled version of
-the libxml2 (and possibly iconv) libraries and include files must be available
-during compilation of DCMTK.  See discussion on CMake below.
-
 
 TCP WRAPPER (LIBWRAP) SUPPORT
 =============================
@@ -250,15 +259,15 @@ allows to enforce host-based access control via the "/etc/hosts.deny" and
 "/etc/hosts.allow" configuration files.  See hosts_access(5) man page for
 details.
 
+When using CMake, if support for TCP wrappers is desired, a compiled version of
+the libwrap library and include file <tcpd.h> must be available during
+compilation of DCMTK.  See discussion on CMake below.
+
 When using Autoconf, if support for TCP wrappers is desired, a compiled version
 of the libwrap library and include file <tcpd.h> must be available during
 compilation of DCMTK.  By default, DCMTK checks whether libwrap is installed
 in the standard path and enables support automatically if present.
 
-When using CMake, if support for TCP wrappers is desired, a compiled version of
-the libwrap library and include file <tcpd.h> must be available during
-compilation of DCMTK.  See discussion on CMake below.
-
 Since DCMTK uses the TCP wrappers from C++ code, an ANSI C compatible header
 file <tcpd.h> is required.  The official release 7.6 of the TCP wrappers
 library is not ANSI C compatible and does not work with DCMTK (i.e. will not be
@@ -290,8 +299,12 @@ LIBICONV SUPPORT
 
 The libiconv toolkit (www.gnu.org/s/libiconv/) may be used as DCMTK's underlying
 character set conversion implementation.  This release of DCMTK is known to
-compile with the libiconv releases 1.14 to 1.15, although other releases may
-work as well.
+compile with the libiconv release 1.15, although other releases may work as
+well.
+
+When using CMake, a compiled version of the libiconv and libcharset libraries
+and include files must be available during compilation of DCMTK.  See discussion
+on CMake below.
 
 When using Autoconf, if support for libiconv conversion is desired, a compiled
 version of the libiconv library and include files must be available during
@@ -299,16 +312,12 @@ compilation of DCMTK.  Please note that DCMTK also needs the bundled copy of
 libcharset.  By default, DCMTK checks whether libiconv and libcharset are
 installed in the standard path and enables support automatically if present.
 
-When using CMake, a compiled version of the libiconv and libcharset libraries
-and include files must be available during compilation of DCMTK.  See discussion
-on CMake below.
-
 ICU SUPPORT
 -----------
 
 DCMTK supports the International Components for Unicode (ICU) library as an
 alternative to the above mentioned libiconv.  This release of DCMTK is known to
-compile with the ICU releases 58.2 to 59.1, although other releases may work as
+compile with the ICU releases 59.1 to 63.1, although other releases may work as
 well.
 
 The ICU may be easier to integrate on some more modern Linux distributions
@@ -321,14 +330,15 @@ currently integrated) lacks support for converting the following character sets:
 Furthermore, the ICU-based implementation currently does not support
 transliteration.
 
+When using CMake, if support for character set conversion using ICU is desired,
+a compiled version of the ICU libraries and include files must be available
+during compilation of DCMTK.  See discussion on CMake below.
+
 When using Autoconf, if support for character set conversion using ICU is
 desired, a compiled version of the ICU libraries and include files must be
 available during compilation of DCMTK.  By default, DCMTK checks whether ICU is
 installed in the standard path and enables support automatically if present.
 
-When using CMake, if support for character set conversion using ICU is desired,
-a compiled version of the ICU libraries and include files must be available
-during compilation of DCMTK.  See discussion on CMake below.
 
 Support for iconv provided in the C standard library
 ----------------------------------------------------
@@ -340,10 +350,11 @@ used with caution: the iconv implementations from different C standard libraries
 may vary with regards to the supported character sets and functionalities.
 
 If possible, the libiconv implementation should be preferred.  Most importantly
-the iconv implementation provided by the C standard library on OpenIndiana does
-not support conversion to whatever character set the terminal is currently
-using, which we consider essential and, therefore, strongly suggest not to use
-this implementation on OpenIndiana.
+some iconv implementations provided by the C standard library do not support
+conversion to whatever character set the terminal is currently using, which we
+consider essential and, therefore, strongly suggest not to use those
+implementations (there is a new configure test for the issue, which allows to
+query support for this on API level).
 
 Known Issues
 ------------
@@ -411,13 +422,13 @@ BUILDING
 CMake is now the default tool for configuring a DCMTK build. CMake is a
 cross-platform, open-source make system which can be used to control the
 software compilation process using simple configuration files.  CMake can be
-obtained free of charge from http://www.cmake.org/.  For configuring the DCMTK,
+obtained free of charge from https://cmake.org/.  For configuring the DCMTK,
 the toolkit contains corresponding "CMakeLists.txt" files in all necessary
 directories.  In detail, these "CMakeLists.txt" files will serve as an input to
 CMake which will generate suitable build files for all of DCMTK's projects from
 these files.
 
-DCMTK 3.6.3 requires CMake version 2.8.5 or later.  We recommend using the
+DCMTK 3.6.4 requires CMake version 2.8.5 or later.  We recommend using the
 latest stable release of CMake (currently version 3.10.2) since newer versions
 of CMake often provide better output in case of errors and are generally easier
 to use (for example by providing better support for detecting the availability
@@ -426,7 +437,7 @@ system provides with its package manager.
 
 More info about building the DCMTK with CMake can be found in DCMTK's wiki:
 
-  http://support.dcmtk.org/wiki/dcmtk/howto/cmakeconfiguration
+  https://support.dcmtk.org/wiki/dcmtk/howto/cmakeconfiguration
 
 CMake and shared libraries
 --------------------------
@@ -490,7 +501,7 @@ Microsoft Windows with CMake
 Using CMake is the only supported way to compile DCMTK for Windows.  For being
 able to do so, perform the following steps to install CMake on your machine:
 
-1. Go to http://www.cmake.org/ to download the latest release version of CMake
+1. Go to https://cmake.org/ to download the latest release version of CMake
    for Windows.
 2. Execute the file which was downloaded to install CMake on your machine.
    Follow all install instructions appropriately.
@@ -502,7 +513,7 @@ CMake, perform the following steps:
 1. Go Start -> Programs -> CMake -> "CMake" or "CMake (cmake-gui)" to start the
    CMake utility through which the configuration can be done.
 2. In the entry field "Where is the source code:" enter the directory in which
-   the DCMTK source code resides, e.g. "C:\dcmtk-3.6.3".
+   the DCMTK source code resides, e.g. "C:\dcmtk-3.6.4".
 3. In the entry field "Where to build the binaries:" enter the directory in
    which the libraries and binaries are to be built, e.g. "C:\dcmtk-msvc15".
 4. In the combobox "Build for:" or "Specify the generator for this project:"
@@ -521,15 +532,15 @@ CMake, perform the following steps:
 
      libpng support:
        set "DCMTK_WITH_PNG" to "ON" and
-       set "WITH_LIBPNGINC" e.g. to "C:\libpng-1.6.31"
+       set "WITH_LIBPNGINC" e.g. to "C:\libpng-1.6.35"
 
      libtiff support:
        set "DCMTK_WITH_TIFF" to "ON" and
-       set "WITH_LIBTIFFINC" e.g. to "C:\libtiff-4.0.9"
+       set "WITH_LIBTIFFINC" e.g. to "C:\libtiff-4.0.10"
 
      OpenSSL support:
        set "DCMTK_WITH_OPENSSL" to "ON" and
-       set "WITH_OPENSSLINC" e.g. to "C:\openssl-1.1.0g"
+       set "WITH_OPENSSLINC" e.g. to "C:\openssl-1.1.0j"
 
      zlib support:
        set "DCMTK_WITH_ZLIB" to "ON" and
@@ -594,7 +605,7 @@ CMake, perform the following steps:
    The debug versions of all libraries must be compiled for the multithread
    debug version of the runtime (/MTd), the release version must be compiled
    for the non-debug multithread runtime (/MT).  Precompiled versions of all
-   libraries can be downloaded from http://dicom.offis.de/dcmtk#lib-win.)
+   libraries can be downloaded from https://www.dcmtk.org/dcmtk#lib-win.
 
 7. Go "Configure" a second time.  (CMake will adjust the configuration
    according to the displayed specifications.)
@@ -658,17 +669,17 @@ The typical way to build DCMTK on Unix like systems with CMake is as follows
 
     mkdir dcmtk-gcc-`g++ -dumpversion`
     cd dcmtk-gcc-<TAB>
-    cmake ../dcmtk-3.6.3
+    cmake ../dcmtk-3.6.4
     make -j8
-    make DESTDIR=../dcmtk-3.6.3-install install
+    make DESTDIR=../dcmtk-3.6.4-install install
 
 The above commands assume that the DCMTK source code was extracted to the
-current working directory into a folder named dcmtk-3.6.3 and that the GNU gcc
+current working directory into a folder named dcmtk-3.6.4 and that the GNU gcc
 compiler will be used (note that clang++ -dumpversion will give wrong results).
 DCMTK will be configured using CMake with the default options, detecting and
 including all available support libraries and then compiled using eight CPU
 cores (adjust as needed).  The result will be installed to the directory
-"dcmtk-3.6.3-install" next to the source code directory.
+"dcmtk-3.6.4-install" next to the source code directory.
 
 
 HTML DOCUMENTATION AND MAN PAGES
@@ -677,7 +688,7 @@ HTML DOCUMENTATION AND MAN PAGES
 Most DCMTK modules have been documented with Doxygen (www.doxygen.org), a free
 source code documentation system similar to Javadoc.  Unix users who have
 Doxygen installed can create a hypertext documentation with "make html" in the
-"dcmtk-3.6.3" or "doxygen" directory; Windows and other CMake users should
+"dcmtk-3.6.4" or "doxygen" directory; Windows and other CMake users should
 build the "DOXYGEN" subproject.  A project file for Microsoft's HTML Help
 Workshop can also be generated allowing to create a single CHM file (compressed
 HTML) from the documentation.  Other output formats (e.g. LaTeX) can be enabled
@@ -752,8 +763,8 @@ For more information, call this program with the --help option.
 BUILDING (Unix with Autoconf)
 =============================
 
-Configuring a DCMTK build with GNU Autoconf has been deprecated with this DCMTK
-release 3.6.3 and will be removed in future releases. However, you might still
+Configuring a DCMTK build with GNU Autoconf has been deprecated with DCMTK
+release 3.6.4 and will be removed in future releases.  However, you might still
 use Autoconf with this release if you prefer it for whatever reason:
 
 You do not need to obtain GNU Autoconf to compile and install this software.
@@ -761,7 +772,7 @@ All the necessary configure scripts are included in this distribution.  The
 configure scripts examine your system capabilities and automatically generate
 include files and Makefiles.
 
-Perform the following steps from the top-level (dcmtk-3.6.3) directory to
+Perform the following steps from the top-level (dcmtk-3.6.4) directory to
 compile and install the software:
 
 Step 1:
@@ -785,11 +796,11 @@ in which OpenSSL is installed.  This is usually the directory that has been
 used as --prefix when compiling and installing OpenSSL.
 
 For example, if you wish to enable the security enhancements, and OpenSSL is
-installed in "/usr/local/apps/openssl-1.1.0g", then you should start configure
+installed in "/usr/local/apps/openssl-1.1.0j", then you should start configure
 as:
 
     ./configure --ignore-deprecation
-                --with-opensslinc=/usr/local/apps/openssl-1.1.0g
+                --with-opensslinc=/usr/local/apps/openssl-1.1.0j
 
 Configure will assume that the OpenSSL include files are installed in
 "/usr/local/apps/openssl-1.1.0g/include" and will expect the library in
@@ -802,13 +813,13 @@ path):
 
     ./configure --ignore-deprecation
                 --with-libzlibinc=/usr/local/apps/zlib-1.2.11
-                --with-libtiffinc=/usr/local/apps/libtiff-4.0.9
-                --with-libpnginc=/usr/local/apps/libpng-1.6.31
+                --with-libtiffinc=/usr/local/apps/libtiff-4.0.10
+                --with-libpnginc=/usr/local/apps/libpng-1.6.35
                 --with-libxmlinc=/usr/local/apps/libxml2-2.9.7
                 --with-libwrapinc=/usr/local/apps/tcp_wrappers-7.6
                 --with-libiconvinc=/usr/local/apps/libiconv-1.15
            <or>
-                --with-libicuinc=/usr/local/apps/icu-59.1
+                --with-libicuinc=/usr/local/apps/icu-63.1
 
 Different configure options can be combined in any order.  configure --help
 will print a list of all existing configure options.  configure --help=short
@@ -899,7 +910,7 @@ environment variables are listed in the output of configure --help.
 If the configure script fails you may have to change the configuration settings
 in the config directory.  See the "config/docs" directory for more information.
 
-See also the FAQ at http://forum.dcmtk.org/faq for more hints.
+See also the FAQ at https://forum.dcmtk.org/faq for more hints.
 
 ---------
 
@@ -908,4 +919,4 @@ Have fun.
 M. Eichelberg, J. Riesmeier, M. Onken, J. Schlamelcher
 DCMTK Development Team, Oldenburg, Germany.
 
-Last revised: 2018-02-05 (Schlamelcher)
+Last revised: 2018-11-29 (Schlamelcher)
diff --git a/VERSION b/VERSION
index 4a788a01dad42913228f213ad78fbb1fb8cb0928..0f44168a4d54427731b95473ed03e4730fe645b6 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.6.3
+3.6.4
index 53579a1b5f58ed1032b019c20cd0a7478640bf41..9578c3547314aa73921e6ab24122d14ea66b7e66 100644 (file)
@@ -1,5 +1,5 @@
 # declare project
-PROJECT(config)
+project(config)
 
 # recurse into subdirectories
-ADD_SUBDIRECTORY(docs)
+add_subdirectory(docs)
index 6e279d1bf71fc9c297dc80a8bba9cc13c05e9da2..fcf888f6fbcb0f00512e56a0deed40f12769ea9c 100644 (file)
@@ -1386,6 +1386,24 @@ fi
 ])
 
 
+dnl AC_CXX_NOTHROW_DELETE checks if the compiler supports non-throwing delete using
+dnl std::nothrow.
+
+AC_DEFUN([AC_CXX_STATIC_ASSERT],
+[AH_TEMPLATE([HAVE_STATIC_ASSERT], [Define if the compiler supports static_assert])
+AC_CACHE_CHECK(whether the compiler supports static_assert,
+ac_cv_cxx_static_assert,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <cassert>],[static_assert(true, "good")],
+ ac_cv_cxx_static_assert=yes, ac_cv_cxx_static_assert=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_static_assert" = yes; then
+  AC_DEFINE(HAVE_STATIC_ASSERT,, [Define if the compiler supports static_assert])
+fi
+])
+
 dnl AC_LIBTIFF_LZW_COMPRESSION checks if libtiff supports LZW compression.
 
 AC_DEFUN([AC_LIBTIFF_LZW_COMPRESSION],
index d00cd4da8c0df50f00066289392a4469f28d1964..319aee01b3a5e4bd8c501080ed9ec189f61eb6d5 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dcmtk 3.6.3.
+# Generated by GNU Autoconf 2.69 for dcmtk 3.6.4.
 #
 # Report bugs to <bugs@dcmtk.org>.
 #
@@ -579,9 +579,9 @@ MAKEFLAGS=
 
 # Identity of this package.
 PACKAGE_NAME='dcmtk'
-PACKAGE_TARNAME='dcmtk-3.6.3'
-PACKAGE_VERSION='3.6.3'
-PACKAGE_STRING='dcmtk 3.6.3'
+PACKAGE_TARNAME='dcmtk-3.6.4'
+PACKAGE_VERSION='3.6.4'
+PACKAGE_STRING='dcmtk 3.6.4'
 PACKAGE_BUGREPORT='bugs@dcmtk.org'
 PACKAGE_URL='http://www.dcmtk.org/'
 
@@ -1311,7 +1311,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures dcmtk 3.6.3 to adapt to many kinds of systems.
+\`configure' configures dcmtk 3.6.4 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1376,7 +1376,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of dcmtk 3.6.3:";;
+     short | recursive ) echo "Configuration of dcmtk 3.6.4:";;
    esac
   cat <<\_ACEOF
 
@@ -1545,7 +1545,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-dcmtk configure 3.6.3
+dcmtk configure 3.6.4
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2405,7 +2405,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by dcmtk $as_me 3.6.3, which was
+It was created by dcmtk $as_me 3.6.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2827,9 +2827,9 @@ ac_config_headers="$ac_config_headers include/dcmtk/config/osconfig.h"
 
 
 
-PACKAGE_VERSION_NUMBER=363
+PACKAGE_VERSION_NUMBER=364
 PACKAGE_VERSION_SUFFIX=""
-PACKAGE_DATE="2018-02-05"
+PACKAGE_DATE="2018-11-29"
 
 
 cat >>confdefs.h <<_ACEOF
@@ -6722,6 +6722,52 @@ $as_echo "#define HAVE_NOTHROW_DELETE /**/" >>confdefs.h
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports static_assert" >&5
+$as_echo_n "checking whether the compiler supports static_assert... " >&6; }
+if ${ac_cv_cxx_static_assert+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <cassert>
+int
+main ()
+{
+static_assert(true, "good")
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_cxx_static_assert=yes
+else
+  ac_cv_cxx_static_assert=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_static_assert" >&5
+$as_echo "$ac_cv_cxx_static_assert" >&6; }
+if test "$ac_cv_cxx_static_assert" = yes; then
+
+$as_echo "#define HAVE_STATIC_ASSERT /**/" >>confdefs.h
+
+fi
+
+
 
 DEBUG="-DNDEBUG"
 DEBUGCXXFLAGS=
@@ -8353,6 +8399,18 @@ fi
 
 done
 
+for ac_header in streambuf.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "streambuf.h" "ac_cv_header_streambuf_h" "$ac_includes_default"
+if test "x$ac_cv_header_streambuf_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STREAMBUF_H 1
+_ACEOF
+
+fi
+
+done
+
 for ac_header in string.h
 do :
   ac_fn_cxx_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
@@ -12952,7 +13010,7 @@ if ${ac_cv_check_std_namespace+:} false; then :
 else
   ac_link_o='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.o $LIBS 1>&5'
 cat > conftest.$ac_ext <<EOF
-#line 12955 "configure"
+#line 13013 "configure"
 #include "confdefs.h"
 
 #include <iostream>
@@ -13424,7 +13482,7 @@ if ${ac_cv_check_class_template+:} false; then :
 else
   ac_link_o='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.o $LIBS 1>&5'
 cat > conftest.$ac_ext <<EOF
-#line 13427 "configure"
+#line 13485 "configure"
 #include "confdefs.h"
 
 template <class T>
@@ -13496,7 +13554,7 @@ if ${ac_cv_check_static_template_method+:} false; then :
 else
   ac_link_o='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.o $LIBS 1>&5'
 cat > conftest.$ac_ext <<EOF
-#line 13499 "configure"
+#line 13557 "configure"
 #include "confdefs.h"
 
 void additive(int & i)
@@ -13568,7 +13626,7 @@ if ${ac_cv_check_function_template+:} false; then :
 else
   ac_link_o='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.o $LIBS 1>&5'
 cat > conftest.$ac_ext <<EOF
-#line 13571 "configure"
+#line 13629 "configure"
 #include "confdefs.h"
 
 template <class T>
@@ -14015,12 +14073,33 @@ $as_echo_n "checking whether to include OpenSSL support... " >&6; }
 if test "${with_openssl+set}" = set; then :
   withval=$with_openssl;  case "$withval" in
   yes)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <openssl/ssl.h>
+int
+main ()
+{
+
+#if OPENSSL_VERSION_NUMBER < 0x10001000L
+#error OpenSSL too old
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
 $as_echo "#define WITH_OPENSSL /**/" >>confdefs.h
 
     OPENSSLLIBS="-lssl -lcrypto $OPENSSLLIBS"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - DCMTK requires OpenSSL version 1.0.1 or newer" >&5
+$as_echo "no - DCMTK requires OpenSSL version 1.0.1 or newer" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     ;;
   *)
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -14029,7 +14108,7 @@ $as_echo "no" >&6; }
   esac
 else
    SAVELIBS="$LIBS"
-  LIBS="$LIBS -lssl -lcrypto"
+  LIBS="$LIBS $OPENSSLLIBS -lssl -lcrypto"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <openssl/ssl.h>
@@ -14042,12 +14121,34 @@ main ()
 }
 _ACEOF
 if ac_fn_cxx_try_link "$LINENO"; then :
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <openssl/ssl.h>
+int
+main ()
+{
+
+#if OPENSSL_VERSION_NUMBER < 0x10001000L
+#error OpenSSL too old
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
 $as_echo "#define WITH_OPENSSL /**/" >>confdefs.h
 
       OPENSSLLIBS="-lssl -lcrypto $OPENSSLLIBS"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - DCMTK requires OpenSSL version 1.0.1 or newer" >&5
+$as_echo "no - DCMTK requires OpenSSL version 1.0.1 or newer" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -15143,6 +15244,77 @@ CHARCONVLIBS=""
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking fixed iconv conversion flags" >&5
+$as_echo_n "checking fixed iconv conversion flags... " >&6; }
+if test "$WITH_STDLIBC_ICONV" != "yes"; then
+    SAVELIBS="$LIBS"
+    LIBS="$LIBS $ICONVLIBS"
+fi
+if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include "tests/iconv.cc"
+_ACEOF
+if ac_fn_cxx_try_run "$LINENO"; then :
+
+
+cat >>confdefs.h <<_ACEOF
+#define DCMTK_FIXED_ICONV_CONVERSION_FLAGS `./conftest$EXEEXT`
+_ACEOF
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
+$as_echo "" >&6; }
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
+$as_echo "unknown" >&6; }
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+if test "$WITH_STDLIBC_ICONV" != "yes"; then
+    LIBS="$SAVELIBS"
+fi
+
+if test "$WITH_STDLIBC_ICONV" == "yes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iconv_open() accepts \"\" as an argument" >&5
+$as_echo_n "checking whether iconv_open() accepts \"\" as an argument... " >&6; }
+    if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include "tests/lciconv.cc"
+_ACEOF
+if ac_fn_cxx_try_run "$LINENO"; then :
+
+
+$as_echo "#define DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING 1" >>confdefs.h
+
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable character set conversion support" >&5
 $as_echo_n "checking whether to enable character set conversion support... " >&6; }
 # Check whether --enable-charconv was given.
@@ -17275,7 +17447,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by dcmtk $as_me 3.6.3, which was
+This file was extended by dcmtk $as_me 3.6.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -17338,7 +17510,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-dcmtk config.status 3.6.3
+dcmtk config.status 3.6.4
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index 5cae189dcb4e2c534b6f4d1dfe16af926f947934..6f58c478eefb7436fea294c1186bbd3af492ac0e 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(dcmtk, 3.6.3, [bugs@dcmtk.org], [dcmtk-3.6.3], [http://www.dcmtk.org/])
+AC_INIT(dcmtk, 3.6.4, [bugs@dcmtk.org], [dcmtk-3.6.4], [http://www.dcmtk.org/])
 AC_PREREQ(2.60)
 AC_CONFIG_SRCDIR(Makefile.in)
 AC_CONFIG_HEADERS(include/dcmtk/config/osconfig.h)
@@ -10,9 +10,9 @@ dnl -------------------------------------------------------
 dnl Additional Package Information
 dnl -------------------------------------------------------
 
-PACKAGE_VERSION_NUMBER=363
+PACKAGE_VERSION_NUMBER=364
 PACKAGE_VERSION_SUFFIX=""
-PACKAGE_DATE="2018-02-05"
+PACKAGE_DATE="2018-11-29"
 
 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_NUMBER,${PACKAGE_VERSION_NUMBER},[Define to the version number of this package.])
 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_SUFFIX,"${PACKAGE_VERSION_SUFFIX}",[Define to the version suffix of this package.])
@@ -317,6 +317,7 @@ AC_CXX_REINTERPRET_CAST
 AC_CXX_STATIC_CAST
 AC_CXX_STD_NOTHROW
 AC_CXX_NOTHROW_DELETE
+AC_CXX_STATIC_ASSERT
 
 dnl -------------------------------------------------------
 dnl Check for Debug Mode
@@ -517,6 +518,7 @@ AC_CHECK_HEADERS(cstdio)
 AC_CHECK_HEADERS(stdio.h)
 AC_CHECK_HEADERS(stdint.h)
 AC_CHECK_HEADERS(stdlib.h)
+AC_CHECK_HEADERS(streambuf.h)
 AC_CHECK_HEADERS(string.h)
 AC_CHECK_HEADERS(strings.h)
 AC_CHECK_HEADERS(strstrea.h)
@@ -987,20 +989,33 @@ AC_ARG_WITH(openssl,
 AS_HELP_STRING([--without-openssl], [don't include OpenSSL support])],
 [ case "$withval" in
   yes)
-    AC_MSG_RESULT(yes)
+      AC_TRY_COMPILE([#include <openssl/ssl.h>], [
+#if OPENSSL_VERSION_NUMBER < 0x10001000L
+#error OpenSSL too old
+#endif
+],
+   [ AC_MSG_RESULT(yes)
     AC_DEFINE(WITH_OPENSSL, , [Define if we are compiling with OpenSSL support.])
-    OPENSSLLIBS="-lssl -lcrypto $OPENSSLLIBS"
+    OPENSSLLIBS="-lssl -lcrypto $OPENSSLLIBS" ],
+    [AC_MSG_RESULT(no - DCMTK requires OpenSSL version 1.0.1 or newer)] )
     ;;
   *)
     AC_MSG_RESULT(no)
     ;;
   esac ],
 [ SAVELIBS="$LIBS"
-  LIBS="$LIBS -lssl -lcrypto"
+  LIBS="$LIBS $OPENSSLLIBS -lssl -lcrypto"
   AC_TRY_LINK([#include <openssl/ssl.h>], [(void) TLSv1_method()],
-    [ AC_MSG_RESULT(yes)
+    [
+      AC_TRY_COMPILE([#include <openssl/ssl.h>], [
+#if OPENSSL_VERSION_NUMBER < 0x10001000L
+#error OpenSSL too old
+#endif
+],
+      [ AC_MSG_RESULT(yes)
       AC_DEFINE(WITH_OPENSSL, , [Define if we are compiling with OpenSSL support.])
       OPENSSLLIBS="-lssl -lcrypto $OPENSSLLIBS" ],
+     [AC_MSG_RESULT(no - DCMTK requires OpenSSL version 1.0.1 or newer)] )],
     [AC_MSG_RESULT(no)])
   LIBS="$SAVELIBS"] )
 
@@ -1394,6 +1409,35 @@ else
 fi
 ])
 
+AC_MSG_CHECKING(fixed iconv conversion flags)
+if test "$WITH_STDLIBC_ICONV" != "yes"; then
+    SAVELIBS="$LIBS"
+    LIBS="$LIBS $ICONVLIBS"
+fi
+AC_RUN_IFELSE(
+    [AC_LANG_SOURCE([[#include "tests/iconv.cc"]])],
+    [
+        AC_DEFINE_UNQUOTED(DCMTK_FIXED_ICONV_CONVERSION_FLAGS, [`./conftest$EXEEXT`], [Try to define the iconv behavior as conversion flags])
+        AC_MSG_RESULT()
+    ],
+    [AC_MSG_RESULT([unknown])]
+)
+if test "$WITH_STDLIBC_ICONV" != "yes"; then
+    LIBS="$SAVELIBS"
+fi
+
+if test "$WITH_STDLIBC_ICONV" == "yes"; then
+    AC_MSG_CHECKING([whether iconv_open() accepts "" as an argument])
+    AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[#include "tests/lciconv.cc"]])],
+        [
+            AC_DEFINE(DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING, 1, [Define if iconv_open() accepts "" as an argument])
+            AC_MSG_RESULT(yes)
+        ],
+        [AC_MSG_RESULT(no)]
+    )
+fi
+
 AC_MSG_CHECKING(whether to enable character set conversion support)
 AC_ARG_ENABLE(charconv,
 [  --enable-charconv=TYPE  enable character set conversion support
index f2d42a1c2696d2af5206fb346cfe89b734115190..c1b2ecd65e164e7daf1f3d9bfb736da5ad148720 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES config.txt dirstruc.txt envvars.txt macros.txt modules.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc)
+install(FILES config.txt dirstruc.txt envvars.txt macros.txt modules.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc)
index a7387886b3fe0614880063b7a336cdc8f6eef017..912c30b1b6c21311787fc0a5f30316241f1a661b 100644 (file)
@@ -46,6 +46,24 @@ DCMTK_BUILD_IN_PROGRESS
     define this macro yourself since this is done automatically by the build
     system.
 
+DCMTK_ENABLE_UNSAFE_VSNPRINTF
+  Affected: ofstd
+  Type of modification: Activates feature
+  Explanation: DCMTK requires the snprintf(3)/vsnprintf(3) function, which
+    was introduced with C99 and may not be supported by very old compilers.
+    As a "last resort", an implementation interally using sprintf/vsprintf
+    can be enabled with this macro, which allows the user to compile DCMTK
+    on platforms that do not have the new functions.
+    The implementation allocates a buffer that is 1 kByte larger than
+    the "size" parameter, formats the string into that buffer, and then
+    uses strlcpy() to copy the formatted string into the output buffer,
+    truncating if necessary.
+    This will work in most cases, since few snprintf calls should overrun
+    their buffer by more than 1K, but it can be easily abused by
+    a malicious attacker to cause a buffer overrun.
+    Therefore, this implementation should only be used as a "last resort"
+    and we strongly advise against using it in production code.
+
 DCMTK_GUI
   Affected: all modules
   Type of modification: Activates experimental or rarely used feature
@@ -335,9 +353,9 @@ USE_NULL_SAFE_OFSTRING
   Type of modification: Activates feature
   Explanation: When this macro is defined, OFString(NULL) results in an
     empty string.  If this macro is not defined, OFString(NULL) causes a
-    NULL pointer dereference.  This macro has no effect when
-    HAVE_STD_STRING is also defined.  Currently, this macro is always defined
-    by DCMTK's Makefiles.  This will change in future releases.
+    NULL pointer dereference.  This macro has no effect when HAVE_STL_STRING
+    is also defined.  Currently, this macro is always defined by DCMTK's
+    Makefiles.  This will change in future releases.
 
 USE_WIN32_CREATE_MUTEX
   Affected: ofstd
@@ -348,6 +366,16 @@ USE_WIN32_CREATE_MUTEX
     cannot be shared across processes. Users who want to revert to the
     behavior of older DCMTK releases can define this macro.
 
+USE_WIN32_READ_WRITE_LOCK_HELPER
+  Affected: ofstd
+  Type of modification: Re-activated behavior of earlier DCMTK releases
+  Explanation: Starting with DCMTK 3.6.4, the Win32 version of the
+    OFReadWriteLock class uses Slim Reader/Writer (SRW) Locks,
+    which are available since Windows Vista, instead of the older
+    implementation based on a Mutex, a Semaphore and a counter, because
+    SRW locks are much faster. Users who want to revert to the
+    behavior of older DCMTK releases can define this macro.
+
 USING_STD_NAMESPACE
   Affected: all modules
   Type of modification: Re-activated behavior of earlier DCMTK releases
index fac7b2266a3f0029745b73bb87a91f993e451010..566fd5cca96a3aadb93cc5f7680a6ee05adb262c 100644 (file)
 /* Select LFS mode (defined above) that shall be used or don't define it */
 #undef DCMTK_ENABLE_LFS
 
+/* Try to define the iconv behavior as conversion flags */
+#undef DCMTK_FIXED_ICONV_CONVERSION_FLAGS
+
 /* Define if your system has a usable <poll.h> */
 #undef DCMTK_HAVE_POLL
 
 /* Define the DCMTK default path. */
 #undef DCMTK_PREFIX
 
+/* Define if iconv_open() accepts "" as an argument */
+#undef DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING
+
 /* Define the default data dictionary path for the dcmdata library package. */
 #undef DCM_DICT_DEFAULT_PATH
 
@@ -738,6 +744,9 @@ typedef unsigned short ushort;
 /* Define to 1 if you have the `stat' function. */
 #undef HAVE_STAT
 
+/* Define if the compiler supports static_assert */
+#undef HAVE_STATIC_ASSERT
+
 /* define if the compiler supports static_cast<> */
 #undef HAVE_STATIC_CAST
 
@@ -811,6 +820,9 @@ typedef unsigned short ushort;
 /* Define to 1 if you have the `strdup' function. */
 #undef HAVE_STRDUP
 
+/* Define to 1 if you have the <streambuf.h> header file. */
+#undef HAVE_STREAMBUF_H
+
 /* Define to 1 if you have the `strerror' function. */
 #undef HAVE_STRERROR
 
index 27260d5b1d4fa12d22955290ee604be45901df29..f3c69db32774ba880d6f644b3be2db8d25af81b3 100755 (executable)
@@ -28,7 +28,7 @@ for dir in $tmpmodules; do
        fi
 done
 
-modules=`echo $modules | sed -e "s/config//g" | sed -e "s/doxygen//g" | sed -e "s/CVS//g"`
+modules=`echo $modules | sed -e "s/config//g" | sed -e "s/doxygen//g"`
 for module in config $modules; do
        makeall="$makeall ${module}-all"
 if test $module != config ; then
@@ -211,7 +211,7 @@ if test -d config ; then
                        fi
                done
        fi
-       modules=\`echo \$modules | sed -e "s/config//g" | sed -e "s/CVS//g"\`
+       modules=\`echo \$modules | sed -e "s/config//g"\`
        modules="config \$modules doxygen"
 else
        echo "Cannot find configure directory (config or ../config)"
diff --git a/config/tests/iconv.cc b/config/tests/iconv.cc
new file mode 100644 (file)
index 0000000..80754a6
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  config
+ *
+ *  Author:  Jan Schlamelcher
+ *
+ *  Purpose: Analyze behavior of an iconv implementation.
+ */
+
+#include <iconv.h>
+#include <stdio.h>
+
+int main()
+{
+    char input[2] = { '\366', '\0' };
+    char output[8];
+    iconv_t i = iconv_open( "ASCII", "ISO-8859-1" );
+    if( (iconv_t)-1 != i )
+    {
+        iconv( i, 0, 0, 0, 0 );
+#ifdef LIBICONV_SECOND_ARGUMENT_CONST
+        const
+#endif
+        char* in = input;
+        char* out = output;
+        size_t ins = 1;
+        size_t outs = 8;
+        const size_t result = iconv( i, &in, &ins, &out, &outs );
+        iconv_close( i );
+        if( ~(size_t)0 == result )
+        {
+            printf( "AbortTranscodingOnIllegalSequence" );
+            return 0;
+        }
+        if( 8 == outs ) // output buffer not touched
+        {
+            printf( "DiscardIllegalSequences" );
+            return 0;
+        }
+    }
+    return 1;
+}
diff --git a/config/tests/lciconv.cc b/config/tests/lciconv.cc
new file mode 100644 (file)
index 0000000..31ad6fe
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  config
+ *
+ *  Author:  Jan Schlamelcher
+ *
+ *  Purpose: Test whether an STDLIBC iconv defines a default encoding.
+ */
+
+#include <iconv.h>
+
+int main()
+{
+    if ((iconv_t)-1 == iconv_open( "ASCII", "" ))
+        return 1;
+    if ((iconv_t)-1 == iconv_open( "", "ASCII" ))
+        return 1;
+    return 0;
+}
index ded9ea97af60fce417a12c3dc9e632c3146363af..a526bebed4ccb69210d2f1202dbc16e7b90c6f12 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmdata)
+project(dcmdata)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
+include_directories("${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc libi2d apps include docs data tests)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc libi2d apps include docs data tests)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 2f7ba60fd6b47f5453ef28af17a78287d38ffc47..4d896d4e9c0049e04a876d1e117e2b3505528520 100644 (file)
@@ -1,16 +1,16 @@
 # declare additional include directories
-INCLUDE_DIRECTORIES(${LIBXML_INCDIR})
+include_directories(${LIBXML_INCDIR})
 
 # declare executables
-FOREACH(PROGRAM dcm2xml dcmconv dcmcrle dcmdrle dcmdump dcmftest dcmgpdir dump2dcm xml2dcm pdf2dcm dcm2pdf img2dcm dcm2json)
+foreach(PROGRAM dcm2xml dcmconv dcmcrle dcmdrle dcmdump dcmftest dcmgpdir dump2dcm xml2dcm stl2dcm pdf2dcm dcm2pdf img2dcm dcm2json cda2dcm)
   DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
-ENDFOREACH(PROGRAM)
+endforeach()
 DCMTK_ADD_EXECUTABLE(dcmodify dcmodify mdfconen mdfdsman)
 
 # make sure executables are linked to the corresponding libraries
-FOREACH(PROGRAM dcm2xml dcmconv dcmcrle dcmdrle dcmdump dcmgpdir dcmodify dump2dcm xml2dcm pdf2dcm dcm2pdf img2dcm dcm2json)
+foreach(PROGRAM dcm2xml dcmconv dcmcrle dcmdrle dcmdump dcmgpdir dcmodify dump2dcm xml2dcm stl2dcm pdf2dcm dcm2pdf img2dcm dcm2json cda2dcm)
   DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmdata oflog ofstd)
-ENDFOREACH(PROGRAM)
+endforeach()
 
 DCMTK_TARGET_LINK_MODULES(dcmftest ofstd)
 DCMTK_TARGET_LINK_LIBRARIES(xml2dcm ${LIBXML_LIBS})
index b0d4f217f6f802a7e740acb2504b0c43439ee9e2..ca174d18f0fd6c4675b59163762eb1d3b934ed56 100644 (file)
@@ -1,3 +1,90 @@
+cda2dcm.o: cda2dcm.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
+ ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
+ ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \
+ ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcdicent.h \
+ ../include/dcmtk/dcmdata/dchashdi.h ../include/dcmtk/dcmdata/dcdict.h \
+ ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcobject.h \
+ ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcelem.h \
+ ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dclist.h \
+ ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcmetinf.h \
+ ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcsequen.h \
+ ../include/dcmtk/dcmdata/dcfilefo.h ../include/dcmtk/dcmdata/dcdicdir.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmap.h \
+ ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \
+ ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \
+ ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \
+ ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \
+ ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdate.h \
+ ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
+ ../../ofstd/include/dcmtk/ofstd/oftime.h \
+ ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \
+ ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \
+ ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \
+ ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \
+ ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \
+ ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \
+ ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \
+ ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \
+ ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \
+ ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \
+ ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \
+ ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \
+ ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/cmdlnarg.h \
+ ../include/dcmtk/dcmdata/dccodec.h ../include/dcmtk/dcmdata/dcencdoc.h \
+ ../include/dcmtk/dcmdata/dcpath.h \
+ ../../ofstd/include/dcmtk/ofstd/ofxml.h
 dcm2json.o: dcm2json.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -34,6 +121,7 @@ dcm2json.o: dcm2json.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -43,6 +131,7 @@ dcm2json.o: dcm2json.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
@@ -118,6 +207,7 @@ dcm2pdf.o: dcm2pdf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -127,6 +217,7 @@ dcm2pdf.o: dcm2pdf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
@@ -201,6 +292,7 @@ dcm2xml.o: dcm2xml.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -210,6 +302,7 @@ dcm2xml.o: dcm2xml.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
@@ -284,6 +377,7 @@ dcmconv.o: dcmconv.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -293,6 +387,7 @@ dcmconv.o: dcmconv.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
@@ -368,6 +463,7 @@ dcmcrle.o: dcmcrle.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -377,6 +473,7 @@ dcmcrle.o: dcmcrle.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
@@ -451,6 +548,7 @@ dcmdrle.o: dcmdrle.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -460,6 +558,7 @@ dcmdrle.o: dcmdrle.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
@@ -534,6 +633,7 @@ dcmdump.o: dcmdump.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -543,6 +643,7 @@ dcmdump.o: dcmdump.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
@@ -626,8 +727,10 @@ dcmftest.o: dcmftest.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -671,6 +774,7 @@ dcmgpdir.o: dcmgpdir.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -680,6 +784,7 @@ dcmgpdir.o: dcmgpdir.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
@@ -755,6 +860,7 @@ dcmodify.o: dcmodify.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -763,6 +869,7 @@ dcmodify.o: dcmodify.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcpath.h ../include/dcmtk/dcmdata/dcdatset.h \
@@ -787,9 +894,11 @@ dump2dcm.o: dump2dcm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h ../include/dcmtk/dcmdata/dctk.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dctk.h \
  ../include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -863,17 +972,19 @@ img2dcm.o: img2dcm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcfilefo.h \
  ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
@@ -957,6 +1068,7 @@ mdfconen.o: mdfconen.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -965,6 +1077,7 @@ mdfconen.o: mdfconen.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h mdfdsman.h \
  ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctk.h \
@@ -1041,6 +1154,7 @@ mdfdsman.o: mdfdsman.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1049,7 +1163,7 @@ mdfdsman.o: mdfdsman.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcistrma.h \
@@ -1122,6 +1236,94 @@ pdf2dcm.o: pdf2dcm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
+ ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
+ ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \
+ ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcdicent.h \
+ ../include/dcmtk/dcmdata/dchashdi.h ../include/dcmtk/dcmdata/dcdict.h \
+ ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcobject.h \
+ ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcelem.h \
+ ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dclist.h \
+ ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcmetinf.h \
+ ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcsequen.h \
+ ../include/dcmtk/dcmdata/dcfilefo.h ../include/dcmtk/dcmdata/dcdicdir.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmap.h \
+ ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \
+ ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \
+ ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \
+ ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \
+ ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdate.h \
+ ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
+ ../../ofstd/include/dcmtk/ofstd/oftime.h \
+ ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \
+ ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \
+ ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \
+ ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \
+ ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \
+ ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \
+ ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \
+ ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \
+ ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \
+ ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \
+ ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \
+ ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \
+ ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/cmdlnarg.h \
+ ../include/dcmtk/dcmdata/dccodec.h ../include/dcmtk/dcmdata/dcencdoc.h \
+ ../include/dcmtk/dcmdata/dcpath.h \
+ ../../ofstd/include/dcmtk/ofstd/ofxml.h
+stl2dcm.o: stl2dcm.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1131,6 +1333,7 @@ pdf2dcm.o: pdf2dcm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
@@ -1168,7 +1371,9 @@ pdf2dcm.o: pdf2dcm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \
  ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \
  ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/cmdlnarg.h \
- ../include/dcmtk/dcmdata/dccodec.h
+ ../include/dcmtk/dcmdata/dccodec.h ../include/dcmtk/dcmdata/dcencdoc.h \
+ ../include/dcmtk/dcmdata/dcpath.h \
+ ../../ofstd/include/dcmtk/ofstd/ofxml.h
 xml2dcm.o: xml2dcm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -1205,6 +1410,7 @@ xml2dcm.o: xml2dcm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1214,6 +1420,7 @@ xml2dcm.o: xml2dcm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
index b91ee5810ed41b96796bf92ccc8f968ddb074e81..2a4b50b423b86bfde35588adc416c6e029e0628c 100644 (file)
@@ -23,10 +23,10 @@ LIBI2D = -li2d
 
 objs = dcmftest.o dcmconv.o dcmdump.o dump2dcm.o dcmgpdir.o dcm2xml.o \
        xml2dcm.o dcmcrle.o dcmdrle.o dcmodify.o mdfdsman.o mdfconen.o \
-       pdf2dcm.o dcm2pdf.o img2dcm.o dcm2json.o
+       cda2dcm.o stl2dcm.o pdf2dcm.o dcm2pdf.o img2dcm.o dcm2json.o
 
 progs = dcmftest dcmconv dcmdump dump2dcm dcmgpdir dcm2xml xml2dcm dcmcrle \
-       dcmdrle dcmodify pdf2dcm dcm2pdf img2dcm dcm2json
+       dcmdrle dcmodify pdf2dcm stl2dcm cda2dcm dcm2pdf img2dcm dcm2json
 
 
 all: $(progs)
@@ -62,9 +62,15 @@ xml2dcm: xml2dcm.o
 dcmodify: dcmodify.o mdfconen.o mdfdsman.o
        $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o mdfconen.o mdfdsman.o $(LOCALLIBS) $(LIBS)
 
+stl2dcm: stl2dcm.o
+       $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS)
+
 pdf2dcm: pdf2dcm.o
        $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS)
 
+cda2dcm: cda2dcm.o
+       $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS)
+
 dcm2pdf: dcm2pdf.o
        $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS)
 
diff --git a/dcmdata/apps/cda2dcm.cc b/dcmdata/apps/cda2dcm.cc
new file mode 100755 (executable)
index 0000000..f4bdae9
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  dcmdata
+ *
+ *  Author:  Pedro Arizpe
+ *
+ *  Purpose: Encapsulate CDA file into a DICOM file
+ *
+ */
+
+#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first*/
+
+#define INCLUDE_CSTDLIB
+#define INCLUDE_CSTDIO
+#define INCLUDE_CSTRING
+#include "dcmtk/ofstd/ofstdinc.h"
+#include "dcmtk/dcmdata/dctk.h"
+#include "dcmtk/dcmdata/cmdlnarg.h"
+#include "dcmtk/ofstd/ofconapp.h"
+#include "dcmtk/dcmdata/dcuid.h"       /* for dcmtk version name */
+#include "dcmtk/ofstd/ofstd.h"
+#include "dcmtk/ofstd/ofdatime.h"
+#include "dcmtk/dcmdata/dccodec.h"
+#include "dcmtk/dcmdata/dcencdoc.h"
+
+BEGIN_EXTERN_C
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>       /* for O_RDONLY */
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>   /* required for sys/stat.h */
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>    /* for stat, fstat */
+#endif
+END_EXTERN_C
+
+#ifdef WITH_ZLIB
+#include <zlib.h>        /* for zlibVersion() */
+#endif
+
+#define OFFIS_CONSOLE_APPLICATION "cda2dcm"
+
+static OFLogger cda2dcmLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION);
+
+static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v"
+OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $";
+
+int main(int argc, char *argv[])
+{
+  OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Encapsulate CDA file into DICOM format", rcsid);
+  OFCommandLine cmd;
+  int errorCode = EXITCODE_NO_ERROR;
+  OFCondition result = EC_Normal;
+  DcmFileFormat fileformat;
+  DcmEncapsulatedDocument encapsulator;
+  OFLOG_TRACE(cda2dcmLogger, "Including necessary options");
+  encapsulator.addCDACommandlineOptions(cmd);
+  OFLOG_TRACE(cda2dcmLogger, "Evaluating command line");
+  prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION);
+
+  if (app.parseCommandLine(cmd, argc, argv)) {
+    OFLOG_TRACE (cda2dcmLogger, "Checking exclusive options first");
+    if (cmd.hasExclusiveOption())
+    {
+      if (cmd.findOption("--version"))
+      {
+        app.printHeader(OFTrue /*print host identifier*/);
+        COUT << OFendl << "External libraries used: ";
+#ifdef WITH_ZLIB
+        COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl;
+#else
+        COUT << " none" << OFendl;
+#endif
+        return EXITCODE_NO_ERROR;
+      }
+    }
+    encapsulator.parseArguments(app, cmd);
+  }
+  //print resource identifier
+  OFLOG_DEBUG(cda2dcmLogger, rcsid << OFendl);
+
+  OFLOG_DEBUG(cda2dcmLogger, "making sure data dictionary is loaded");
+  if (!dcmDataDict.isDictionaryLoaded())
+  {
+    OFLOG_WARN(cda2dcmLogger, "no data dictionary loaded, check environment variable: "
+      << DCM_DICT_ENVIRONMENT_VARIABLE);
+  }
+  OFLOG_TRACE(cda2dcmLogger, "Creating identifiers (and reading series data)");
+  result = encapsulator.createIdentifiers(cda2dcmLogger);
+  if (result.bad())
+  {
+    OFLOG_FATAL(cda2dcmLogger, "There was an error while reading the series data");
+    return EXITCODE_INVALID_INPUT_FILE;
+  }
+  OFLOG_DEBUG(cda2dcmLogger, "Fetching CDA Data");
+  errorCode = encapsulator.getCDAData(encapsulator.getInputFileName().c_str(), cda2dcmLogger);
+  if (errorCode != EXITCODE_NO_ERROR)
+  {
+    OFLOG_ERROR(cda2dcmLogger, "There was a problem with the CDA File");
+    return errorCode;
+  }
+  else
+  {
+  OFLOG_INFO(cda2dcmLogger, "creating encapsulated CDA object");
+  errorCode = encapsulator.insertEncapsulatedDocument(fileformat.getDataset(), cda2dcmLogger);
+  }
+  if (errorCode != EXITCODE_NO_ERROR)
+  {
+    OFLOG_ERROR(cda2dcmLogger, "unable to create CDA encapsulation to DICOM format");
+    return errorCode;
+  }
+  OFLOG_INFO(cda2dcmLogger, "Generating an instance number that is guaranteed to be unique within a series.");
+  result = encapsulator.createHeader(fileformat.getDataset(), cda2dcmLogger);
+  if (result.bad())
+  {
+    OFLOG_ERROR(cda2dcmLogger, "unable to create DICOM header: " << result.text());
+    return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+  }
+  OFLOG_INFO(cda2dcmLogger, "writing encapsulated CDA object as file " << encapsulator.getOutputFileName());
+
+  OFLOG_INFO(cda2dcmLogger, "Check if new output transfer syntax is possible");
+
+  DcmXfer opt_oxferSyn(encapsulator.getTransferSyntax());
+
+  fileformat.getDataset()->chooseRepresentation(encapsulator.getTransferSyntax(), NULL);
+  if (fileformat.getDataset()->canWriteXfer(encapsulator.getTransferSyntax()))
+  {
+    OFLOG_INFO(cda2dcmLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written");
+  }
+  else {
+    OFLOG_ERROR(cda2dcmLogger, "No conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!");
+    return EXITCODE_COMMANDLINE_SYNTAX_ERROR;
+  }
+  OFLOG_INFO(cda2dcmLogger, "Checking for DICOM key overriding");
+  result = encapsulator.applyOverrideKeys(fileformat.getDataset());
+  if (result.bad())
+  {
+    OFLOG_ERROR(cda2dcmLogger, "There was a problem while overriding a key:" << OFendl
+      << result.text());
+    return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+  }
+  OFLOG_INFO(cda2dcmLogger, "write converted DICOM file with metaheader");
+  result = encapsulator.saveFile(fileformat);
+  if (result.bad())
+  {
+    OFLOG_ERROR(cda2dcmLogger, result.text() << ": writing file: " << encapsulator.getOutputFileName());
+    return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+  }
+
+  OFLOG_INFO(cda2dcmLogger, "CDA encapsulation successful");
+
+  return EXITCODE_NO_ERROR;
+}
index 601143c3a3f3c221187fa69ab0ea7f7ef017225d..8acab6610be821856d317225028fcf3107752438 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -70,7 +70,7 @@ static DcmTagKey parseTagKey(const char *tagName)
     } else {
       tagKey = dicent->getKey();
     }
-    dcmDataDict.unlock();
+    dcmDataDict.rdunlock();
     return tagKey;
   } else     /* tag name has format "gggg,eeee" */
   {
@@ -616,7 +616,7 @@ int main(int argc, char *argv[])
         /* reporting a fatal error and returning with an error code follows next */
     }
 
-    if (dataset->canWriteXfer(opt_oxfer))
+    if (error.good() && dataset->canWriteXfer(opt_oxfer))
     {
         OFLOG_INFO(dcmconvLogger, "output transfer syntax " << opt_oxferSyn.getXferName() << " can be written");
     } else {
index 511f2f43d863c3c18fcb0a7f68b131c28219a2d4..0d773dbd7c9d27f07bfe9450bf05560b7e8eb257 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2002-2017, OFFIS e.V.
+ *  Copyright (C) 2002-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -297,8 +297,7 @@ int main(int argc, char *argv[])
 
     DcmXfer opt_oxferSyn(opt_oxfer);
 
-    dataset->chooseRepresentation(opt_oxfer, NULL);
-    if (dataset->canWriteXfer(opt_oxfer))
+    if (dataset->chooseRepresentation(opt_oxfer, NULL).good() && dataset->canWriteXfer(opt_oxfer))
     {
         OFLOG_INFO(dcmcrleLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written");
     } else {
index 3ba4643225003ea2dc0193c580b3235ebdb61a66..cf751eb755f6b8cdfb6c2f8f4d2c16cfb44f0ce8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -96,7 +96,7 @@ static DcmTagKey parseTagKey(const char *tagName)
         } else {
             tagKey = dicent->getKey();
         }
-        dcmDataDict.unlock();
+        dcmDataDict.rdunlock();
         return tagKey;
     } else     /* tag name has format "gggg,eeee" */
     {
@@ -120,20 +120,23 @@ static OFBool addPrintTagName(const char *tagName)
         const DcmDictEntry *dicent = globalDataDict.findEntry(tagName);
         if (dicent == NULL) {
             OFLOG_WARN(dcmdumpLogger, "unrecognized tag name: '" << tagName << "'");
-            dcmDataDict.unlock();
+            dcmDataDict.rdunlock();
             return OFFalse;
         } else {
             /* note for later */
             printTagKeys[printTagCount] = new DcmTagKey(dicent->getKey());
         }
-        dcmDataDict.unlock();
+        dcmDataDict.rdunlock();
     } else {
         /* tag name has format xxxx,xxxx */
         /* do not lookup in dictionary, tag could be private */
         printTagKeys[printTagCount] = NULL;
     }
 
-    printTagNames[printTagCount] = strcpy(OFstatic_cast(char*, malloc(strlen(tagName)+1)), tagName);
+    size_t buflen = strlen(tagName)+1;
+    char *buf = OFstatic_cast(char*, malloc(buflen));
+    OFStandard::strlcpy(buf, tagName, buflen);
+    printTagNames[printTagCount] = buf;
     printTagCount++;
     return OFTrue;
 }
index 974a9f1ed923790f204f32471b459c4c25a71b98..61187c9a65aae1b2aa67c5bdd3f104e9de08cfb3 100644 (file)
@@ -105,7 +105,7 @@ static DcmTagKey getTagKeyFromDictionary(OFString tag)
     {
         key = dicent->getKey();
     }
-    dcmDataDict.unlock();
+    dcmDataDict.rdunlock();
     return key;
 }
 
@@ -724,7 +724,7 @@ OFBool MdfDatasetManager::isTagInDictionary(const DcmTagKey &search_key)
     const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock();
     const DcmDictEntry *dicent = globalDataDict.findEntry(search_key,NULL);
     // successful lookup in dictionary -> translate to tag and return
-    dcmDataDict.unlock();
+    dcmDataDict.rdunlock();
     if (dicent)
         return OFTrue;
     else return OFFalse;
index 4b72e2cc14346c93202e7782286e8b62671eca2e..7c10f5ba297a3e99e38a30c008f3b9725702bc12 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2005-2017, OFFIS e.V.
+ *  Copyright (C) 2005-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
  *
  *  Module:  dcmdata
  *
- *  Author:  Marco Eichelberg
+ *  Author:  Marco Eichelberg, Pedro Arizpe
  *
- *  Purpose: Convert PDF file to DICOM format
+ *  Purpose: Encapsulate PDF file into a DICOM file
  *
  */
 
-
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 
 #define INCLUDE_CSTDLIB
 #define INCLUDE_CSTDIO
 #define INCLUDE_CSTRING
 #include "dcmtk/ofstd/ofstdinc.h"
+#include "dcmtk/dcmdata/dctk.h"
+#include "dcmtk/dcmdata/cmdlnarg.h"
+#include "dcmtk/ofstd/ofconapp.h"
+#include "dcmtk/dcmdata/dcuid.h"       /* for dcmtk version name */
+#include "dcmtk/ofstd/ofstd.h"
+#include "dcmtk/ofstd/ofdatime.h"
+#include "dcmtk/dcmdata/dccodec.h"
+#include "dcmtk/dcmdata/dcencdoc.h"
 
 BEGIN_EXTERN_C
 #ifdef HAVE_FCNTL_H
@@ -39,14 +46,6 @@ BEGIN_EXTERN_C
 #endif
 END_EXTERN_C
 
-#include "dcmtk/dcmdata/dctk.h"
-#include "dcmtk/dcmdata/cmdlnarg.h"
-#include "dcmtk/ofstd/ofconapp.h"
-#include "dcmtk/dcmdata/dcuid.h"       /* for dcmtk version name */
-#include "dcmtk/ofstd/ofstd.h"
-#include "dcmtk/ofstd/ofdatime.h"
-#include "dcmtk/dcmdata/dccodec.h"
-
 #ifdef WITH_ZLIB
 #include <zlib.h>        /* for zlibVersion() */
 #endif
@@ -56,528 +55,102 @@ END_EXTERN_C
 static OFLogger pdf2dcmLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION);
 
 static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v"
-  OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $";
-
-static OFCondition createHeader(
-  DcmItem *dataset,
-  const char *opt_patientName,
-  const char *opt_patientID,
-  const char *opt_patientBirthdate,
-  const char *opt_patientSex,
-  OFBool opt_burnedInAnnotation,
-  const char *opt_studyUID,
-  const char *opt_seriesUID,
-  const char *opt_documentTitle,
-  const char *opt_conceptCSD,
-  const char *opt_conceptCV,
-  const char *opt_conceptCM,
-  Sint32 opt_instanceNumber)
-{
-    OFCondition result = EC_Normal;
-    char buf[80];
+OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $";
 
-    // insert empty type 2 attributes
-    if (result.good()) result = dataset->insertEmptyElement(DCM_StudyDate);
-    if (result.good()) result = dataset->insertEmptyElement(DCM_StudyTime);
-    if (result.good()) result = dataset->insertEmptyElement(DCM_AccessionNumber);
-    if (result.good()) result = dataset->insertEmptyElement(DCM_Manufacturer);
-    if (result.good()) result = dataset->insertEmptyElement(DCM_ReferringPhysicianName);
-    if (result.good()) result = dataset->insertEmptyElement(DCM_StudyID);
-    if (result.good()) result = dataset->insertEmptyElement(DCM_ContentDate);
-    if (result.good()) result = dataset->insertEmptyElement(DCM_ContentTime);
-    if (result.good()) result = dataset->insertEmptyElement(DCM_AcquisitionDateTime);
-
-    if (result.good() && opt_conceptCSD && opt_conceptCV && opt_conceptCM)
-    {
-      result = DcmCodec::insertCodeSequence(dataset, DCM_ConceptNameCodeSequence, opt_conceptCSD, opt_conceptCV, opt_conceptCM);
-    }
-    else
-    {
-      result = dataset->insertEmptyElement(DCM_ConceptNameCodeSequence);
-    }
-
-    // insert const value attributes
-    if (result.good()) result = dataset->putAndInsertString(DCM_SpecificCharacterSet, "ISO_IR 100");
-    if (result.good()) result = dataset->putAndInsertString(DCM_SOPClassUID,          UID_EncapsulatedPDFStorage);
-    // we are now using "DOC" for the modality, which seems to be more appropriate than "OT" (see CP-749)
-    if (result.good()) result = dataset->putAndInsertString(DCM_Modality,             "DOC");
-    if (result.good()) result = dataset->putAndInsertString(DCM_ConversionType,       "WSD");
-    if (result.good()) result = dataset->putAndInsertString(DCM_MIMETypeOfEncapsulatedDocument, "application/pdf");
-
-    // there is no way we could determine a meaningful series number, so we just use a constant.
-    if (result.good()) result = dataset->putAndInsertString(DCM_SeriesNumber,         "1");
-
-    // insert variable value attributes
-    if (result.good()) result = dataset->putAndInsertString(DCM_DocumentTitle,        opt_documentTitle);
-    if (result.good()) result = dataset->putAndInsertString(DCM_PatientName,          opt_patientName);
-    if (result.good()) result = dataset->putAndInsertString(DCM_PatientID,            opt_patientID);
-    if (result.good()) result = dataset->putAndInsertString(DCM_PatientBirthDate,     opt_patientBirthdate);
-    if (result.good()) result = dataset->putAndInsertString(DCM_PatientSex,           opt_patientSex);
-    if (result.good()) result = dataset->putAndInsertString(DCM_BurnedInAnnotation,   opt_burnedInAnnotation ? "YES" : "NO");
-
-    sprintf(buf, "%ld", OFstatic_cast(long, opt_instanceNumber));
-    if (result.good()) result = dataset->putAndInsertString(DCM_InstanceNumber,       buf);
-
-    dcmGenerateUniqueIdentifier(buf, SITE_INSTANCE_UID_ROOT);
-    if (result.good()) result = dataset->putAndInsertString(DCM_StudyInstanceUID,     opt_studyUID);
-    if (result.good()) result = dataset->putAndInsertString(DCM_SeriesInstanceUID,    opt_seriesUID);
-    if (result.good()) result = dataset->putAndInsertString(DCM_SOPInstanceUID,       buf);
-
-    // set instance creation date and time
-    OFString s;
-    if (result.good()) result = DcmDate::getCurrentDate(s);
-    if (result.good()) result = dataset->putAndInsertOFStringArray(DCM_InstanceCreationDate, s);
-    if (result.good()) result = DcmTime::getCurrentTime(s);
-    if (result.good()) result = dataset->putAndInsertOFStringArray(DCM_InstanceCreationTime, s);
-
-    return result;
-}
-
-static OFCondition insertPDFFile(
-  DcmItem *dataset,
-  const char *filename)
+int main(int argc, char *argv[])
 {
-    size_t fileSize = 0;
-    struct stat fileStat;
-    char buf[100];
-
-    if (0 == stat(filename, &fileStat)) fileSize = OFstatic_cast(size_t, fileStat.st_size);
-    else
-    {
-      OFLOG_ERROR(pdf2dcmLogger, "file " << filename << " not found");
-      return EC_IllegalCall;
-    }
-
-    if (fileSize == 0)
-    {
-      OFLOG_ERROR(pdf2dcmLogger, "file " << filename << " is empty");
-      return EC_IllegalCall;
-    }
-
-    FILE *pdffile = fopen(filename, "rb");
-    if (pdffile == NULL)
-    {
-      OFLOG_ERROR(pdf2dcmLogger, "unable to read file " << filename);
-      return EC_IllegalCall;
-    }
-
-    size_t buflen = 100;
-    if (fileSize < buflen) buflen = fileSize;
-    if (buflen != fread(buf, 1, buflen, pdffile))
-    {
-      OFLOG_ERROR(pdf2dcmLogger, "read error in file " << filename);
-      fclose(pdffile);
-      return EC_IllegalCall;
-    }
+  OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Encapsulate PDF file into DICOM format", rcsid);
+  OFCommandLine cmd;
+  int errorCode = EXITCODE_NO_ERROR;
+  OFCondition result = EC_Normal;
+  DcmFileFormat fileformat;
+  DcmEncapsulatedDocument encapsulator;
 
-    // check magic word for PDF file
-    if (0 != strncmp("%PDF-", buf, 5))
-    {
-      OFLOG_ERROR(pdf2dcmLogger, "file " << filename << " is not a PDF file");
-      fclose(pdffile);
-      return EC_IllegalCall;
-    }
+  OFLOG_TRACE(pdf2dcmLogger, "Including necessary options");
+  encapsulator.addPDFCommandlineOptions(cmd);
+  OFLOG_TRACE(pdf2dcmLogger, "Evaluating command line");
+  prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION);
 
-    // check PDF version number
-    char *version = buf + 5;
-    OFBool found = OFFalse;
-    for (int i = 0; i < 5; ++i)
+  if (app.parseCommandLine(cmd, argc, argv)) {
+    OFLOG_TRACE(pdf2dcmLogger, "Checking exclusive options first");
+    if (cmd.hasExclusiveOption())
     {
-      if (version[i] == 10 || version[i] == 13)
+      if (cmd.findOption("--version"))
       {
-        version[i] = 0; // insert end of string
-        found = OFTrue;
-        break;
+        app.printHeader(OFTrue /*print host identifier*/);
+        COUT << OFendl << "External libraries used: ";
+#ifdef WITH_ZLIB
+        COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl;
+#else
+        COUT << " none" << OFendl;
+#endif
+        return EXITCODE_NO_ERROR;
       }
     }
+    encapsulator.parseArguments(app, cmd);
+  }
+  //print resource identifier
+  OFLOG_DEBUG(pdf2dcmLogger, rcsid << OFendl);
 
-    if (! found)
-    {
-      OFLOG_ERROR(pdf2dcmLogger, "file " << filename << ": unable to decode PDF version number");
-      fclose(pdffile);
-      return EC_IllegalCall;
-    }
-
-    OFLOG_INFO(pdf2dcmLogger, "file " << filename << ": PDF " << version << ", " << (fileSize + 1023) / 1024 << "kB");
-
-    if (0 != fseek(pdffile, 0, SEEK_SET))
-    {
-      OFLOG_ERROR(pdf2dcmLogger, "file " << filename << ": seek error");
-      fclose(pdffile);
-      return EC_IllegalCall;
-    }
-
-    OFCondition result = EC_Normal;
-    DcmPolymorphOBOW *elem = new DcmPolymorphOBOW(DCM_EncapsulatedDocument);
-    if (elem)
-    {
-      size_t numBytes = fileSize;
-      if (numBytes & 1) ++numBytes;
-      Uint8 *bytes = NULL;
-      result = elem->createUint8Array(OFstatic_cast(Uint32, numBytes), bytes);
-      if (result.good())
-      {
-        // blank pad byte
-        bytes[numBytes - 1] = 0;
-
-        // read PDF content
-        if (fileSize != fread(bytes, 1, fileSize, pdffile))
-        {
-          OFLOG_ERROR(pdf2dcmLogger, "read error in file " << filename);
-          result = EC_IllegalCall;
-        }
-      }
-    } else result = EC_MemoryExhausted;
-
-    // if successful, insert element into dataset
-    if (result.good()) result = dataset->insert(elem); else delete elem;
-
-    // close file
-    fclose(pdffile);
-
-    return result;
-}
-
-
-static void createIdentifiers(
-  OFBool opt_readSeriesInfo,
-  const char *opt_seriesFile,
-  OFString& studyUID,
-  OFString& seriesUID,
-  OFString& patientName,
-  OFString& patientID,
-  OFString& patientBirthDate,
-  OFString& patientSex,
-  Sint32& incrementedInstance)
-{
-  char buf[100];
-  if (opt_seriesFile)
+  OFLOG_DEBUG(pdf2dcmLogger, "making sure data dictionary is loaded");
+  if (!dcmDataDict.isDictionaryLoaded())
   {
-    DcmFileFormat dfile;
-    OFCondition cond = dfile.loadFile(opt_seriesFile, EXS_Unknown, EGL_noChange);
-    if (cond.bad())
-    {
-      OFLOG_WARN(pdf2dcmLogger, cond.text() << ": reading file: "<< opt_seriesFile);
-    }
-    else
-    {
-      const char *c = NULL;
-      DcmDataset *dset = dfile.getDataset();
-      if (dset)
-      {
-        // read patient attributes
-        c = NULL;
-        if (dset->findAndGetString(DCM_PatientName, c).good() && c) patientName = c;
-        c = NULL;
-        if (dset->findAndGetString(DCM_PatientID, c).good() && c) patientID = c;
-        c = NULL;
-        if (dset->findAndGetString(DCM_PatientBirthDate, c).good() && c) patientBirthDate = c;
-        c = NULL;
-        if (dset->findAndGetString(DCM_PatientSex, c).good() && c) patientSex = c;
-
-        // read study attributes
-        c = NULL;
-        if (dset->findAndGetString(DCM_StudyInstanceUID, c).good() && c) studyUID = c;
-
-        // read series attributes
-        if (opt_readSeriesInfo)
-        {
-          c = NULL;
-          if (dset->findAndGetString(DCM_SeriesInstanceUID, c).good() && c) seriesUID = c;
-          if (dset->findAndGetSint32(DCM_InstanceNumber, incrementedInstance).good()) ++incrementedInstance; else incrementedInstance = 0;
-        }
-      }
-    }
+    OFLOG_WARN(pdf2dcmLogger, "no data dictionary loaded, check environment variable: "
+      << DCM_DICT_ENVIRONMENT_VARIABLE);
   }
-  if (studyUID.empty())
+  OFLOG_DEBUG(pdf2dcmLogger, "Creating identifiers (and reading series data)");
+  result = encapsulator.createIdentifiers(pdf2dcmLogger);
+  if (result.bad())
   {
-    dcmGenerateUniqueIdentifier(buf, SITE_STUDY_UID_ROOT);
-    studyUID = buf;
+    OFLOG_FATAL(pdf2dcmLogger, "There was an error while reading the series data");
+    return EXITCODE_INVALID_INPUT_FILE;
   }
-  if (seriesUID.empty())
+  OFLOG_INFO(pdf2dcmLogger, "creating encapsulated PDF object");
+  errorCode = encapsulator.insertEncapsulatedDocument(fileformat.getDataset(), pdf2dcmLogger);
+  if (errorCode != EXITCODE_NO_ERROR)
   {
-    dcmGenerateUniqueIdentifier(buf, SITE_SERIES_UID_ROOT);
-    seriesUID = buf;
+    OFLOG_ERROR(pdf2dcmLogger, "unable to create PDF encapsulation to DICOM format");
+    return errorCode;
   }
-}
-
-
-#define SHORTCOL 3
-#define LONGCOL 19
-
-int main(int argc, char *argv[])
-{
-  const char *opt_ifname = NULL;
-  const char *opt_ofname = NULL;
-
-  E_TransferSyntax opt_oxfer = EXS_LittleEndianExplicit;
-  E_GrpLenEncoding opt_oglenc = EGL_withoutGL;
-  E_EncodingType opt_oenctype = EET_ExplicitLength;
-  E_PaddingEncoding opt_opadenc = EPD_withoutPadding;
-  OFCmdUnsignedInt opt_filepad = 0;
-  OFCmdUnsignedInt opt_itempad = 0;
-
-  // document specific options
-  const char *   opt_seriesFile = NULL;
-  const char *   opt_patientName = NULL;
-  const char *   opt_patientID = NULL;
-  const char *   opt_patientBirthdate = NULL;
-  const char *   opt_documentTitle = NULL;
-  const char *   opt_conceptCSD = NULL;
-  const char *   opt_conceptCV = NULL;
-  const char *   opt_conceptCM = NULL;
-
-  OFBool         opt_readSeriesInfo = OFFalse;
-  const char *   opt_patientSex = NULL;
-  OFBool         opt_annotation = OFTrue;
-  OFCmdSignedInt opt_instance = 1;
-  OFBool         opt_increment = OFFalse;
-
-  OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Convert PDF file to DICOM", rcsid);
-  OFCommandLine cmd;
-  cmd.setOptionColumns(LONGCOL, SHORTCOL);
-  cmd.setParamColumn(LONGCOL + SHORTCOL + 4);
-
-  cmd.addParam("pdffile-in",  "PDF input filename to be converted");
-  cmd.addParam("dcmfile-out", "DICOM output filename");
-
-  cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2);
-   cmd.addOption("--help",                 "-h",     "print this help text and exit", OFCommandLine::AF_Exclusive);
-   cmd.addOption("--version",                        "print version information and exit", OFCommandLine::AF_Exclusive);
-   OFLog::addOptions(cmd);
-
-   cmd.addGroup("DICOM document options:");
-    cmd.addSubGroup("burned-in annotation:");
-      cmd.addOption("--annotation-yes",    "+an",    "PDF contains patient identifying data (default)");
-      cmd.addOption("--annotation-no",     "-an",    "PDF does not contain patient identifying data");
-
-    cmd.addSubGroup("document title:");
-      cmd.addOption("--title",             "+t",  1, "[t]itle: string (default: empty)",
-                                                     "document title");
-      cmd.addOption("--concept-name",      "+cn", 3, "[CSD] [CV] [CM]: string (default: empty)",
-                                                     "document title as concept name code sequence\n"
-                                                     "with coding scheme designator CSD, code value CV\n"
-                                                     "and code meaning CM");
-    cmd.addSubGroup("patient data:");
-      cmd.addOption("--patient-name",      "+pn", 1, "[n]ame: string",
-                                                     "patient's name in DICOM PN syntax");
-      cmd.addOption("--patient-id",        "+pi", 1, "[i]d: string",
-                                                     "patient identifier");
-      cmd.addOption("--patient-birthdate", "+pb", 1, "[d]ate: string (YYYYMMDD)",
-                                                     "patient's birth date");
-      cmd.addOption("--patient-sex",       "+ps", 1, "[s]ex: string (M, F or O)",
-                                                     "patient's sex");
-
-    cmd.addSubGroup("study and series:");
-      cmd.addOption("--generate",          "+sg",    "generate new study and series UIDs (default)");
-      cmd.addOption("--study-from",        "+st", 1, "[f]ilename: string",
-                                                     "read patient/study data from DICOM file");
-      cmd.addOption("--series-from",       "+se", 1, "[f]ilename: string",
-                                                     "read patient/study/series data from DICOM file");
-    cmd.addSubGroup("instance number:");
-      cmd.addOption("--instance-one",      "+i1",    "use instance number 1 (default, not with +se)");
-      cmd.addOption("--instance-inc",      "+ii",    "increment instance number (only with +se)");
-      cmd.addOption("--instance-set",      "+is", 1, "[i]nstance number: integer", "use instance number i");
-
-    /* evaluate command line */
-    prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION);
-    if (app.parseCommandLine(cmd, argc, argv))
-    {
-      /* check exclusive options first */
-      if (cmd.hasExclusiveOption())
-      {
-          if (cmd.findOption("--version"))
-          {
-              app.printHeader(OFTrue /*print host identifier*/);
-              COUT << OFendl << "External libraries used:";
-#ifdef WITH_ZLIB
-              COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl;
-#else
-              COUT << " none" << OFendl;
-#endif
-              return 0;
-          }
-      }
-
-      /* command line parameters and options */
-      cmd.getParam(1, opt_ifname);
-      cmd.getParam(2, opt_ofname);
-
-      OFLog::configureFromCommandLine(cmd, app);
-
-      dcmEnableGenerationOfNewVRs();
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--generate"))
-      {
-        opt_seriesFile = NULL;
-        opt_readSeriesInfo = OFFalse;
-      }
-      if (cmd.findOption("--series-from"))
-      {
-          app.checkValue(cmd.getValue(opt_seriesFile));
-          opt_readSeriesInfo = OFTrue;
-      }
-      if (cmd.findOption("--study-from"))
-      {
-          app.checkValue(cmd.getValue(opt_seriesFile));
-          opt_readSeriesInfo = OFFalse;
-      }
-      cmd.endOptionBlock();
-
-      if (cmd.findOption("--title"))
-      {
-        app.checkValue(cmd.getValue(opt_documentTitle));
-      }
-
-      if (cmd.findOption("--concept-name"))
-      {
-        app.checkValue(cmd.getValue(opt_conceptCSD));
-        app.checkValue(cmd.getValue(opt_conceptCV));
-        app.checkValue(cmd.getValue(opt_conceptCM));
-      }
-
-      if (cmd.findOption("--patient-name"))
-      {
-        app.checkValue(cmd.getValue(opt_patientName));
-        app.checkConflict("--patient-name", "--study-from or --series-from", opt_seriesFile != NULL);
-      }
-      if (cmd.findOption("--patient-id"))
-      {
-        app.checkValue(cmd.getValue(opt_patientID));
-        app.checkConflict("--patient-id", "--study-from or --series-from", opt_seriesFile != NULL);
-      }
-      if (cmd.findOption("--patient-birthdate"))
-      {
-        app.checkValue(cmd.getValue(opt_patientBirthdate));
-        app.checkConflict("--patient-birthdate", "--study-from or --series-from", opt_seriesFile != NULL);
-      }
-      if (cmd.findOption("--patient-sex"))
-      {
-        app.checkValue(cmd.getValue(opt_patientSex));
-        app.checkConflict("--patient-sex", "--study-from or --series-from", opt_seriesFile != NULL);
-      }
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--annotation-yes"))
-      {
-        opt_annotation = OFTrue;
-      }
-      if (cmd.findOption("--annotation-no"))
-      {
-        opt_annotation = OFTrue;
-      }
-      cmd.endOptionBlock();
-
-      // initialize default for --series-from
-      if (opt_seriesFile && opt_readSeriesInfo) opt_increment = OFTrue;
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--instance-one"))
-      {
-        app.checkConflict("--instance-one", "--series-from", (opt_seriesFile != NULL) && opt_readSeriesInfo);
-        opt_increment = OFFalse;
-        opt_instance = 1;
-      }
-      if (cmd.findOption("--instance-inc"))
-      {
-        app.checkDependence("--instance-inc", "--series-from", (opt_seriesFile != NULL) && opt_readSeriesInfo);
-        opt_increment = OFTrue;
-      }
-      if (cmd.findOption("--instance-set"))
-      {
-        opt_increment = OFFalse;
-        app.checkValue(cmd.getValueAndCheckMin(opt_instance, 1));
-      }
-    }
-
-    /* print resource identifier */
-    OFLOG_DEBUG(pdf2dcmLogger, rcsid << OFendl);
-
-    /* make sure data dictionary is loaded */
-    if (!dcmDataDict.isDictionaryLoaded())
-    {
-        OFLOG_WARN(pdf2dcmLogger, "no data dictionary loaded, check environment variable: "
-            << DCM_DICT_ENVIRONMENT_VARIABLE);
-    }
-
-    // read raw file
-    if ((opt_ifname == NULL) || (strlen(opt_ifname) == 0))
-    {
-        OFLOG_FATAL(pdf2dcmLogger, "invalid filename: <empty string>");
-        return 1;
-    }
-
-    // create study and series UID
-    OFString studyUID;
-    OFString seriesUID;
-    OFString patientName;
-    OFString patientID;
-    OFString patientBirthDate;
-    OFString patientSex;
-    Sint32 incrementedInstance = 0;
-
-    if (opt_patientName) patientName = opt_patientName;
-    if (opt_patientID) patientID = opt_patientID;
-    if (opt_patientBirthdate) patientBirthDate = opt_patientBirthdate;
-    if (opt_patientSex) patientSex = opt_patientSex;
-
-    createIdentifiers(opt_readSeriesInfo, opt_seriesFile, studyUID, seriesUID, patientName, patientID, patientBirthDate, patientSex, incrementedInstance);
-    if (opt_increment) opt_instance = incrementedInstance;
-
-    OFLOG_INFO(pdf2dcmLogger, "creating encapsulated PDF object");
-
-    DcmFileFormat fileformat;
-
-    OFCondition result = insertPDFFile(fileformat.getDataset(), opt_ifname);
-    if (result.bad())
-    {
-        OFLOG_ERROR(pdf2dcmLogger, "unable to create PDF DICOM encapsulation");
-        return 10;
-    }
-    if (result.bad()) return 10;
-
-    // now we need to generate an instance number that is guaranteed to be unique within a series.
-
-    result = createHeader(fileformat.getDataset(), patientName.c_str(), patientID.c_str(),
-      patientBirthDate.c_str(), patientSex.c_str(), opt_annotation, studyUID.c_str(),
-      seriesUID.c_str(), opt_documentTitle, opt_conceptCSD, opt_conceptCV, opt_conceptCM, OFstatic_cast(Sint32, opt_instance));
-
-    if (result.bad())
-    {
-        OFLOG_ERROR(pdf2dcmLogger, "unable to create DICOM header: " << result.text());
-        return 10;
-    }
-
-    OFLOG_INFO(pdf2dcmLogger, "writing encapsulated PDF object as file " << opt_ofname);
-
-    OFCondition error = EC_Normal;
-
-    OFLOG_INFO(pdf2dcmLogger, "Check if new output transfer syntax is possible");
-
-    DcmXfer opt_oxferSyn(opt_oxfer);
-
-    fileformat.getDataset()->chooseRepresentation(opt_oxfer, NULL);
-    if (fileformat.getDataset()->canWriteXfer(opt_oxfer))
-    {
-        OFLOG_INFO(pdf2dcmLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written");
-    } else {
-        OFLOG_ERROR(pdf2dcmLogger, "No conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!");
-        return 1;
-    }
+  OFLOG_INFO(pdf2dcmLogger, "Generating an instance number that is guaranteed to be unique within a series.");
+  result = encapsulator.createHeader(fileformat.getDataset(), pdf2dcmLogger);
+  if (result.bad())
+  {
+    OFLOG_ERROR(pdf2dcmLogger, "unable to create DICOM header: " << result.text());
+    return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+  }
+  OFLOG_INFO(pdf2dcmLogger, "writing encapsulated PDF object as file " << encapsulator.getOutputFileName());
 
-    OFLOG_INFO(pdf2dcmLogger, "write converted DICOM file with metaheader");
+  OFLOG_INFO(pdf2dcmLogger, "Check if new output transfer syntax is possible");
 
-    error = fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc, opt_opadenc,
-        OFstatic_cast(Uint32, opt_filepad), OFstatic_cast(Uint32, opt_itempad));
+  DcmXfer opt_oxferSyn(encapsulator.getTransferSyntax());
 
-    if (error.bad())
-    {
-        OFLOG_ERROR(pdf2dcmLogger, error.text() << ": writing file: " << opt_ofname);
-        return 1;
-    }
+  fileformat.getDataset()->chooseRepresentation(encapsulator.getTransferSyntax(), NULL);
+  if (fileformat.getDataset()->canWriteXfer(encapsulator.getTransferSyntax()))
+  {
+    OFLOG_INFO(pdf2dcmLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written");
+  }
+  else {
+    OFLOG_ERROR(pdf2dcmLogger, "No conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!");
+    return EXITCODE_COMMANDLINE_SYNTAX_ERROR;
+  }
+  OFLOG_INFO(pdf2dcmLogger, "Checking for DICOM key overriding");
+  result = encapsulator.applyOverrideKeys(fileformat.getDataset());
+  if (result.bad())
+  {
+    OFLOG_ERROR(pdf2dcmLogger, "There was a problem while overriding a key:" << OFendl
+      << result.text());
+    return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+  }
+  OFLOG_INFO(pdf2dcmLogger, "write converted DICOM file with metaheader");
+  result = encapsulator.saveFile(fileformat);
+  if (result.bad())
+  {
+    OFLOG_ERROR(pdf2dcmLogger, result.text() << ": writing file: " << encapsulator.getOutputFileName());
+    return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+  }
 
-    OFLOG_INFO(pdf2dcmLogger, "conversion successful");
+  OFLOG_INFO(pdf2dcmLogger, "PDF encapsulation successful");
 
-    return 0;
+  return EXITCODE_NO_ERROR;
 }
diff --git a/dcmdata/apps/stl2dcm.cc b/dcmdata/apps/stl2dcm.cc
new file mode 100755 (executable)
index 0000000..b9f9116
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  dcmdata
+ *
+ *  Author:  Pedro Arizpe
+ *
+ *  Purpose: Encapsulate STL file into a DICOM file
+ *
+ */
+
+#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first*/
+
+#define INCLUDE_CSTDLIB
+#define INCLUDE_CSTDIO
+#define INCLUDE_CSTRING
+#include "dcmtk/ofstd/ofstdinc.h"
+#include "dcmtk/dcmdata/dctk.h"
+#include "dcmtk/dcmdata/cmdlnarg.h"
+#include "dcmtk/ofstd/ofconapp.h"
+#include "dcmtk/dcmdata/dcuid.h"       /* for dcmtk version name */
+#include "dcmtk/ofstd/ofstd.h"
+#include "dcmtk/ofstd/ofdatime.h"
+#include "dcmtk/dcmdata/dccodec.h"
+#include "dcmtk/dcmdata/dcencdoc.h"
+
+BEGIN_EXTERN_C
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>       /* for O_RDONLY */
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>   /* required for sys/stat.h */
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>    /* for stat, fstat */
+#endif
+END_EXTERN_C
+
+#ifdef WITH_ZLIB
+#include <zlib.h>        /* for zlibVersion() */
+#endif
+
+#define OFFIS_CONSOLE_APPLICATION "stl2dcm"
+
+static OFLogger stl2dcmLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION);
+
+static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v"
+OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $";
+
+int main(int argc, char *argv[])
+{
+  OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Encapsulate STL file into DICOM format", rcsid);
+  OFCommandLine cmd;
+  int errorCode = EXITCODE_NO_ERROR;
+  OFCondition result = EC_Normal;
+  DcmFileFormat fileformat;
+  DcmEncapsulatedDocument encapsulator;
+
+  OFLOG_TRACE(stl2dcmLogger, "Including necessary options");
+  encapsulator.addSTLCommandlineOptions(cmd);
+  OFLOG_TRACE(stl2dcmLogger, "Evaluating command line");
+  prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION);
+
+  if (app.parseCommandLine(cmd, argc, argv)) {
+    OFLOG_TRACE(stl2dcmLogger, "Checking exclusive options first");
+    if (cmd.hasExclusiveOption())
+    {
+      if (cmd.findOption("--version"))
+      {
+        app.printHeader(OFTrue /*print host identifier*/);
+        COUT << OFendl << "External libraries used: ";
+#ifdef WITH_ZLIB
+        COUT << OFendl << "- ZLIB, Version " << zlibVersion() << OFendl;
+#else
+        COUT << " none" << OFendl;
+#endif
+        return EXITCODE_NO_ERROR;
+      }
+    }
+    encapsulator.parseArguments(app, cmd);
+  }
+  //print resource identifier
+  OFLOG_DEBUG(stl2dcmLogger, rcsid << OFendl);
+
+  OFLOG_DEBUG(stl2dcmLogger, "making sure data dictionary is loaded");
+  if (!dcmDataDict.isDictionaryLoaded())
+  {
+    OFLOG_WARN(stl2dcmLogger, "no data dictionary loaded, check environment variable: "
+      << DCM_DICT_ENVIRONMENT_VARIABLE);
+  }
+  OFLOG_DEBUG(stl2dcmLogger, "Creating identifiers (and reading series data)");
+  result = encapsulator.createIdentifiers(stl2dcmLogger);
+  if (result.bad())
+  {
+    OFLOG_FATAL(stl2dcmLogger, "There was an error while reading the series data");
+    return EXITCODE_INVALID_INPUT_FILE;
+  }
+  OFLOG_INFO(stl2dcmLogger, "creating encapsulated STL object");
+  errorCode = encapsulator.insertEncapsulatedDocument(fileformat.getDataset(), stl2dcmLogger);
+  if (errorCode != EXITCODE_NO_ERROR)
+  {
+    OFLOG_ERROR(stl2dcmLogger, "unable to create STL encapsulation to DICOM format");
+    return errorCode;
+  }
+  OFLOG_INFO(stl2dcmLogger, "Generating an instance number that is guaranteed to be unique within a series.");
+  result = encapsulator.createHeader(fileformat.getDataset(), stl2dcmLogger);
+  if (result.bad())
+  {
+    OFLOG_ERROR(stl2dcmLogger, "unable to create DICOM header: " << result.text());
+    return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+  }
+  OFLOG_INFO(stl2dcmLogger, "writing encapsulated STL object as file " << encapsulator.getOutputFileName());
+
+  OFLOG_INFO(stl2dcmLogger, "Check if new output transfer syntax is possible");
+
+  DcmXfer opt_oxferSyn(encapsulator.getTransferSyntax());
+
+  fileformat.getDataset()->chooseRepresentation(encapsulator.getTransferSyntax(), NULL);
+  if (fileformat.getDataset()->canWriteXfer(encapsulator.getTransferSyntax()))
+  {
+    OFLOG_INFO(stl2dcmLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written");
+  }
+  else {
+    OFLOG_ERROR(stl2dcmLogger, "No conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!");
+    return EXITCODE_COMMANDLINE_SYNTAX_ERROR;
+  }
+  OFLOG_INFO(stl2dcmLogger, "Checking for DICOM key overriding");
+  result = encapsulator.applyOverrideKeys(fileformat.getDataset());
+  if (result.bad())
+  {
+    OFLOG_ERROR(stl2dcmLogger, "There was a problem while overriding a key:" << OFendl
+      << result.text());
+    return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+  }
+  OFLOG_INFO(stl2dcmLogger, "write converted DICOM file with metaheader");
+  result = encapsulator.saveFile(fileformat);
+  if (result.bad())
+  {
+    OFLOG_ERROR(stl2dcmLogger, result.text() << ": writing file: " << encapsulator.getOutputFileName());
+    return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+  }
+
+  OFLOG_INFO(stl2dcmLogger, "STL encapsulation successful");
+
+  return EXITCODE_NO_ERROR;
+}
index 425c7e66d7e8f740146d21eee121be6e91062f7a..64ffba1fb03fc67ea3d8701a0c1f19e0e65136a9 100644 (file)
@@ -1,8 +1,8 @@
 # declare installation files
-INSTALL(FILES dicom.dic acrnema.dic private.dic diconde.dic dcm2xml.dtd dumppat.txt SC.dump VLP.dump DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data)
+install(FILES dicom.dic acrnema.dic private.dic diconde.dic dcm2xml.dtd dumppat.txt SC.dump VLP.dump DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data)
 
 # add paths to the dictionaries to a CMake variable for being used by the unit tests
-SET(DCMTK_DICOM_DICTIONARIES
+set(DCMTK_DICOM_DICTIONARIES
   "${CMAKE_CURRENT_SOURCE_DIR}/dicom.dic"
   "${CMAKE_CURRENT_SOURCE_DIR}/private.dic"
   CACHE INTERNAL "paths to the DICOM data dictionaries"
index 5cc5723560595192a14a882f2bed94d5fb80b4f1..39e6b8def86b4d65759851828a126fc606465dbe 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 1994-2017, OFFIS e.V.
+#  Copyright (C) 1994-2018, OFFIS e.V.
 #  All rights reserved.  See COPYRIGHT file for details.
 #
 #  This software and supporting documentation were developed by
 # DICONDE (Digital Imaging and Communication in Nondestructive Evaluation) and
 # DICOS (Digital Imaging and Communications in Security) standard.
 #
-# Generated automatically from DICOM PS 3.6-2017e and PS 3.7-2017e
-# File created on 2017-12-05 09:13:43 by J. Riesmeier on thinkpad.
-# Last modified on 2017-12-07 by J. Riesmeier.
+# Generated automatically from DICOM PS 3.6-2018d and PS 3.7-2018d
+# File created on 2018-09-19 14:20:31 by J. Riesmeier on thinkpad.
+# File updated manually on 2018-11-15 by J. Riesmeier.
 #
 # In addition, the data dictionary entries from the following final text
 # supplements and correction items (CP) have been incorporated:
-# - (none)
+# - Supplement 188
+# - CP 1803, 1809
 #
 # Each line represents an entry in the data dictionary.  Each line has 5 fields
 # (Tag, VR, Name, VM, Version).  Entries need not be in ascending tag order.
 (0008,114B)    SQ      ReferencedRealWorldValueMappingInstanceSequence 1       DICOM
 (0008,1150)    UI      ReferencedSOPClassUID   1       DICOM
 (0008,1155)    UI      ReferencedSOPInstanceUID        1       DICOM
+(0008,1156)    SQ      DefinitionSourceSequence        1       DICOM
 (0008,115A)    UI      SOPClassesSupported     1-n     DICOM
 (0008,1160)    IS      ReferencedFrameNumber   1-n     DICOM
 (0008,1161)    UL      SimpleFrameList 1-n     DICOM
 (0040,0610)    SQ      SpecimenPreparationSequence     1       DICOM
 (0040,0612)    SQ      SpecimenPreparationStepContentItemSequence      1       DICOM
 (0040,0620)    SQ      SpecimenLocalizationContentItemSequence 1       DICOM
+(0040,0710)    SQ      WholeSlideMicroscopyImageFrameTypeSequence      1       DICOM
 (0040,071A)    SQ      ImageCenterPointCoordinatesSequence     1       DICOM
 (0040,072A)    DS      XOffsetInSlideCoordinateSystem  1       DICOM
 (0040,073A)    DS      YOffsetInSlideCoordinateSystem  1       DICOM
 (0040,2400)    LT      ImagingServiceRequestComments   1       DICOM
 (0040,3001)    LO      ConfidentialityConstraintOnPatientDataDescription       1       DICOM
 (0040,4005)    DT      ScheduledProcedureStepStartDateTime     1       DICOM
-(0040,4007)    SQ      PerformedProcessingApplicationsCodeSequence     1       DICOM
+(0040,4008)    DT      ScheduledProcedureStepExpirationDateTime        1       DICOM
 (0040,4009)    SQ      HumanPerformerCodeSequence      1       DICOM
 (0040,4010)    DT      ScheduledProcedureStepModificationDateTime      1       DICOM
 (0040,4011)    DT      ExpectedCompletionDateTime      1       DICOM
 (0048,021E)    SL      ColumnPositionInTotalImagePixelMatrix   1       DICOM
 (0048,021F)    SL      RowPositionInTotalImagePixelMatrix      1       DICOM
 (0048,0301)    CS      PixelOriginInterpretation       1       DICOM
+(0048,0302)    UL      NumberOfOpticalPaths    1       DICOM
+(0048,0303)    UL      TotalPixelMatrixFocalPlanes     1       DICOM
 (0050,0004)    CS      CalibrationImage        1       DICOM
 (0050,0010)    SQ      DeviceSequence  1       DICOM
 (0050,0012)    SQ      ContainerComponentTypeCodeSequence      1       DICOM
 (0062,0010)    CS      SegmentationFractionalType      1       DICOM
 (0062,0011)    SQ      SegmentedPropertyTypeModifierCodeSequence       1       DICOM
 (0062,0012)    SQ      UsedSegmentsSequence    1       DICOM
+(0062,0013)    CS      SegmentsOverlap 1       DICOM
 (0062,0020)    UT      TrackingID      1       DICOM
 (0062,0021)    UI      TrackingUID     1       DICOM
 (0064,0002)    SQ      DeformableRegistrationSequence  1       DICOM
 (0068,65F0)    FD      TwoDPlaneIntersection   4       DICOM
 (0068,6610)    FD      ThreeDPlaneOrigin       3       DICOM
 (0068,6620)    FD      ThreeDPlaneNormal       3       DICOM
+(0068,7001)    CS      ModelModification       1       DICOM
+(0068,7002)    CS      ModelMirroring  1       DICOM
+(0068,7003)    SQ      ModelUsageCodeSequence  1       DICOM
 (0070,0001)    SQ      GraphicAnnotationSequence       1       DICOM
 (0070,0002)    CS      GraphicLayer    1       DICOM
 (0070,0003)    CS      BoundingBoxAnnotationUnits      1       DICOM
 (0070,0314)    SQ      UsedFiducialsSequence   1       DICOM
 (0070,0318)    SQ      GraphicCoordinatesDataSequence  1       DICOM
 (0070,031A)    UI      FiducialUID     1       DICOM
+(0070,031B)    UI      ReferencedFiducialUID   1       DICOM
 (0070,031C)    SQ      FiducialSetSequence     1       DICOM
 (0070,031E)    SQ      FiducialSequence        1       DICOM
 (0070,031F)    SQ      FiducialsPropertyCategoryCodeSequence   1       DICOM
 (0080,0007)    US      SurfacePointColorCIELabValueData        3-3n    DICOM
 (0080,0008)    SQ      UVMappingSequence       1       DICOM
 (0080,0009)    SH      TextureLabel    1       DICOM
-(0080,0010)    OF      UValueData      1-n     DICOM
-(0080,0011)    OF      VValueData      1-n     DICOM
+(0080,0010)    OF      UValueData      1       DICOM
+(0080,0011)    OF      VValueData      1       DICOM
 (0080,0012)    SQ      ReferencedTextureSequence       1       DICOM
 (0080,0013)    SQ      ReferencedSurfaceDataSequence   1       DICOM
 (0082,0001)    CS      AssessmentSummary       1       DICOM
 (0400,0563)    LO      ModifyingSystem 1       DICOM
 (0400,0564)    LO      SourceOfPreviousValues  1       DICOM
 (0400,0565)    CS      ReasonForTheAttributeModification       1       DICOM
+(0400,0600)    CS      InstanceOriginStatus    1       DICOM
 (2000,0010)    IS      NumberOfCopies  1       DICOM
 (2000,001E)    SQ      PrinterConfigurationSequence    1       DICOM
 (2000,0020)    CS      PrintPriority   1       DICOM
 (3006,0030)    SQ      RTRelatedROISequence    1       DICOM
 (3006,0033)    CS      RTROIRelationship       1       DICOM
 (3006,0036)    CS      ROIGenerationAlgorithm  1       DICOM
+(3006,0037)    SQ      ROIDerivationAlgorithmIdentificationSequence    1       DICOM
 (3006,0038)    LO      ROIGenerationDescription        1       DICOM
 (3006,0039)    SQ      ROIContourSequence      1       DICOM
 (3006,0040)    SQ      ContourSequence 1       DICOM
 (300A,0091)    DS      AlternateBeamDose       1       DICOM
 (300A,0092)    CS      AlternateBeamDoseType   1       DICOM
 (300A,0093)    CS      DepthValueAveragingFlag 1       DICOM
+(300A,0094)    DS      BeamDosePointSourceToExternalContourDistance    1       DICOM
 (300A,00A0)    IS      NumberOfBrachyApplicationSetups 1       DICOM
 (300A,00A2)    DS      BrachyApplicationSetupDoseSpecificationPoint    3       DICOM
 (300A,00A4)    DS      BrachyApplicationSetupDose      1       DICOM
 (0040,4003)    CS      RETIRED_GeneralPurposeScheduledProcedureStepPriority    1       DICOM/retired
 (0040,4004)    SQ      RETIRED_ScheduledProcessingApplicationsCodeSequence     1       DICOM/retired
 (0040,4006)    CS      RETIRED_MultipleCopiesFlag      1       DICOM/retired
+(0040,4007)    SQ      RETIRED_PerformedProcessingApplicationsCodeSequence     1       DICOM/retired
 (0040,4015)    SQ      RETIRED_ResultingGeneralPurposePerformedProcedureStepsSequence  1       DICOM/retired
 (0040,4016)    SQ      RETIRED_ReferencedGeneralPurposeScheduledProcedureStepSequence  1       DICOM/retired
 (0040,4020)    CS      RETIRED_InputAvailabilityFlag   1       DICOM/retired
 #
 #---------------------------------------------------------------------------
 #
+# Supplement 188 (Multi-energy CT Images)
+#
+(0018,9361)    CS      MultienergyCTAcquisition        1       DICOM/Supplement_188
+(0018,9362)    SQ      MultienergyCTAcquisitionSequence        1       DICOM/Supplement_188
+(0018,9363)    SQ      MultienergyCTProcessingSequence 1       DICOM/Supplement_188
+(0018,9364)    SQ      MultienergyCTCharacteristicsSequence    1       DICOM/Supplement_188
+(0018,9365)    SQ      MultienergyCTXRaySourceSequence 1       DICOM/Supplement_188
+(0018,9366)    US      XRaySourceIndex 1       DICOM/Supplement_188
+(0018,9367)    UC      XRaySourceID    1       DICOM/Supplement_188
+(0018,9368)    CS      MultienergySourceTechnique      1       DICOM/Supplement_188
+(0018,9369)    DT      SourceStartDateTime     1       DICOM/Supplement_188
+(0018,936A)    DT      SourceEndDateTime       1       DICOM/Supplement_188
+(0018,936B)    US      SwitchingPhaseNumber    1       DICOM/Supplement_188
+(0018,936C)    DS      SwitchingPhaseNominalDuration   1       DICOM/Supplement_188
+(0018,936D)    DS      SwitchingPhaseTransitionDuration        1       DICOM/Supplement_188
+(0018,936E)    DS      EffectiveBinEnergy      1       DICOM/Supplement_188
+(0018,936F)    SQ      MultienergyCTXRayDetectorSequence       1       DICOM/Supplement_188
+(0018,9370)    US      XRayDetectorIndex       1       DICOM/Supplement_188
+(0018,9371)    UC      XRayDetectorID  1       DICOM/Supplement_188
+(0018,9372)    CS      MultienergyDetectorType 1       DICOM/Supplement_188
+(0018,9373)    ST      XRayDetectorLabel       1       DICOM/Supplement_188
+(0018,9374)    DS      NominalMaxEnergy        1       DICOM/Supplement_188
+(0018,9375)    DS      NominalMinEnergy        1       DICOM/Supplement_188
+(0018,9376)    US      ReferencedXRayDetectorIndex     1-n     DICOM/Supplement_188
+(0018,9377)    US      ReferencedXRaySourceIndex       1-n     DICOM/Supplement_188
+(0018,9378)    US      ReferencedPathIndex     1-n     DICOM/Supplement_188
+(0018,9379)    SQ      MultienergyCTPathSequence       1       DICOM/Supplement_188
+(0018,937A)    US      MultienergyCTPathIndex  1       DICOM/Supplement_188
+(0018,937B)    UT      MultienergyAcquisitionDescription       1       DICOM/Supplement_188
+(0018,937C)    FD      MonoenergeticEnergyEquivalent   1       DICOM/Supplement_188
+(0018,937D)    SQ      MaterialCodeSequence    1       DICOM/Supplement_188
+(0018,937E)    CS      DecompositionMethod     1       DICOM/Supplement_188
+(0018,937F)    UT      DecompositionDescription        1       DICOM/Supplement_188
+(0018,9380)    SQ      DecompositionAlgorithmIdentificationSequence    1       DICOM/Supplement_188
+(0018,9381)    SQ      DecompositionMaterialSequence   1       DICOM/Supplement_188
+(0018,9382)    SQ      MaterialAttenuationSequence     1       DICOM/Supplement_188
+(0018,9383)    DS      PhotonEnergy    1       DICOM/Supplement_188
+(0018,9384)    DS      XRayMassAttenuationCoefficient  1       DICOM/Supplement_188
+#
+#---------------------------------------------------------------------------
+#
+# Correction Items 1803, 1809
+#
+(0022,1036)    SQ      SourceOfCornealSizeDataCodeSequence     1       DICOM/CP_1803
+(0046,0047)    SQ      CornealSizeSequence     1       DICOM/CP_1803
+(0008,1041)    SQ      InstitutionalDepartmentTypeCodeSequence 1       DICOM/CP_1809
+#
+#---------------------------------------------------------------------------
+#
 # Private Creator Data Elements
 #
 (0009-o-FFFF,0000)     UL      PrivateGroupLength      1       PRIVATE
index fe35ccc0fa60a777a2797aaf934761ea2e0c8ec2..26d0ac5fc0e4c78a69920d0e7974730253124c95 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES datadict.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc)
+install(FILES datadict.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc)
diff --git a/dcmdata/docs/cda2dcm.man b/dcmdata/docs/cda2dcm.man
new file mode 100644 (file)
index 0000000..3cc31a4
--- /dev/null
@@ -0,0 +1,258 @@
+/*!
+
+\if MANPAGES
+\page cda2dcm Encapsulate CDA file into DICOM file format
+\else
+\page cda2dcm cda2dcm: Encapsulate CDA file into DICOM file format
+\endif
+
+\section cda2dcm_synopsis SYNOPSIS
+
+\verbatim
+cda2dcm [options] cdafile-in dcmfile-out
+\endverbatim
+
+\section cda2dcm_description DESCRIPTION
+
+The \b cda2dcm utility reads a CDA file (\e cdafile-in), converts it to a
+DICOM Encapsulated CDA Storage SOP instance and stores the converted data
+to an output file (\e dcmfile-out).
+
+\section cda2dcm_parameters PARAMETERS
+
+\verbatim
+cdafile-in   CDA input filename to be encapsulated
+
+dcmfile-out  DICOM output filename
+\endverbatim
+
+\section cda2dcm_options OPTIONS
+
+\subsection cda2dcm_general_options general options
+\verbatim
+  -h   --help
+         print this help text and exit
+
+       --version
+         print version information and exit
+
+       --arguments
+         print expanded command line arguments
+
+  -q   --quiet
+         quiet mode, print no warnings and errors
+
+  -v   --verbose
+         verbose mode, print processing details
+
+  -d   --debug
+         debug mode, print debug information
+
+  -ll  --log-level  [l]evel: string constant
+         (fatal, error, warn, info, debug, trace)
+         use level l for the logger
+
+  -lc  --log-config  [f]ilename: string
+         use config file f for the logger
+\endverbatim
+
+\subsection cda2dcm_dicom_document_options DICOM document options
+\verbatim
+document title:
+
+  +t   --title  [t]itle: string (default: empty)
+         document title
+
+  +cn  --concept-name  [CSD] [CV] [CM]: string (default: empty)
+         coded representation of document title defined by coding
+         scheme designator CSD, code value CV and code meaning CM
+
+patient data:
+
+  +pn  --patient-name  [n]ame: string
+         patient's name in DICOM PN syntax
+
+  +pi  --patient-id  [i]d: string
+         patient identifier
+
+  +pb  --patient-birthdate  [d]ate: string (YYYYMMDD)
+         patient's birth date
+
+  +ps  --patient-sex  [s]ex: string (M, F or O)
+         patient's sex
+
+study and series:
+
+  +sg  --generate
+         generate new study and series UIDs (default)
+
+  +st  --study-from  [f]ilename: string
+         read patient/study data from DICOM file
+
+  +se  --series-from  [f]ilename: string
+         read patient/study/series data from DICOM file
+
+instance number:
+
+  +i1  --instance-one
+         use instance number 1 (default, not with +se)
+
+  +ii  --instance-inc
+         increment instance number (only with +se)
+
+  +is  --instance-set [i]nstance number: integer
+         use instance number i
+
+burned-in annotation:
+
+  +an  --annotation-yes
+         document contains patient identifying data (default)
+
+  -an  --annotation-no
+         document does not contain patient identifying data
+
+override CDA file data:
+
+  -ov  --no-override
+         CDA patient and document data must match study,
+         series or manually entered information (default)
+
+  +ov  --override
+         data obtained from the CDA file will be overwritten
+         by study, series, or manually entered information
+\endverbatim
+
+\subsection cda2dcm_processing_options processing options
+\verbatim
+other processing options:
+
+  -k   --key  [k]ey: gggg,eeee="str", path or dictionary name="str"
+         add further attribute
+\endverbatim
+
+\subsection cda2dcm_output_options output options
+\verbatim
+output file format:
+
+  +F   --write-file
+         write file format (default)
+
+  -F   --write-dataset
+         write data set without file meta information
+
+group length encoding:
+
+  +g=  --group-length-recalc
+         recalculate group lengths if present (default)
+
+  +g   --group-length-create
+         always write with group length elements
+
+  -g   --group-length-remove
+         always write without group length elements
+
+length encoding in sequences and items:
+
+  +e   --length-explicit
+         write with explicit lengths (default)
+
+  -e   --length-undefined
+         write with undefined lengths
+
+data set trailing padding (not with --write-dataset):
+
+  -p   --padding-off
+         no padding (implicit if --write-dataset)
+
+  +p   --padding-create  [f]ile-pad [i]tem-pad: integer
+         align file on multiple of f bytes
+         and items on multiple of i bytes
+\endverbatim
+
+\section cda2dcm_logging LOGGING
+
+The level of logging output of the various command line tools and underlying
+libraries can be specified by the user.  By default, only errors and warnings
+are written to the standard error stream.  Using option \e --verbose also
+informational messages like processing details are reported.  Option
+\e --debug can be used to get more details on the internal activity, e.g. for
+debugging purposes.  Other logging levels can be selected using option
+\e --log-level.  In \e --quiet mode only fatal errors are reported.  In such
+very severe error events, the application will usually terminate.  For more
+details on the different logging levels, see documentation of module "oflog".
+
+In case the logging output should be written to file (optionally with logfile
+rotation), to syslog (Unix) or the event log (Windows) option \e --log-config
+can be used.  This configuration file also allows for directing only certain
+messages to a particular output stream and for filtering certain messages
+based on the module or application where they are generated.  An example
+configuration file is provided in <em>\<etcdir\>/logger.cfg</em>.
+
+\section cda2dcm_command_line COMMAND LINE
+
+All command line tools use the following notation for parameters: square
+brackets enclose optional values (0-1), three trailing dots indicate that
+multiple values are allowed (1-n), a combination of both means 0 to n values.
+
+Command line options are distinguished from parameters by a leading '+' or '-'
+sign, respectively.  Usually, order and position of command line options are
+arbitrary (i.e. they can appear anywhere).  However, if options are mutually
+exclusive the rightmost appearance is used.  This behavior conforms to the
+standard evaluation rules of common Unix shells.
+
+In addition, one or more command files can be specified using an '@' sign as a
+prefix to the filename (e.g. <em>\@command.txt</em>).  Such a command argument
+is replaced by the content of the corresponding text file (multiple
+whitespaces are treated as a single separator unless they appear between two
+quotation marks) prior to any further evaluation.  Please note that a command
+file cannot contain another command file.  This simple but effective approach
+allows one to summarize common combinations of options/parameters and avoids
+longish and confusing command lines (an example is provided in file
+<em>\<datadir\>/dumppat.txt</em>).
+
+\section cda2dcm_exit_codes EXIT CODES
+
+The \b cda2dcm utility uses the following exit codes when terminating.  This
+enables the user to check for the reason why the application terminated.
+
+\subsection cda2dcm_exit_codes_general general
+\verbatim
+EXITCODE_NO_ERROR                 0
+EXITCODE_COMMANDLINE_SYNTAX_ERROR 1
+EXITCODE_MEMORY_EXHAUSTED         4
+\endverbatim
+
+\subsection cda2dcm_exit_codes_input_file_errors input file errors
+\verbatim
+EXITCODE_CANNOT_READ_INPUT_FILE   20
+EXITCODE_NO_INPUT_FILES           21
+EXITCODE_INVALID_INPUT_FILE       22
+\endverbatim
+
+\subsection cda2dcm_exit_codes_output_file_errors output file errors
+\verbatim
+EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40
+\endverbatim
+
+\section cda2dcm_environment ENVIRONMENT
+
+The \b cda2dcm utility will attempt to load DICOM data dictionaries specified
+in the \e DCMDICTPATH environment variable.  By default, i.e. if the
+\e DCMDICTPATH environment variable is not set, the file
+<em>\<datadir\>/dicom.dic</em> will be loaded unless the dictionary is built
+into the application (default for Windows).
+
+The default behavior should be preferred and the \e DCMDICTPATH environment
+variable only used when alternative data dictionaries are required.  The
+\e DCMDICTPATH environment variable has the same format as the Unix shell
+\e PATH variable in that a colon (":") separates entries.  On Windows systems,
+a semicolon (";") is used as a separator.  The data dictionary code will
+attempt to load each file specified in the \e DCMDICTPATH environment
+variable.
+It is an error if no data dictionary can be loaded.
+
+\section cda2dcm_copyright COPYRIGHT
+
+Copyright (C) 2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+
+*/
index 98bf94f7a80550108247e0a36c9ec4e759a8946f..bde9db1df17d25cfd096368a1958f5ca2252700a 100644 (file)
@@ -22,7 +22,7 @@ outdated version.  Loading the dictionary content from a separate file,
 however, has the advantage that application programs need not be recompiled
 if additions or corrections are made to the data dictionary.
 
-DCMTK uses an external data dictionary by default on Posix systems (Linux,
+By default, DCMTK uses an external data dictionary on Posix systems (Linux,
 Mac OS X, etc.) while a built-in dictionary is used on Windows systems.  How
 these defaults can be changed or how both approaches can even be combined is
 further explained below.
@@ -46,8 +46,9 @@ DICTIONARY DEFAULT: CMAKE ON WINDOWS AND POSIX SYSTEMS
 
 On Windows, the default behavior is to compile a fully-populated DICOM
 dictionary as global data dictionary into the dcmdata library.  Thus, it is
-not required to load an external data dictionary from a file and dcmdata will
-not try loading such a file by default.
+not required to load an external data dictionary from a file.  However,
+usage of external dictionaries is still possible on Windows by setting the
+environment variable DCMDICTPATH accordingly (see further details below).
 
 On Posix systems, the default setting is to load the data dictionary from an
 external file (as described in the above section on Autoconf).
@@ -219,4 +220,4 @@ subsequently fail to compile.
 
 DCMTK Development Team, Oldenburg, Germany
 
-Last revised: 2017-09-14 (Riesmeier).
+Last revised: 2018-09-04 (Onken).
index 75012802f7d0acc4ea544deb61d4913ad0428d04..64ad7d5c99df5bc93e704c1dc24cc52825f54000 100644 (file)
@@ -165,10 +165,14 @@ data set trailing padding:
 
 \section dcmcrle_notes NOTES
 
+The \b dcmcrle utility compresses DICOM images of all SOP classes.  It processes
+all Pixel Data (7fe0,0010) elements in the dataset, i.e. compression is also
+performed on an icon image.
+
 Please note that the DICOM standard does not allow for storing the pixel data
 with multiple fragments per frame (when RLE compression is used).  So limiting
 the fragment size with option \e --fragment-size (or \e +fs) may result in a
-non-standard conformant DICOM image.
+non-standard compliant DICOM image.
 
 \section dcmcrle_transfer_syntaxes TRANSFER SYNTAXES
 
@@ -254,6 +258,6 @@ It is an error if no data dictionary can be loaded.
 
 \section dcmcrle_copyright COPYRIGHT
 
-Copyright (C) 2002-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2002-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index 99fa20ea6dc3744e08ab43855e086921f98ce99d..b29b6fca109c3987e950622d64789fe41db63e79 100644 (file)
@@ -19,6 +19,7 @@ Here are some further classes that are of interest:
 \section Tools
 
 This module contains the following command line tools:
+\li \ref cda2dcm
 \li \ref dcm2json
 \li \ref dcm2pdf
 \li \ref dcm2xml
@@ -32,6 +33,7 @@ This module contains the following command line tools:
 \li \ref dump2dcm
 \li \ref img2dcm
 \li \ref pdf2dcm
+\li \ref stl2dcm
 \li \ref xml2dcm
 
 \section Files
index ca61c820d9a677af65cedce7ee884e4ded113db6..282476d72bcb8e2a8d1809f51f559c9e3d43db7e 100644 (file)
@@ -1,9 +1,9 @@
 /*!
 
 \if MANPAGES
-\page pdf2dcm Convert PDF file to DICOM
+\page pdf2dcm Encapsulate PDF file into DICOM file format
 \else
-\page pdf2dcm pdf2dcm: Convert PDF file to DICOM
+\page pdf2dcm pdf2dcm: Encapsulate PDF file into DICOM file format
 \endif
 
 \section pdf2dcm_synopsis SYNOPSIS
@@ -21,7 +21,7 @@ to an output file (\e dcmfile-out).
 \section pdf2dcm_parameters PARAMETERS
 
 \verbatim
-pdffile-in   PDF input filename to be converted
+pdffile-in   PDF input filename to be encapsulated
 
 dcmfile-out  DICOM output filename
 \endverbatim
@@ -58,21 +58,13 @@ dcmfile-out  DICOM output filename
 
 \subsection pdf2dcm_dicom_document_options DICOM document options
 \verbatim
-burned-in annotation:
-
-  +an  --annotation-yes
-         PDF contains patient identifying data (default)
-
-  -an  --annotation-no
-         PDF does not contain patient identifying data
-
 document title:
 
   +t   --title  [t]itle: string (default: empty)
          document title
 
   +cn  --concept-name  [CSD] [CV] [CM]: string (default: empty)
-         document title as concept name code sequence with coding
+         coded representation of document title defined by coding
          scheme designator CSD, code value CV and code meaning CM
 
 patient data:
@@ -108,8 +100,63 @@ instance number:
   +ii  --instance-inc
          increment instance number (only with +se)
 
-  +is  --instance-set  [i]nstance number: integer
+  +is  --instance-set [i]nstance number: integer
          use instance number i
+
+burned-in annotation:
+
+  +an  --annotation-yes
+         document contains patient identifying data (default)
+
+  -an  --annotation-no
+         document does not contain patient identifying data
+\endverbatim
+
+\subsection pdf2dcm_processing_options processing options
+\verbatim
+other processing options:
+
+  -k   --key  [k]ey: gggg,eeee="str", path or dictionary name="str"
+         add further attribute
+\endverbatim
+
+\subsection pdf2dcm_output_options output options
+\verbatim
+output file format:
+
+  +F   --write-file
+         write file format (default)
+
+  -F   --write-dataset
+         write data set without file meta information
+
+group length encoding:
+
+  +g=  --group-length-recalc
+         recalculate group lengths if present (default)
+
+  +g   --group-length-create
+         always write with group length elements
+
+  -g   --group-length-remove
+         always write without group length elements
+
+length encoding in sequences and items:
+
+  +e   --length-explicit
+         write with explicit lengths (default)
+
+  -e   --length-undefined
+         write with undefined lengths
+
+data set trailing padding (not with --write-dataset):
+
+  -p   --padding-off
+         no padding (implicit if --write-dataset)
+
+  +p   --padding-create  [f]ile-pad [i]tem-pad: integer
+         align file on multiple of f bytes
+         and items on multiple of i bytes
 \endverbatim
 
 \section pdf2dcm_logging LOGGING
@@ -153,6 +200,30 @@ allows one to summarize common combinations of options/parameters and avoids
 longish and confusing command lines (an example is provided in file
 <em>\<datadir\>/dumppat.txt</em>).
 
+\section pdf2dcm_exit_codes EXIT CODES
+
+The \b pdf2dcm utility uses the following exit codes when terminating.  This
+enables the user to check for the reason why the application terminated.
+
+\subsection pdf2dcm_exit_codes_general general
+\verbatim
+EXITCODE_NO_ERROR                 0
+EXITCODE_COMMANDLINE_SYNTAX_ERROR 1
+EXITCODE_MEMORY_EXHAUSTED         4
+\endverbatim
+
+\subsection pdf2dcm_exit_codes_input_file_errors input file errors
+\verbatim
+EXITCODE_CANNOT_READ_INPUT_FILE   20
+EXITCODE_NO_INPUT_FILES           21
+EXITCODE_INVALID_INPUT_FILE       22
+\endverbatim
+
+\subsection pdf2dcm_exit_codes_output_file_errors output file errors
+\verbatim
+EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40
+\endverbatim
+
 \section pdf2dcm_environment ENVIRONMENT
 
 The \b pdf2dcm utility will attempt to load DICOM data dictionaries specified
@@ -166,7 +237,8 @@ variable only used when alternative data dictionaries are required.  The
 \e DCMDICTPATH environment variable has the same format as the Unix shell
 \e PATH variable in that a colon (":") separates entries.  On Windows systems,
 a semicolon (";") is used as a separator.  The data dictionary code will
-attempt to load each file specified in the \e DCMDICTPATH environment variable.
+attempt to load each file specified in the \e DCMDICTPATH environment
+variable.
 It is an error if no data dictionary can be loaded.
 
 \section pdf2dcm_see_also SEE ALSO
@@ -175,6 +247,6 @@ It is an error if no data dictionary can be loaded.
 
 \section pdf2dcm_copyright COPYRIGHT
 
-Copyright (C) 2005-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2005-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
diff --git a/dcmdata/docs/stl2dcm.man b/dcmdata/docs/stl2dcm.man
new file mode 100644 (file)
index 0000000..e47a7c3
--- /dev/null
@@ -0,0 +1,268 @@
+/*!
+
+\if MANPAGES
+\page stl2dcm Encapsulate STL file into DICOM file format
+\else
+\page stl2dcm stl2dcm: Encapsulate STL file into DICOM file format
+\endif
+
+\section stl2dcm_synopsis SYNOPSIS
+
+\verbatim
+stl2dcm [options] stlfile-in dcmfile-out
+\endverbatim
+
+\section stl2dcm_description DESCRIPTION
+
+The \b stl2dcm utility reads a STL file (\e stlfile-in), converts it to a
+DICOM Encapsulated STL Storage SOP instance and stores the converted data
+to an output file (\e dcmfile-out).
+
+\section stl2dcm_parameters PARAMETERS
+
+\verbatim
+stlfile-in   STL input filename to be encapsulated
+
+dcmfile-out  DICOM output filename
+\endverbatim
+
+\section stl2dcm_options OPTIONS
+
+\subsection stl2dcm_general_options general options
+\verbatim
+  -h   --help
+         print this help text and exit
+
+       --version
+         print version information and exit
+
+       --arguments
+         print expanded command line arguments
+
+  -q   --quiet
+         quiet mode, print no warnings and errors
+
+  -v   --verbose
+         verbose mode, print processing details
+
+  -d   --debug
+         debug mode, print debug information
+
+  -ll  --log-level  [l]evel: string constant
+         (fatal, error, warn, info, debug, trace)
+         use level l for the logger
+
+  -lc  --log-config  [f]ilename: string
+         use config file f for the logger
+\endverbatim
+
+\subsection stl2dcm_dicom_document_options DICOM document options
+\verbatim
+document title:
+
+  +t   --title  [t]itle: string (default: empty)
+         document title
+
+  +cn  --concept-name  [CSD] [CV] [CM]: string (default: empty)
+         coded representation of document title defined by coding
+         scheme designator CSD, code value CV and code meaning CM
+
+patient data:
+
+  +pn  --patient-name  [n]ame: string
+         patient's name in DICOM PN syntax
+
+  +pi  --patient-id  [i]d: string
+         patient identifier
+
+  +pb  --patient-birthdate  [d]ate: string (YYYYMMDD)
+         patient's birth date
+
+  +ps  --patient-sex  [s]ex: string (M, F or O)
+         patient's sex
+
+study and series:
+
+  +sg  --generate
+         generate new study and series UIDs (default)
+
+  +st  --study-from  [f]ilename: string
+         read patient/study data from DICOM file
+
+  +se  --series-from  [f]ilename: string
+         read patient/study/series data from DICOM file
+
+instance number:
+
+  +i1  --instance-one
+         use instance number 1 (default, not with +se)
+
+  +ii  --instance-inc
+         increment instance number (only with +se)
+
+  +is  --instance-set [i]nstance number: integer
+         use instance number i
+
+burned-in annotation:
+
+  +an  --annotation-yes
+         document contains patient identifying data (default)
+
+  -an  --annotation-no
+         document does not contain patient identifying data
+
+enhanced general equipment:
+
+  +mn  --manufacturer  [n]ame: string
+         manufacturer's name
+
+  +mm  --manufacturer-model  [n]ame: string
+         manufacturer's model name
+
+  +ds  --device-serial  [n]umber: string
+         device serial number
+
+  +sv  --software-versions  [v]ersions: string
+         software versions
+
+3d model measurement units:
+
+  +mu  --measurement-units  [CSD] [CV] [CM]: string
+         measurement units with coding scheme designator CSD,
+         code value CV and code meaning CM (default: UCUM, um, um)
+\endverbatim
+
+\subsection stl2dcm_processing_options processing options
+\verbatim
+other processing options:
+
+  -k   --key  [k]ey: gggg,eeee="str", path or dictionary name="str"
+         add further attribute
+\endverbatim
+
+\subsection stl2dcm_output_options output options
+\verbatim
+output file format:
+
+  +F   --write-file
+         write file format (default)
+
+  -F   --write-dataset
+         write data set without file meta information
+
+group length encoding:
+
+  +g=  --group-length-recalc
+         recalculate group lengths if present (default)
+
+  +g   --group-length-create
+         always write with group length elements
+
+  -g   --group-length-remove
+         always write without group length elements
+
+length encoding in sequences and items:
+
+  +e   --length-explicit
+         write with explicit lengths (default)
+
+  -e   --length-undefined
+         write with undefined lengths
+
+data set trailing padding (not with --write-dataset):
+
+  -p   --padding-off
+         no padding (implicit if --write-dataset)
+
+  +p   --padding-create  [f]ile-pad [i]tem-pad: integer
+         align file on multiple of f bytes
+         and items on multiple of i bytes
+\endverbatim
+
+\section stl2dcm_logging LOGGING
+
+The level of logging output of the various command line tools and underlying
+libraries can be specified by the user.  By default, only errors and warnings
+are written to the standard error stream.  Using option \e --verbose also
+informational messages like processing details are reported.  Option
+\e --debug can be used to get more details on the internal activity, e.g. for
+debugging purposes.  Other logging levels can be selected using option
+\e --log-level.  In \e --quiet mode only fatal errors are reported.  In such
+very severe error events, the application will usually terminate.  For more
+details on the different logging levels, see documentation of module "oflog".
+
+In case the logging output should be written to file (optionally with logfile
+rotation), to syslog (Unix) or the event log (Windows) option \e --log-config
+can be used.  This configuration file also allows for directing only certain
+messages to a particular output stream and for filtering certain messages
+based on the module or application where they are generated.  An example
+configuration file is provided in <em>\<etcdir\>/logger.cfg</em>.
+
+\section stl2dcm_command_line COMMAND LINE
+
+All command line tools use the following notation for parameters: square
+brackets enclose optional values (0-1), three trailing dots indicate that
+multiple values are allowed (1-n), a combination of both means 0 to n values.
+
+Command line options are distinguished from parameters by a leading '+' or '-'
+sign, respectively.  Usually, order and position of command line options are
+arbitrary (i.e. they can appear anywhere).  However, if options are mutually
+exclusive the rightmost appearance is used.  This behavior conforms to the
+standard evaluation rules of common Unix shells.
+
+In addition, one or more command files can be specified using an '@' sign as a
+prefix to the filename (e.g. <em>\@command.txt</em>).  Such a command argument
+is replaced by the content of the corresponding text file (multiple
+whitespaces are treated as a single separator unless they appear between two
+quotation marks) prior to any further evaluation.  Please note that a command
+file cannot contain another command file.  This simple but effective approach
+allows one to summarize common combinations of options/parameters and avoids
+longish and confusing command lines (an example is provided in file
+<em>\<datadir\>/dumppat.txt</em>).
+
+\section stl2dcm_exit_codes EXIT CODES
+
+The \b stl2dcm utility uses the following exit codes when terminating.  This
+enables the user to check for the reason why the application terminated.
+
+\subsection stl2dcm_exit_codes_general general
+\verbatim
+EXITCODE_NO_ERROR                 0
+EXITCODE_COMMANDLINE_SYNTAX_ERROR 1
+EXITCODE_MEMORY_EXHAUSTED         4
+\endverbatim
+
+\subsection stl2dcm_exit_codes_input_file_errors input file errors
+\verbatim
+EXITCODE_CANNOT_READ_INPUT_FILE   20
+EXITCODE_NO_INPUT_FILES           21
+EXITCODE_INVALID_INPUT_FILE       22
+\endverbatim
+
+\subsection stl2dcm_exit_codes_output_file_errors output file errors
+\verbatim
+EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40
+\endverbatim
+
+\section stl2dcm_environment ENVIRONMENT
+
+The \b stl2dcm utility will attempt to load DICOM data dictionaries specified
+in the \e DCMDICTPATH environment variable.  By default, i.e. if the
+\e DCMDICTPATH environment variable is not set, the file
+<em>\<datadir\>/dicom.dic</em> will be loaded unless the dictionary is built
+into the application (default for Windows).
+
+The default behavior should be preferred and the \e DCMDICTPATH environment
+variable only used when alternative data dictionaries are required.  The
+\e DCMDICTPATH environment variable has the same format as the Unix shell
+\e PATH variable in that a colon (":") separates entries.  On Windows systems,
+a semicolon (";") is used as a separator.  The data dictionary code will
+attempt to load each file specified in the \e DCMDICTPATH environment
+variable.
+It is an error if no data dictionary can be loaded.
+
+\section stl2dcm_copyright COPYRIGHT
+
+Copyright (C) 2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+
+*/
index da58ac0fff0ea4db32bcf505512f93525583e582..ff2225d20d00ec40aca29b5846d6793a3577c114 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmdata DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmdata DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 82c4c55f1797f886a82698992e7f0ec40f6d2583..f292ca2900134b650b65b9b66d6790c7c8c20863 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2012, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -42,6 +42,8 @@ DCMTK_DCMDATA_EXPORT void prepareCmdLineArgs(int& argc, char** argv, const char*
  *  and allows command line arguments to be input from stdin.
  *  MT level: Thread unsafe!
  *  This is a Windows-specific version supporting the wide character encoding (UTF-16).
+ *  @remark this method is only available if DCMTK is compiled on Windows
+ *  Operating Systems (defining _WIN32)
  *  @param argc the argc parameter of main() is passed in this parameter (not used)
  *  @param argv the argv parameter of main() is passed in this parameter (not used)
  *  @param progname program name (not used)
index 4ec28f36dc7336db212719fdd347d3ea0a2dfe0e..653eabd1b0dd2d5880f05bb0097cab112d186b5a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -90,15 +90,15 @@ class DCMTK_DCMDATA_EXPORT DcmByteString: public DcmElement
      *  object (if applicable).
      *  @param  rhs the right hand side of the comparison
      *  @return 0 if the object values are equal.
-     *          -1 if this element has fewer components than the rhs element.
-     *          Also -1 if the value of the first component that does not match
-     *          is lower in this object than in rhs. Also returned if rhs
-     *          cannot be casted to this object type or both objects are of
-     *          different VR (i.e. the DcmEVR returned by the element's ident()
-     *          call are different).
-     *          1 if either this element has more components than the rhs element, or
-     *          if the first component that does not match is greater in this object than
-     *          in rhs object.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object
+     *    than in rhs object.
      */
     virtual int compare(const DcmElement& rhs) const;
 
@@ -140,6 +140,12 @@ class DCMTK_DCMDATA_EXPORT DcmByteString: public DcmElement
      */
     virtual unsigned long getVM();
 
+    /** get number of values stored in this element.
+     *  The result is the same as getVM() unless overwritten in a derived class.
+     *  @return number of values in this element
+     */
+    virtual unsigned long getNumberOfValues();
+
     /** get length of the stored value.
      *  Trailing spaces (padding characters) are ignored for the "real" length.
      *  @return number of characters stored for the string value
index 9c65121b4a30f790a366979f91ea52c06f8602e1..60b5de50f612431f458b321f49fbfbabd2068df5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2016, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -504,6 +504,8 @@ private:
 
 #ifdef WITH_THREADS
   /// read/write lock guarding access to singleton list
+  /// @remark this member is only available if DCMTK is compiled with thread
+  /// support enabled.
   static OFReadWriteLock codecLock;
 #endif
 
index 069ea11153d4b6b14c24cfff10c278cf26ca8fb6..63ea8be9374af487e712f6da0b4aa53e1c61b893 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -143,15 +143,7 @@ class DCMTK_DCMDATA_EXPORT DcmDataset
                        const char *pixelFileName = NULL,
                        size_t *pixelCounter = NULL);
 
-    /** calculate the length of this DICOM element when encoded with the
-     *  given transfer syntax and the given encoding type for sequences.
-     *  For elements, the length includes the length of the tag, length field,
-     *  VR field and the value itself, for items and sequences it returns
-     *  the length of the complete item or sequence including delimitation tags
-     *  if applicable. Never returns undefined length.
-     *  @param xfer transfer syntax for length calculation
-     *  @param enctype sequence encoding type for length calculation
-     *  @return length of DICOM element
+    /** @copydoc DcmObject::calcElementLength()
      */
     Uint32 calcElementLength(const E_TransferSyntax xfer,
                              const E_EncodingType enctype);
index 188ec628f7ce94dcf260cf36af93f3865555655b..48170f1f08f671eb9e1d04e1c8ac066bd396bc43 100644 (file)
@@ -4,7 +4,7 @@
 **
 **   User: joergr
 **   Host: thinkpad
-**   Date: 2017-12-07 15:02:11
+**   Date: 2018-11-15 17:07:40
 **   Prog: /home/joergr/Source/dcmtk-full/public/dcmdata/libsrc/mkdeftag
 **
 **   From: ../data/dicom.dic
 
 #include "dcmtk/dcmdata/dctagkey.h"
 
-#define DCM_DICT_DEFTAG_BUILD_DATE "2017-12-07 15:02:11"
+#define DCM_DICT_DEFTAG_BUILD_DATE "2018-11-15 17:07:40"
 
 
 /*
 ** Fixed Tags in ascending (gggg,eeee) order.
-** Number of entries: 4254
+** Number of entries: 4306
 ** Tags with a repeating component (repeating tags) are listed later.
 */
 #define DCM_CommandGroupLength                   DcmTagKey(0x0000, 0x0000)
 #define DCM_SeriesDescription                    DcmTagKey(0x0008, 0x103e)
 #define DCM_SeriesDescriptionCodeSequence        DcmTagKey(0x0008, 0x103f)
 #define DCM_InstitutionalDepartmentName          DcmTagKey(0x0008, 0x1040)
+#define DCM_InstitutionalDepartmentTypeCodeSequence DcmTagKey(0x0008, 0x1041)
 #define DCM_PhysiciansOfRecord                   DcmTagKey(0x0008, 0x1048)
 #define DCM_PhysiciansOfRecordIdentificationSequence DcmTagKey(0x0008, 0x1049)
 #define DCM_PerformingPhysicianName              DcmTagKey(0x0008, 0x1050)
 #define DCM_ReferencedRealWorldValueMappingInstanceSequence DcmTagKey(0x0008, 0x114b)
 #define DCM_ReferencedSOPClassUID                DcmTagKey(0x0008, 0x1150)
 #define DCM_ReferencedSOPInstanceUID             DcmTagKey(0x0008, 0x1155)
+#define DCM_DefinitionSourceSequence             DcmTagKey(0x0008, 0x1156)
 #define DCM_SOPClassesSupported                  DcmTagKey(0x0008, 0x115a)
 #define DCM_ReferencedFrameNumber                DcmTagKey(0x0008, 0x1160)
 #define DCM_SimpleFrameList                      DcmTagKey(0x0008, 0x1161)
 #define DCM_CalciumScoringMassFactorDevice       DcmTagKey(0x0018, 0x9352)
 #define DCM_EnergyWeightingFactor                DcmTagKey(0x0018, 0x9353)
 #define DCM_CTAdditionalXRaySourceSequence       DcmTagKey(0x0018, 0x9360)
+#define DCM_MultienergyCTAcquisition             DcmTagKey(0x0018, 0x9361)
+#define DCM_MultienergyCTAcquisitionSequence     DcmTagKey(0x0018, 0x9362)
+#define DCM_MultienergyCTProcessingSequence      DcmTagKey(0x0018, 0x9363)
+#define DCM_MultienergyCTCharacteristicsSequence DcmTagKey(0x0018, 0x9364)
+#define DCM_MultienergyCTXRaySourceSequence      DcmTagKey(0x0018, 0x9365)
+#define DCM_XRaySourceIndex                      DcmTagKey(0x0018, 0x9366)
+#define DCM_XRaySourceID                         DcmTagKey(0x0018, 0x9367)
+#define DCM_MultienergySourceTechnique           DcmTagKey(0x0018, 0x9368)
+#define DCM_SourceStartDateTime                  DcmTagKey(0x0018, 0x9369)
+#define DCM_SourceEndDateTime                    DcmTagKey(0x0018, 0x936a)
+#define DCM_SwitchingPhaseNumber                 DcmTagKey(0x0018, 0x936b)
+#define DCM_SwitchingPhaseNominalDuration        DcmTagKey(0x0018, 0x936c)
+#define DCM_SwitchingPhaseTransitionDuration     DcmTagKey(0x0018, 0x936d)
+#define DCM_EffectiveBinEnergy                   DcmTagKey(0x0018, 0x936e)
+#define DCM_MultienergyCTXRayDetectorSequence    DcmTagKey(0x0018, 0x936f)
+#define DCM_XRayDetectorIndex                    DcmTagKey(0x0018, 0x9370)
+#define DCM_XRayDetectorID                       DcmTagKey(0x0018, 0x9371)
+#define DCM_MultienergyDetectorType              DcmTagKey(0x0018, 0x9372)
+#define DCM_XRayDetectorLabel                    DcmTagKey(0x0018, 0x9373)
+#define DCM_NominalMaxEnergy                     DcmTagKey(0x0018, 0x9374)
+#define DCM_NominalMinEnergy                     DcmTagKey(0x0018, 0x9375)
+#define DCM_ReferencedXRayDetectorIndex          DcmTagKey(0x0018, 0x9376)
+#define DCM_ReferencedXRaySourceIndex            DcmTagKey(0x0018, 0x9377)
+#define DCM_ReferencedPathIndex                  DcmTagKey(0x0018, 0x9378)
+#define DCM_MultienergyCTPathSequence            DcmTagKey(0x0018, 0x9379)
+#define DCM_MultienergyCTPathIndex               DcmTagKey(0x0018, 0x937a)
+#define DCM_MultienergyAcquisitionDescription    DcmTagKey(0x0018, 0x937b)
+#define DCM_MonoenergeticEnergyEquivalent        DcmTagKey(0x0018, 0x937c)
+#define DCM_MaterialCodeSequence                 DcmTagKey(0x0018, 0x937d)
+#define DCM_DecompositionMethod                  DcmTagKey(0x0018, 0x937e)
+#define DCM_DecompositionDescription             DcmTagKey(0x0018, 0x937f)
+#define DCM_DecompositionAlgorithmIdentificationSequence DcmTagKey(0x0018, 0x9380)
+#define DCM_DecompositionMaterialSequence        DcmTagKey(0x0018, 0x9381)
+#define DCM_MaterialAttenuationSequence          DcmTagKey(0x0018, 0x9382)
+#define DCM_PhotonEnergy                         DcmTagKey(0x0018, 0x9383)
+#define DCM_XRayMassAttenuationCoefficient       DcmTagKey(0x0018, 0x9384)
 #define DCM_ProjectionPixelCalibrationSequence   DcmTagKey(0x0018, 0x9401)
 #define DCM_DistanceSourceToIsocenter            DcmTagKey(0x0018, 0x9402)
 #define DCM_DistanceObjectToTableTop             DcmTagKey(0x0018, 0x9403)
 #define DCM_IOLFormulaDetail                     DcmTagKey(0x0022, 0x1029)
 #define DCM_KeratometerIndex                     DcmTagKey(0x0022, 0x1033)
 #define DCM_SourceOfOphthalmicAxialLengthCodeSequence DcmTagKey(0x0022, 0x1035)
+#define DCM_SourceOfCornealSizeDataCodeSequence  DcmTagKey(0x0022, 0x1036)
 #define DCM_TargetRefraction                     DcmTagKey(0x0022, 0x1037)
 #define DCM_RefractiveProcedureOccurred          DcmTagKey(0x0022, 0x1039)
 #define DCM_RefractiveSurgeryTypeCodeSequence    DcmTagKey(0x0022, 0x1040)
 #define DCM_SpecimenPreparationStepContentItemSequence DcmTagKey(0x0040, 0x0612)
 #define DCM_SpecimenLocalizationContentItemSequence DcmTagKey(0x0040, 0x0620)
 #define DCM_RETIRED_SlideIdentifier              DcmTagKey(0x0040, 0x06fa)
+#define DCM_WholeSlideMicroscopyImageFrameTypeSequence DcmTagKey(0x0040, 0x0710)
 #define DCM_ImageCenterPointCoordinatesSequence  DcmTagKey(0x0040, 0x071a)
 #define DCM_XOffsetInSlideCoordinateSystem       DcmTagKey(0x0040, 0x072a)
 #define DCM_YOffsetInSlideCoordinateSystem       DcmTagKey(0x0040, 0x073a)
 #define DCM_RETIRED_ScheduledProcessingApplicationsCodeSequence DcmTagKey(0x0040, 0x4004)
 #define DCM_ScheduledProcedureStepStartDateTime  DcmTagKey(0x0040, 0x4005)
 #define DCM_RETIRED_MultipleCopiesFlag           DcmTagKey(0x0040, 0x4006)
-#define DCM_PerformedProcessingApplicationsCodeSequence DcmTagKey(0x0040, 0x4007)
+#define DCM_RETIRED_PerformedProcessingApplicationsCodeSequence DcmTagKey(0x0040, 0x4007)
+#define DCM_ScheduledProcedureStepExpirationDateTime DcmTagKey(0x0040, 0x4008)
 #define DCM_HumanPerformerCodeSequence           DcmTagKey(0x0040, 0x4009)
 #define DCM_ScheduledProcedureStepModificationDateTime DcmTagKey(0x0040, 0x4010)
 #define DCM_ExpectedCompletionDateTime           DcmTagKey(0x0040, 0x4011)
 #define DCM_ChannelWidth                         DcmTagKey(0x0046, 0x0042)
 #define DCM_PupilSize                            DcmTagKey(0x0046, 0x0044)
 #define DCM_CornealSize                          DcmTagKey(0x0046, 0x0046)
+#define DCM_CornealSizeSequence                  DcmTagKey(0x0046, 0x0047)
 #define DCM_AutorefractionRightEyeSequence       DcmTagKey(0x0046, 0x0050)
 #define DCM_AutorefractionLeftEyeSequence        DcmTagKey(0x0046, 0x0052)
 #define DCM_DistancePupillaryDistance            DcmTagKey(0x0046, 0x0060)
 #define DCM_ColumnPositionInTotalImagePixelMatrix DcmTagKey(0x0048, 0x021e)
 #define DCM_RowPositionInTotalImagePixelMatrix   DcmTagKey(0x0048, 0x021f)
 #define DCM_PixelOriginInterpretation            DcmTagKey(0x0048, 0x0301)
+#define DCM_NumberOfOpticalPaths                 DcmTagKey(0x0048, 0x0302)
+#define DCM_TotalPixelMatrixFocalPlanes          DcmTagKey(0x0048, 0x0303)
 #define DCM_CalibrationImage                     DcmTagKey(0x0050, 0x0004)
 #define DCM_DeviceSequence                       DcmTagKey(0x0050, 0x0010)
 #define DCM_ContainerComponentTypeCodeSequence   DcmTagKey(0x0050, 0x0012)
 #define DCM_SegmentationFractionalType           DcmTagKey(0x0062, 0x0010)
 #define DCM_SegmentedPropertyTypeModifierCodeSequence DcmTagKey(0x0062, 0x0011)
 #define DCM_UsedSegmentsSequence                 DcmTagKey(0x0062, 0x0012)
+#define DCM_SegmentsOverlap                      DcmTagKey(0x0062, 0x0013)
 #define DCM_TrackingID                           DcmTagKey(0x0062, 0x0020)
 #define DCM_TrackingUID                          DcmTagKey(0x0062, 0x0021)
 #define DCM_DeformableRegistrationSequence       DcmTagKey(0x0064, 0x0002)
 #define DCM_TwoDPlaneIntersection                DcmTagKey(0x0068, 0x65f0)
 #define DCM_ThreeDPlaneOrigin                    DcmTagKey(0x0068, 0x6610)
 #define DCM_ThreeDPlaneNormal                    DcmTagKey(0x0068, 0x6620)
+#define DCM_ModelModification                    DcmTagKey(0x0068, 0x7001)
+#define DCM_ModelMirroring                       DcmTagKey(0x0068, 0x7002)
+#define DCM_ModelUsageCodeSequence               DcmTagKey(0x0068, 0x7003)
 #define DCM_GraphicAnnotationSequence            DcmTagKey(0x0070, 0x0001)
 #define DCM_GraphicLayer                         DcmTagKey(0x0070, 0x0002)
 #define DCM_BoundingBoxAnnotationUnits           DcmTagKey(0x0070, 0x0003)
 #define DCM_UsedFiducialsSequence                DcmTagKey(0x0070, 0x0314)
 #define DCM_GraphicCoordinatesDataSequence       DcmTagKey(0x0070, 0x0318)
 #define DCM_FiducialUID                          DcmTagKey(0x0070, 0x031a)
+#define DCM_ReferencedFiducialUID                DcmTagKey(0x0070, 0x031b)
 #define DCM_FiducialSetSequence                  DcmTagKey(0x0070, 0x031c)
 #define DCM_FiducialSequence                     DcmTagKey(0x0070, 0x031e)
 #define DCM_FiducialsPropertyCategoryCodeSequence DcmTagKey(0x0070, 0x031f)
 #define DCM_ModifyingSystem                      DcmTagKey(0x0400, 0x0563)
 #define DCM_SourceOfPreviousValues               DcmTagKey(0x0400, 0x0564)
 #define DCM_ReasonForTheAttributeModification    DcmTagKey(0x0400, 0x0565)
+#define DCM_InstanceOriginStatus                 DcmTagKey(0x0400, 0x0600)
 #define DCM_RETIRED_EscapeTriplet                DcmTagKey(0x1000, 0x0010)
 #define DCM_RETIRED_RunLengthTriplet             DcmTagKey(0x1000, 0x0011)
 #define DCM_RETIRED_HuffmanTableSize             DcmTagKey(0x1000, 0x0012)
 #define DCM_RTRelatedROISequence                 DcmTagKey(0x3006, 0x0030)
 #define DCM_RTROIRelationship                    DcmTagKey(0x3006, 0x0033)
 #define DCM_ROIGenerationAlgorithm               DcmTagKey(0x3006, 0x0036)
+#define DCM_ROIDerivationAlgorithmIdentificationSequence DcmTagKey(0x3006, 0x0037)
 #define DCM_ROIGenerationDescription             DcmTagKey(0x3006, 0x0038)
 #define DCM_ROIContourSequence                   DcmTagKey(0x3006, 0x0039)
 #define DCM_ContourSequence                      DcmTagKey(0x3006, 0x0040)
 #define DCM_AlternateBeamDose                    DcmTagKey(0x300a, 0x0091)
 #define DCM_AlternateBeamDoseType                DcmTagKey(0x300a, 0x0092)
 #define DCM_DepthValueAveragingFlag              DcmTagKey(0x300a, 0x0093)
+#define DCM_BeamDosePointSourceToExternalContourDistance DcmTagKey(0x300a, 0x0094)
 #define DCM_NumberOfBrachyApplicationSetups      DcmTagKey(0x300a, 0x00a0)
 #define DCM_BrachyApplicationSetupDoseSpecificationPoint DcmTagKey(0x300a, 0x00a2)
 #define DCM_BrachyApplicationSetupDose           DcmTagKey(0x300a, 0x00a4)
index 9ee637d14559adbffd0fe037c28152fd377cda97..962ebb9373af17c0151c27a789b2614e2c9d1a46 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2015, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -236,9 +236,13 @@ public:
    */
   DcmDataDictionary& wrlock();
 
-  /** unlocks the read or write lock which must have been acquired previously.
+  /** unlocks the read lock which must have been acquired previously.
    */
-  void unlock();
+  void rdunlock();
+
+  /** unlocks the write lock which must have been acquired previously.
+   */
+  void wrunlock();
 
   /** checks if a data dictionary has been loaded. This method acquires and
    *  releases a read lock. It must not be called with another lock on the
@@ -274,6 +278,8 @@ private:
 
 #ifdef WITH_THREADS
   /** the read/write lock used to protect access from multiple threads
+   *  @remark this member is only available if DCMTK is compiled with thread
+   *  support enabled.
    */
   OFReadWriteLock dataDictLock;
 #endif
index c409eabce78bc0f0b566d35741c60263f2219370..701c036c6db5eac8773e90ca70bbc0ec85b31bec 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2016, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -105,7 +105,7 @@ typedef enum {
     ERT_HangingProtocol = 35,
     /// stereometric relationships
     ERT_Stereometric = 36,
-    /// HL7 structured document
+    /// HL7 structured document (retired)
     ERT_HL7StrucDoc = 37,
     /// palette
     ERT_Palette = 38,
@@ -461,7 +461,7 @@ protected:
 
     // side-effect-free conversion routines:
     E_DirRecType        recordNameToType(const char *recordTypeName);
-    char*               buildFileName(const char *origName, char *destName);
+    char*               buildFileName(const char *origName, char *destName, size_t len) const;
     OFCondition         checkHierarchy(const E_DirRecType upperRecord,
                                        const E_DirRecType lowerRecord);
 
index 5540eb0f21b0e85ab9742dfef5171f82b9ac79b3..7bdf6ed7349c6a5e3981a4f5ca710c47957107d3 100644 (file)
@@ -82,18 +82,18 @@ class DCMTK_DCMDATA_EXPORT DcmElement
      *  the object (if applicable).
      *  @param  rhs the right hand side of the comparison
      *  @return 0 if the object values are equal.
-     *          -1 if this element has fewer components than the rhs element.
-     *          Also -1 if the value of the first component that does not match
-     *          is lower in this object than in rhs. Also returned if rhs
-     *          cannot be casted to this object type or both objects are of
-     *          different VR (i.e. the DcmEVR returned by the element's ident()
-     *          call are different).
-     *          1 if either this element has more components than the rhs element, or
-     *          if the first component that does not match is greater in this object than
-     *          in rhs object.
-     *          If the function is overwritten by derived classes, the behaviour might
-     *          slightly change but all methods will return 0 on equality, and 1 or -1
-     *          if different.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object
+     *    than in rhs object.
+     *    If the function is overwritten by derived classes, the behaviour might
+     *    slightly change but all methods will return 0 on equality, and 1 or -1
+     *    if different.
      */
     virtual int compare(const DcmElement& rhs) const =0;
 
@@ -111,15 +111,7 @@ class DCMTK_DCMDATA_EXPORT DcmElement
      */
     virtual OFCondition copyFrom(const DcmObject& rhs);
 
-    /** calculate the length of this DICOM element when encoded with the
-     *  given transfer syntax and the given encoding type for sequences.
-     *  For elements, the length includes the length of the tag, length field,
-     *  VR field and the value itself, for items and sequences it returns
-     *  the length of the complete item or sequence including delimitation tags
-     *  if applicable. Never returns undefined length.
-     *  @param xfer transfer syntax for length calculation
-     *  @param enctype sequence encoding type for length calculation
-     *  @return length of DICOM element
+    /** @copydoc DcmObject::calcElementLength()
      */
     virtual Uint32 calcElementLength(const E_TransferSyntax xfer,
                                      const E_EncodingType enctype);
@@ -780,6 +772,20 @@ class DCMTK_DCMDATA_EXPORT DcmElement
                                       const DcmElement& candidateFirst,
                                       const DcmElement& candidateSecond) const;
 
+    /** returns a pointer to the input stream, if available, NULL otherwise.
+     *  In general, this pointer is available when the element is part of a dataset
+     *  that has been read from a DICOM file, the file is not encoded in deflate
+     *  transfer syntax, and the element value is large enough that loading the value
+     *  has been postponed to the first read access. The DcmInputStreamFactory object
+     *  can create an instance of a file stream seeked to the right position within
+     *  the DICOM file from where the element value can be read.
+     *  @return pointer to the input stream factory of the element, null if no object is available
+     */
+    inline const DcmInputStreamFactory* getInputStream() const
+    {
+        return fLoadValue;
+    }
+
     /* --- static helper functions --- */
 
     /** scan string value for conformance with given value representation (VR)
@@ -794,6 +800,16 @@ class DCMTK_DCMDATA_EXPORT DcmElement
                          const size_t pos = 0,
                          const size_t num = OFString_npos);
 
+    /** scan string value for conformance with given value representation (VR)
+     *  @param vr two-character identifier of the VR to be checked (lower case)
+     *  @param value string value to be scanned
+     *  @param size number of characters to be scanned in 'value'
+     *  @return numeric identifier of the VR found, 16 in case of unknown VR
+     */
+    static int scanValue(const OFString &vr,
+                         const char* const value,
+                         const size_t size);
+
     /** determine the number of values stored in a string, i.e.\ the value multiplicity (VM)
      *  @param str character string
      *  @param len length of the string (number of characters without the trailing NULL byte)
diff --git a/dcmdata/include/dcmtk/dcmdata/dcencdoc.h b/dcmdata/include/dcmtk/dcmdata/dcencdoc.h
new file mode 100755 (executable)
index 0000000..511d5d2
--- /dev/null
@@ -0,0 +1,290 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  dcmdata
+ *
+ *  Author:  Pedro Arizpe
+ *
+ *  Purpose: Class to control document encapsulation into DICOM files
+ *
+ */
+
+#ifndef DCENCDOC_H
+#define DCENCDOC_H
+//make sure OS specific configuration is included first
+#include "dcmtk/config/osconfig.h"
+//for override keys
+#include "dcmtk/dcmdata/dcpath.h"
+#include "dcmtk/dcmdata/dctk.h"
+#include "dcmtk/dcmiod/iodcommn.h"
+#include "dcmtk/ofstd/ofconapp.h"
+#include "dcmtk/ofstd/ofxml.h"
+
+
+/** This class handles common functions of all command line applications
+ *  for document encapsulation.
+ */
+class DCMTK_DCMDATA_EXPORT DcmEncapsulatedDocument
+{
+public:
+  ///Constructor
+  DcmEncapsulatedDocument();
+
+  ///Destructor
+  ~DcmEncapsulatedDocument();
+
+  /** This function is only used to process CDA files.
+   *  It retrieves all entries of an attribute and returns them separated by backslashes.
+   *  @param fileNode the root XML node.
+   *  @param attr the attribute to search for.
+   *  @return OFstring containing all entries found, separated by double backslashes
+   */
+  OFString XMLgetAllAttributeValues(XMLNode fileNode, OFString attr);
+
+  /** This function is only used to process CDA files.
+   *  It retrieves the value from the CDA document
+   *  corresponding to the DCM Tag. According to Standard v. 2013 part20/sect_A.8.
+   *  @param fileNode the root XML node.
+   *  @param attr the tag to search for in the CDA file.
+   *  @return OFstring containing the value of the corresponding tag.
+   */
+  OFString XMLgetAttribute(XMLNode fileNode, DcmTagKey attr);
+
+  /** Retrieves patient, concept and document data from the CDA file and checks for data conflicts
+   *  with series, study and user input. It also retrieves all mediatypes found in the CDA document.
+   *  @param filename The filename of the CDA document.
+   *  @param appLogger The logger of the application calling this method.
+   *  @return EXITCODE_NO_ERROR (0) if successful or error code in case of failure.
+   */
+  int getCDAData(const char *filename, OFLogger &appLogger);
+
+  /** Recursive function used by getAttributeValues to get all occurrences of an attribute as list.
+   *  @param currnode the current XML node to be processed.
+   *  @param results a pointer to the list of strings where the results should be stored.
+   *  @param attr the attribute to search for.
+   *  @return OFTrue if the attribute value was found, OFFalse otherwise.
+   */
+  OFBool XMLsearchAttribute(XMLNode currnode, OFList<OFString> *results, OFString attr);
+
+  /** Add CDA specific command line options to the OFCommandLine object
+   *  passed to the constructor.
+   *  @param cmd a reference to an OFCommandLine object used to parse
+   *    the command line argument give to the calling application.
+   *  @return none.
+   */
+  void addCDACommandlineOptions(OFCommandLine& cmd);
+
+  /** Add PDF specific command line options to the OFCommandLine object
+   *  passed to the constructor.
+   *  @param cmd a reference to an OFCommandLine object used to parse
+   *    the command line argument give to the calling application.
+   *  @return none.
+   */
+  void addPDFCommandlineOptions(OFCommandLine& cmd);
+
+  /** Add STL specific command line options to the OFCommandLine object
+   *  passed to the constructor.
+   *  @param cmd a reference to an OFCommandLine object used to parse
+   *    the command line argument give to the calling application.
+   *  @return none.
+   */
+  void addSTLCommandlineOptions(OFCommandLine& cmd);
+
+  /** Add general command line options to the OFCommandLine object
+   *  passed to the constructor.
+   *  @param cmd a reference to an OFCommandLine object used to parse
+   *    the command line argument give to the calling application.
+   *  @return none.
+   */
+  void addGeneralOptions(OFCommandLine &cmd);
+
+  /** Add command line options specific for documents to the OFCommandLine
+   *  object passed to the constructor.
+   *  @param cmd a reference to an OFCommandLine object used to parse
+   *    the command line argument give to the calling application.
+   *  @return none.
+   */
+  void addDocumentOptions(OFCommandLine &cmd);
+
+  /** Add command line options specific for output to the OFCommandLine
+   *  object passed to the constructor.
+   *  @param cmd a reference to an OFCommandLine object used to parse
+   *    the command line argument give to the calling application.
+   *  @return none.
+   */
+  void addOutputOptions(OFCommandLine &cmd);
+
+  /** Parse and evaluate the given command line arguments.
+   *  @param app a reference to an OFConsoleApplication object used in the
+   *    calling application.
+   *  @param cmd a reference to an OFCommandLine object used to parse
+   *    the command line argument give to the calling application.
+   *  @return none.
+   */
+  void parseArguments(OFConsoleApplication& app, OFCommandLine& cmd);
+
+  /** Includes basic information into the DICOM file.
+   *  @param dataset a reference to a DcmItem containing the information to be included.
+   *  @param logger The logger of the application calling this method.
+   *  @return EC_Normal if successful, an error code otherwise.
+   */
+  OFCondition createHeader (DcmItem *dataset,
+    OFLogger& logger);
+
+  /** Correctly inserts encapsulated document data.
+   *  @param dataset The dataset to which we should encapsulate this document.
+   *  @param logger The logger of the application calling this method.
+   *  @return EXITCODE_NO_ERROR (0) if successful or error code in case of failure.
+   */
+  int insertEncapsulatedDocument(DcmItem *dataset,
+    OFLogger& logger);
+
+  /** Get study or series data from provided file. Generate UID if none present.
+   *  @param logger The logger of the application calling this method.
+   *  @return EC_Normal if successful, an error code otherwise.
+   */
+  OFCondition createIdentifiers(OFLogger& appLogger);
+
+  /** Copy override keys over existing keys in given dataset.
+   *  @param outputDset dataset to which the override keys are copied
+   *  @return EC_Normal if successful, an error code otherwise.
+   */
+  OFCondition applyOverrideKeys(DcmDataset *outputDset);
+
+  /** Specifies some attributes that should be inserted after encapsulation
+   *  They will override any identical attributes already existing in the resulting encapsulated
+   *  DICOM object. The override keys are applied at the very end of the conversion and do not
+   *  undergo any validity checking.
+   *  @param ovkeys override keys that can be tags, dictionary names and paths (see DcmPath
+   *  for syntax). Also it is permitted to set a value if appropriate, e. g. "PatientName=Doe^John"
+   *  would be a valid overridekey.
+   *  @return none.
+   */
+  void setOverrideKeys(const OFList<OFString>& ovkeys);
+
+  /** Returns the input file name.
+   *  @return the input file name as OFString.
+   */
+  OFString getInputFileName();
+
+  /** Sets the input file name to the given string.
+   *  @param fName the file name to be set.
+   *  @return none.
+   */
+  void setInputFileName(OFString fName);
+
+  /** Returns the output file name.
+   *  @return the output file name as OFString.
+   */
+  OFString getOutputFileName();
+
+  /** Sets the output file name.
+   *  @param fName the file name to be set.
+   *  @return none.
+   */
+  void setOutputFileName(OFString fName);
+
+  /** Attempt to save the output file .
+   *  @param fileformat the DICOM Fileformat including the output file params.
+   *  @return Error code as condition, if error occurs, EC_Normal otherwise.
+   */
+  OFCondition saveFile(DcmFileFormat fileformat);
+
+  /** Returns the transfer syntax.
+   *  @return the transfer syntax as E_TransferSyntax.
+   */
+  E_TransferSyntax getTransferSyntax();
+
+  /** Returns the current filetype.
+   *  @return the current filetype as OFString.
+   */
+  OFString getFileType();
+
+  /** Sets the current filetype.
+   *  @param fName the current filetype.
+   *  @return none.
+   */
+  void setFileType(OFString fType);
+
+private:
+  ///input file name
+  OFString             opt_ifname;
+  ///output file name
+  OFString             opt_ofname;
+
+  ///optional parameters
+  ///*patient data
+  OFString             opt_patientBirthdate;
+  OFString             opt_patientID;
+  OFString             opt_patientName;
+  OFString             opt_patientSex;
+  ///*concept data
+  OFString             opt_conceptCM;
+  OFString             opt_conceptCSD;
+  OFString             opt_conceptCV;
+  ///*document specific options
+  OFString             opt_documentTitle;
+  OFString             opt_seriesFile;
+  OFString             opt_seriesUID;
+  OFString             opt_studyUID;
+
+  ///*assign default values for file encoding and padding
+  E_EncodingType          opt_oenctype;
+  E_FileWriteMode         opt_writeMode;
+  E_GrpLenEncoding        opt_oglenc;
+  E_PaddingEncoding       opt_opadenc;
+  E_TransferSyntax        opt_oxfer;
+  OFCmdUnsignedInt        opt_filepad;
+  OFCmdUnsignedInt        opt_itempad;
+  ///*pre-existing series
+  OFBool                  opt_readSeriesInfo;
+  OFBool                  opt_annotation;
+  OFBool                  opt_increment;
+
+  OFCmdSignedInt          opt_instance;
+  /** These attributes are applied to the dataset after conversion
+   * (They are not checked by the isValid() function).
+   */
+  OFList<OFString>        opt_overrideKeys;
+
+  ///CDA specific variables
+  OFString                cda_mediaTypes;
+  OFString                hl7_InstanceIdentifier;
+  OFBool                  opt_override;
+
+  /// STL specific variables
+  /// Frame of Reference module
+  OFString                opt_frameOfReferenceUID;
+  OFString                opt_positionReferenceIndicator;
+  ///Enhanced general equipment module
+  /// Manufacturer (VM 1)
+  OFString                opt_manufacturer;
+  /// Manufacturer's Model Name (VM 1)
+  OFString                opt_manufacturerModelName;
+  /// Device Serial Number (VM 1)
+  OFString                opt_deviceSerialNumber;
+  /// Software Version(s) (VM 1-n)
+  OFString                opt_softwareVersions;
+
+  /// Manufacturing 3D Model Module
+  /// 3d Model Measurement Units Code Meaning
+  OFString                opt_measurementUnitsCM;
+  /// 3d Model Measurement Units Code Scheme Designator
+  OFString                opt_measurementUnitsCSD;
+  /// 3d Model Measurement Units Code Value
+  OFString                opt_measurementUnitsCV;
+
+  ///Type of file currently being converted.
+  OFString ftype;
+};
+#endif // DCENCDOC_H
index 85a9d5af736ca44aebef2d213e710d86e6c8634b..1dcbf9a48e93cbb631f378771a4a0fd9d83ccfe2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2016, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -150,15 +150,7 @@ class DCMTK_DCMDATA_EXPORT DcmFileFormat
      */
     DcmDataset *getAndRemoveDataset();
 
-    /** calculate the length of this DICOM element when encoded with the
-     *  given transfer syntax and the given encoding type for sequences.
-     *  For elements, the length includes the length of the tag, length field,
-     *  VR field and the value itself, for items and sequences it returns
-     *  the length of the complete item or sequence including delimitation tags
-     *  if applicable. Never returns undefined length.
-     *  @param xfer transfer syntax for length calculation
-     *  @param enctype sequence encoding type for length calculation
-     *  @return length of DICOM element
+    /** @copydoc DcmObject::calcElementLength()
      */
     virtual Uint32 calcElementLength(const E_TransferSyntax xfer,
                                      const E_EncodingType enctype);
index 8fc5ce94b97b003186c1a2ff8a34c69ab44f40e7..f9ce25b99ae10f0a98a0bcc94c0a3028348811e9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2011, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -30,7 +30,7 @@
 
 class DcmInputStream;
 
-/** pure virtual abstract base class for producers, i.e. the initial node 
+/** pure virtual abstract base class for producers, i.e. the initial node
  *  of a filter chain in an input stream.
  */
 class DCMTK_DCMDATA_EXPORT DcmProducer
@@ -71,26 +71,26 @@ public:
   /** reads as many bytes as possible into the given block.
    *  @param buf pointer to memory block, must not be NULL
    *  @param buflen length of memory block
-   *  @return number of bytes actually read. 
+   *  @return number of bytes actually read.
    */
   virtual offile_off_t read(void *buf, offile_off_t buflen) = 0;
 
   /** skips over the given number of bytes (or less)
    *  @param skiplen number of bytes to skip
-   *  @return number of bytes actually skipped. 
+   *  @return number of bytes actually skipped.
    */
   virtual offile_off_t skip(offile_off_t skiplen) = 0;
 
   /** resets the stream to the position by the given number of bytes.
    *  @param num number of bytes to putback. If the putback operation
-   *    fails, the producer status becomes bad. 
+   *    fails, the producer status becomes bad.
    */
   virtual void putback(offile_off_t num) = 0;
 
 };
 
 
-/** pure virtual abstract base class for input filters, i.e. 
+/** pure virtual abstract base class for input filters, i.e.
  *  intermediate nodes of a filter chain in an input stream.
  */
 class DCMTK_DCMDATA_EXPORT DcmInputFilter: public DcmProducer
@@ -103,7 +103,7 @@ public:
   }
 
   /** determines the producer from which the filter is supposed
-   *  to read it's input. Once a producer for the input filter has 
+   *  to read it's input. Once a producer for the input filter has
    *  been defined, it cannot be changed anymore during the lifetime
    *  of the object.
    *  @param producer reference to producer, must not be circular chain
@@ -111,6 +111,16 @@ public:
   virtual void append(DcmProducer& producer) = 0;
 };
 
+/** this enum identifies subclasses of class DcmInputStreamFactory.
+ */
+enum DcmInputStreamFactoryType
+{
+  /// class DcmInputFileStreamFactory
+  DFT_DcmInputFileStreamFactory,
+
+  /// class DcmInputTempFileStreamFactory
+  DFT_DcmInputTempFileStreamFactory
+};
 
 /** pure virtual abstract base class for input stream factories,
  *  i.e. objects that can create a new input stream
@@ -130,8 +140,14 @@ public:
   virtual DcmInputStream *create() const = 0;
 
   /** returns a pointer to a copy of this object
+   *  @return pointer to a copy of this object
    */
   virtual DcmInputStreamFactory *clone() const = 0;
+
+  /** returns an enum describing the class to which this instance belongs
+   *  @return class to which this instance belongs
+   */
+  virtual DcmInputStreamFactoryType ident() const = 0;
 };
 
 
@@ -173,13 +189,13 @@ public:
   /** reads as many bytes as possible into the given block.
    *  @param buf pointer to memory block, must not be NULL
    *  @param buflen length of memory block
-   *  @return number of bytes actually read. 
+   *  @return number of bytes actually read.
    */
   virtual offile_off_t read(void *buf, offile_off_t buflen);
 
   /** skips over the given number of bytes (or less)
    *  @param skiplen number of bytes to skip
-   *  @return number of bytes actually skipped. 
+   *  @return number of bytes actually skipped.
    */
   virtual offile_off_t skip(offile_off_t skiplen);
 
@@ -218,7 +234,7 @@ public:
   virtual void mark();
 
   /** resets the stream to the position previously marked with
-   *  setPutbackMark(). If the putback operation fails (no putback mark 
+   *  setPutbackMark(). If the putback operation fails (no putback mark
    *  set or putback buffer exceeded), status of the producer switches to bad.
    */
   virtual void putback();
index aab2064f762f756171e5afb3c3c09123394ee43f..e900ab8fa56c79237eca3d30b2971ad67c13c798 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2012, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -137,8 +137,31 @@ public:
     return new DcmInputFileStreamFactory(*this);
   }
 
-private:
+  /** returns an enum describing the class to which this instance belongs
+   *  @return class to which this instance belongs
+   */
+  virtual DcmInputStreamFactoryType ident() const
+  {
+    return DFT_DcmInputFileStreamFactory;
+  }
 
+  /** returns name of the file
+   *  @return name of file
+   */
+  virtual OFFilename const & getFilename() const
+  {
+      return filename_;
+  }
+
+  /** returns offset of the data in the file
+   *  @return offset of the data in the file
+   */
+  virtual offile_off_t getOffset() const
+  {
+      return offset_;
+  }
+
+private:
 
   /// private unimplemented copy assignment operator
   DcmInputFileStreamFactory& operator=(const DcmInputFileStreamFactory&);
@@ -252,6 +275,8 @@ private:
 
 #ifdef WITH_THREADS
   /// mutex for MT-safe reference counting
+  /// @remark this member is only available if DCMTK is compiled with thread
+  /// support enabled.
   OFMutex mutex_;
 #endif
 
@@ -286,6 +311,14 @@ public:
    */
   virtual DcmInputStreamFactory *clone() const;
 
+  /** returns an enum describing the class to which this instance belongs
+   *  @return class to which this instance belongs
+   */
+  virtual DcmInputStreamFactoryType ident() const
+  {
+    return DFT_DcmInputTempFileStreamFactory;
+  }
+
 private:
 
   /// private unimplemented copy assignment operator
index 1c12feaf86167da82ce7e652b26ad6b7ba61ff33..0cf4687b693d411b3651fc71194db5f0d83d16e8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2011, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -36,10 +36,14 @@ END_EXTERN_C
  *  When true, the input stream is expected to be in deflated ZLIB format 
  *  instead of deflated bitstream format (i.e. RFC 1950 instead of RFC 1951).
  *  Default is false, i.e. DICOM compliant behavior.
+ *  @remark this flag is only available if DCMTK is compiled with
+ *  ZLIB support enabled.
  */
 extern DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmZlibExpectRFC1950Encoding;
 
 /** zlib compression filter for input streams
+ *  @remark this class is only available if DCMTK is compiled with
+ *  ZLIB support enabled.
  */
 class DCMTK_DCMDATA_EXPORT DcmZLibInputFilter: public DcmInputFilter
 {
index c53e3ad5c31a4d6eedcd9edc5de20c143006ddcc..73ef7ae4be4e082047af178e2778dbd87d2b58f5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -137,6 +137,12 @@ class DCMTK_DCMDATA_EXPORT DcmItem
      */
     virtual unsigned long getVM();
 
+    /** get number of values (elements) stored in this item.
+     *  The result is the same as card() unless overwritten in a derived class.
+     *  @return number of elements in this item
+     */
+    virtual unsigned long getNumberOfValues();
+
     /** get cardinality of this item
      *  @return number of elements in this item
      */
index 173103e88bdd8394d36ff9c36f01bac7f51bf092..d60b18e041072a3e3c87ed4b3e627da1cd212cff 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *
-*  Copyright (C) 2017, OFFIS e.V.
+*  Copyright (C) 2017-2018, OFFIS e.V.
 *  All rights reserved.  See COPYRIGHT file for details.
 *
 *  This software and supporting documentation were developed by
@@ -181,14 +181,14 @@ public:
     static void printValueString(STD_NAMESPACE ostream &out,
                                  const OFString &value);
 
-    /** Print either null if empty or a Number as normelized IntegerString
+    /** Print either null if empty or a Number as normalized IntegerString
      *  @param out output stream to which the Value prefix is written
      *  @param value String that should be printed
      */
     static void printNumberInteger(STD_NAMESPACE ostream &out,
                                    OFString &value);
 
-    /** Print either null if empty or a Number as normelized IntegerDecimal
+    /** Print either null if empty or a Number as normalized IntegerDecimal
      *  @param out output stream to which the Value prefix is written
      *  @param value String that should be printed
      */
@@ -204,6 +204,10 @@ public:
 
     }
 
+    /** Virtual destructor, does nothing
+     */
+    virtual ~DcmJsonFormat() {}
+
     /** Method to return line break(s)
      *  @return line break(s).
      */
index 1c3389666fe7bf2f58cda85545d4e87f6f5afe0d..07dd4eb7dc94f9cfa969fb25d16e1f25f8e594b1 100644 (file)
@@ -41,6 +41,83 @@ class DCMTK_DCMDATA_EXPORT DcmAttributeMatching
 {
 public:
 
+    /** Helper class for parsing value range pairs, as in date/time ranges.
+     */
+    struct Range
+    {
+        /** Separate the given value into two range components (if possible).
+         *  @param data any data that might be a range of values.
+         *  @param size the size in bytes of the value(s) passed as data.
+         *  @param separator optional argument for using another separator than the default
+         *    one (dash character '-').
+         */
+        Range( const void* const data, const size_t size, const char separator = '-' );
+
+        /** Return the information whether *this refers to an actual range of values or
+         *  just a single value.
+         *  @return OFTrue if the given argument is a range of values (i.e. contains the
+         *    given/default range separator character), OFFalse otherwise.
+         */
+        OFBool isRange() const;
+
+        /** Return the information whether *this refers to an open range without a definite
+         *  beginning.
+         *  @return OFTrue if the given argument is an open range without a definite beginning
+         *    OFFalse otherwise.
+         */
+        OFBool hasOpenBeginning() const;
+
+        /** Return the information whether *this refers to an open range without a definite
+         *  end.
+         *  @return OFTrue if the given argument is an open range without a definite end
+         *    OFFalse otherwise.
+         */
+        OFBool hasOpenEnd() const;
+
+        /** The first value in the range, i.e. the beginning of the range.
+         *  @note this will contain the whole value if the argument is not a range of values,
+         *    use isRange() to retrieve that information.
+         */
+        const char* first;
+
+        /** The size in bytes of the first value, will be zero if the argument is an open range
+         *  with no definite beginning.
+         */
+        size_t firstSize;
+
+        /** The second value in the range, e.g. the end of the range.
+         *  @note this will also contain the whole value if the argument is not a range of values,
+         *    use isRange() to retrieve that information.
+         */
+        const char* second;
+
+        /** The size in bytes of the second value, will be zero if the argument is an open range
+         *  with no definite end.
+         */
+        size_t secondSize;
+    };
+
+    /** Check whether the given query data conforms to the VR DA.
+     *  @param queryData a pointer to some data.
+     *  @param querySize the size (in bytes) of the data queryData refers to.
+     *  @return OFTrue if the query is a valid Date or Date Range, OFFalse otherwise.
+     */
+    static OFBool isDateQuery( const void* queryData, const size_t querySize );
+
+    /** Check whether the given query data conforms to the VR TM.
+     *  @param queryData a pointer to some data.
+     *  @param querySize the size (in bytes) of the data queryData refers to.
+     *  @return OFTrue if the query is a valid Time or Time Range, OFFalse otherwise.
+     */
+    static OFBool isTimeQuery( const void* queryData, const size_t querySize );
+
+    /** Check whether the given query data conforms to the VR DT.
+     *  @param queryData a pointer to some data.
+     *  @param querySize the size (in bytes) of the data queryData refers to.
+     *  @return OFTrue if the query is a valid Date Time or Date Time Range, OFFalse otherwise.
+     */
+    static OFBool isDateTimeQuery( const void* queryData, const size_t querySize );
+
     /** Match the query data and the candidate using Single Value Matching, as defined by the DICOM standard.
      *  @param queryData a pointer to some data.
      *  @param querySize the size (in bytes) of the data queryData refers to.
@@ -218,8 +295,27 @@ private:
     /// Helper class for implementing Wild Card Matching
     class WildCardMatcher;
 
-    /// Helper class for parsing dash-separated value pairs, as in date/time ranges.
-    class DashSeparated;
+    /** Helper function for generically implementing check functions operating on ranges.
+     *  @param check a pointer to a function that checks a single value of the given query.
+     *  @param queryData a pointer to some data.
+     *  @param querySize the size (in bytes) of the data queryData refers to.
+     *  @return logical AND of the results of the given check function applied to the
+     *    beginning and the end of the range (as available).
+     */
+    static OFBool checkRangeQuery( OFBool (*check)(const char*,const size_t),
+                                   const void* queryData, const size_t querySize );
+
+    /** Helper template function for generically implementing range matching.
+     *  @tparam T the type to parse the data int (e.g. OFDate), deduced automatically.
+     *  @param parse a pointer to a function that parses a string as a T.
+     *  @param query the already separated (but not parsed) query.
+     *  @param candidate the already parsed candidate.
+     *  @return OFTrue if parsing of the query was successful and candidate equals
+     *    the query value or lies within the range defined by the query. OFFalse otherwise.
+     */
+    template<typename T>
+    static OFBool rangeMatchingTemplate( OFCondition (*parse)(const char*,const size_t,T&),
+                                         const Range& query, const T& candidate );
 
     /** Helper template function for generically implementing range matching.
      *  @tparam T the type to parse the data int (e.g. OFDate), deduced automatically.
index f0c880d8e4db9d7f266135100e54405145afc585..4342a955c262f3d2187c10807ea12e756bb52707 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2016, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -131,15 +131,7 @@ class DCMTK_DCMDATA_EXPORT DcmMetaInfo
      */
     virtual void transferEnd();
 
-    /** calculate the length of this DICOM element when encoded with the
-     *  given transfer syntax and the given encoding type for sequences.
-     *  For elements, the length includes the length of the tag, length field,
-     *  VR field and the value itself, for items and sequences it returns
-     *  the length of the complete item or sequence including delimitation tags
-     *  if applicable. Never returns undefined length.
-     *  @param xfer transfer syntax for length calculation
-     *  @param enctype sequence encoding type for length calculation
-     *  @return length of DICOM element
+    /** @copydoc DcmObject::calcElementLength()
      */
     virtual Uint32 calcElementLength(const E_TransferSyntax xfer,
                                      const E_EncodingType enctype);
index 4dadd592d3f203f02c422635c6961dc29369dce6..5acb6fed005508a42887bc109f3554a9375cf39e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -411,17 +411,31 @@ class DCMTK_DCMDATA_EXPORT DcmObject
      */
     virtual OFCondition setVR(DcmEVR /*vr*/) { return EC_IllegalCall; }
 
-    /** return value multiplicity of the current object
-     *  @return value multiplicity of the current object
+    /** get value multiplicity of this object.
+     *  Please note that depending on the Value Representation (VR), subclasses
+     *  derived from this class either return the number of currently stored
+     *  values or the constant value 1 (as defined in the DICOM standard).
+     *  See getNumberOfValues(), which always returns the number of stored values.
+     *  @return value multiplicity of this object
      */
     virtual unsigned long getVM() = 0;
 
+    /** get number of values stored in this object
+     *  @return number of values in this object
+     */
+    virtual unsigned long getNumberOfValues() = 0;
+
     /** calculate the length of this DICOM element when encoded with the
      *  given transfer syntax and the given encoding type for sequences.
      *  For elements, the length includes the length of the tag, length field,
      *  VR field and the value itself, for items and sequences it returns
      *  the length of the complete item or sequence including delimitation tags
-     *  if applicable. Never returns undefined length.
+     *  if applicable.
+     *  @warning Since calcElementLength() returns a 32 bit integer, an
+     *    overflow during calculation is possible for some derived classes that
+     *    actually represent a compound value (e.g. items like DcmPixelItem).
+     *    Such overflows will be detected, in which case the maximum possible
+     *    value will be returned instead, coinciding with DCM_UndefinedLength.
      *  @param xfer transfer syntax for length calculation
      *  @param enctype sequence encoding type for length calculation
      *  @return length of DICOM element
index 32bfa92432e184f87eba9052cb967d9f99b8e929..302cc81895a76c9620483fa7428cc0075d0b3121 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2011, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -35,10 +35,14 @@ END_EXTERN_C
 /** global flag defining the compression level for zlib (deflate) compression.
  *  Legal values are 0..9. Default is Z_DEFAULT_COMPRESSION which is defined
  *  to be 6 for the current zlib implementation.
+ *  @remark this flag is only available if DCMTK is compiled with
+ *  ZLIB support enabled.
  */
 extern DCMTK_DCMDATA_EXPORT OFGlobal<int> dcmZlibCompressionLevel;
 
-/** zlib compression filter for output streams
+/** zlib compression filter for output streams.
+ *  @remark this class is only available if DCMTK is compiled with
+ *  ZLIB support enabled.
  */
 class DCMTK_DCMDATA_EXPORT DcmZLibOutputFilter: public DcmOutputFilter
 {
index f8dc5057e5173a22984b86df0f55e7b164076b73..c3061c5ffc07f14692307b00d8b2ed749d9a8445 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -467,13 +467,23 @@ public:
         const Uint16 * wordValue,
         const unsigned long length);
 
-    /** create an empty Uint8 array of given number of words and set it
+    /** create an empty Uint8 array of given number of bytes and set it.
+     *  All array elements are initialized with a value of 0 (using 'memzero').
+     *  This method is only applicable to certain VRs, e.g. OB.
+     *  @param numBytes number of bytes (8 bit) to be created
+     *  @param bytes stores the pointer to the resulting buffer
+     *  @return status, EC_Normal if successful, an error code otherwise
      */
     virtual OFCondition createUint8Array(
         const Uint32 numBytes,
         Uint8 * & bytes);
 
-    /** create an empty Uint16 array of given number of words and set it
+    /** create an empty Uint16 array of given number of words and set it.
+     *  All array elements are initialized with a value of 0 (using 'memzero').
+     *  This method is only applicable to OW data.
+     *  @param numWords number of words (16 bit) to be created
+     *  @param words stores the pointer to the resulting buffer
+     *  @return status, EC_Normal if successful, an error code otherwise
      */
     virtual OFCondition createUint16Array(
         const Uint32 numWords,
@@ -541,8 +551,8 @@ public:
      */
     void removeAllButOriginalRepresentations();
 
-    /** removes all but the current representation
-     *  Makes the current representation original
+    /** removes all but the current representation.
+     *  Makes the current representation original.
      */
     void removeAllButCurrentRepresentations();
 
index c19a9a8deaf0c61283e8ef89f8b3756628ccd0ac..fbe57e55b56b000f763f58ce7f14215935db5508 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -117,15 +117,7 @@ public:
                        const char *pixelFileName = NULL,
                        size_t *pixelCounter = NULL);
 
-    /** calculate the length of this DICOM element when encoded with the
-     *  given transfer syntax and the given encoding type for sequences.
-     *  For elements, the length includes the length of the tag, length field,
-     *  VR field and the value itself, for items and sequences it returns
-     *  the length of the complete item or sequence including delimitation tags
-     *  if applicable. Never returns undefined length.
-     *  @param xfer transfer syntax for length calculation
-     *  @param enctype sequence encoding type for length calculation
-     *  @return length of DICOM element
+    /** @copydoc DcmObject::calcElementLength()
      */
     virtual Uint32 calcElementLength(const E_TransferSyntax xfer,
                                      const E_EncodingType enctype);
index 77e4493576b6e3bfc51098a42390cb977576f0cf..231b90e94f532e48a372bb366bb13b5ae1099e44 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -65,7 +65,7 @@ class DCMTK_DCMDATA_EXPORT DcmPixelItem : public DcmOtherByteOtherWord
      *  @param obj element to be copied
      *  @return reference to this object
      */
-    DcmPixelItem &operator=(const DcmPixelItem &obj) { DcmOtherByteOtherWord::operator=(obj); return *this; }
+    DcmPixelItem &operator=(const DcmPixelItem &obj);
 
     /** clone method
      *  @return deep copy of this object
index f23f25428ec2d22d07e59a691c178437c251e62f..3e20d27d54c6032cec36fcf036e12230a9709222 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -156,7 +156,18 @@ public:
     /** get value multiplicity
      *  @return always returns 1 (according to the DICOM standard)
      */
-    virtual unsigned long getVM() { return 1L; }
+    virtual unsigned long getVM();
+
+    /** get number of values (items) stored in this sequence.
+     *  The result is the same as card() unless overwritten in a derived class.
+     *  @return number of items in this sequence
+     */
+    virtual unsigned long getNumberOfValues();
+
+    /** get cardinality of this sequence
+     *  @return number of items in this sequence
+     */
+    virtual unsigned long card() const;
 
     /** This function takes care of group length and padding elements
      *  in the current element list according to what is specified in
@@ -343,11 +354,6 @@ public:
      */
     virtual OFCondition convertCharacterSet(DcmSpecificCharacterSet &converter);
 
-    /** get cardinality of this sequence
-     *  @return number of items in this sequence
-     */
-    virtual unsigned long card() const;
-
     /** insert the given item at the start of the item list maintained by this sequence.
      *  Ownership of the item, which must be allocated on the heap, is transferred to the sequence.
      *  @param item pointer to DcmItem instance allocated on the heap, must not be NULL.
index b6275e3e7f715427a3256c57a19e667fb14020a1..42a301e0145e59b60fc746c454e3616c57145c11 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2014, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -139,42 +139,42 @@ public:
      *  @param key key to compare with
      *  @return true if tag keys are the same
      */
-    inline int operator == (const DcmTagKey& key) const;
+    inline OFBool operator == (const DcmTagKey& key) const;
 
     /** negation operator. Returns true if either group or element number
      *  are not the same.
      *  @param key key to compare with
      *  @return true if tag keys are not the same
      */
-    inline int operator != (const DcmTagKey& key) const;
+    inline OFBool operator != (const DcmTagKey& key) const;
 
     /** 'less than' operator. Returns true if the given tag key is greater
      *  than "this".
      *  @param key key to compare with
      *  @return true if given key is greater than "this"
      */
-    inline int operator < (const DcmTagKey& key) const;
+    inline OFBool operator < (const DcmTagKey& key) const;
 
     /** 'greater than' operator. Returns true if the given tag key is smaller
      *  than "this".
      *  @param key key to compare with
      *  @return true if "this" key is smaller than given one.
      */
-    inline int operator > (const DcmTagKey& key) const;
+    inline OFBool operator > (const DcmTagKey& key) const;
 
     /** 'less or equal' operator. Returns true if the given tag key is greater
      *  or the same as "this".
      *  @param key key to compare with
      *  @return true if given key is greater or the same as "this"
      */
-    inline int operator <= (const DcmTagKey& key) const;
+    inline OFBool operator <= (const DcmTagKey& key) const;
 
     /** 'greater or equal' operator. Returns true if the given tag key is
      *  smaller or equal as "this".
      *  @param key key to compare with
      *  @return true if "this" key is smaller or equal to given one.
      */
-    inline int operator >= (const DcmTagKey& key) const;
+    inline OFBool operator >= (const DcmTagKey& key) const;
 
     friend DCMTK_DCMDATA_EXPORT STD_NAMESPACE ostream& operator<<(STD_NAMESPACE ostream& s, const DcmTagKey& k);
 
@@ -380,37 +380,37 @@ DcmTagKey::elementEQ(const DcmTagKey& key) const
     return getElement() == key.getElement();
 }
 
-inline int
+inline OFBool
 DcmTagKey::operator == (const DcmTagKey& key) const
 {
     return ( groupEQ(key) && elementEQ(key) );
 }
 
-inline int
+inline OFBool
 DcmTagKey::operator != (const DcmTagKey& key) const
 {
     return !(*this == key);
 }
 
-inline int
+inline OFBool
 DcmTagKey::operator < (const DcmTagKey& key) const
 {
     return (groupLT(key) || (groupEQ(key) && elementLT(key)));
 }
 
-inline int
+inline OFBool
 DcmTagKey::operator > (const DcmTagKey& key) const
 {
     return (groupGT(key) || (groupEQ(key) && elementGT(key)));
 }
 
-inline int
+inline OFBool
 DcmTagKey::operator <= (const DcmTagKey& key) const
 {
     return (*this < key) || (*this == key);
 }
 
-inline int
+inline OFBool
 DcmTagKey::operator >= (const DcmTagKey& key) const
 {
     return (*this > key) || (*this == key);
index e8b4320a3be23e70771bae5949690e6334529c7c..fb2464c4f41f4159cb89dc1b0247d04d33a274d5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -370,16 +370,16 @@ DCMTK_DCMDATA_EXPORT unsigned long dcmGuessModalityBytes(const char *sopClassUID
 /// RLE Lossless
 #define UID_RLELosslessTransferSyntax           "1.2.840.10008.1.2.5"
 
-/** MIME encapsulation (Supplement 101) is only a pseudo transfer syntax used to
- *  refer to MIME encapsulated HL7 CDA documents from a DICOMDIR when stored
- *  on a DICOM storage medium. It is never used for network communication
+/** RFC 2557 MIME Encapsulation (RETIRED) was only a pseudo transfer syntax used
+ *  to refer to MIME encapsulated HL7 CDA documents from a DICOMDIR when stored
+ *  on a DICOM storage medium. It was never used for network communication
  *  or encoding of DICOM objects.
  */
 #define UID_RFC2557MIMEEncapsulationTransferSyntax "1.2.840.10008.1.2.6.1"
 
-/** XML encoding (Supplement 114) is only a pseudo transfer syntax used to refer to
+/** XML Encoding (RETIRED) was only a pseudo transfer syntax used to refer to
  *  encapsulated HL7 CDA documents from a DICOMDIR when stored on a DICOM storage
- *  medium. It is never used for network communication or encoding of DICOM objects.
+ *  medium. It was never used for network communication or encoding of DICOM objects.
  */
 #define UID_XMLEncodingTransferSyntax "1.2.840.10008.1.2.6.2"
 
@@ -487,7 +487,7 @@ DCMTK_DCMDATA_EXPORT unsigned long dcmGuessModalityBytes(const char *sopClassUID
 #define UID_OphthalmicOpticalCoherenceTomographyEnFaceImageStorage "1.2.840.10008.5.1.4.1.1.77.1.5.7"
 #define UID_OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage "1.2.840.10008.5.1.4.1.1.77.1.5.8"
 #define UID_VLWholeSlideMicroscopyImageStorage                     "1.2.840.10008.5.1.4.1.1.77.1.6"
-#define UID_RETIRED_VLMultiFrameImageStorage                       "1.2.840.10008.5.1.4.1.1.77.2"
+#define UID_RETIRED_VLMultiframeImageStorage                       "1.2.840.10008.5.1.4.1.1.77.2"
 #define UID_LensometryMeasurementsStorage                          "1.2.840.10008.5.1.4.1.1.78.1"
 #define UID_AutorefractionMeasurementsStorage                      "1.2.840.10008.5.1.4.1.1.78.2"
 #define UID_KeratometryMeasurementsStorage                         "1.2.840.10008.5.1.4.1.1.78.3"
@@ -519,6 +519,7 @@ DCMTK_DCMDATA_EXPORT unsigned long dcmGuessModalityBytes(const char *sopClassUID
 #define UID_ContentAssessmentResultsStorage                        "1.2.840.10008.5.1.4.1.1.90.1"
 #define UID_EncapsulatedPDFStorage                                 "1.2.840.10008.5.1.4.1.1.104.1"
 #define UID_EncapsulatedCDAStorage                                 "1.2.840.10008.5.1.4.1.1.104.2"
+#define UID_EncapsulatedSTLStorage                                 "1.2.840.10008.5.1.4.1.1.104.3"
 #define UID_PositronEmissionTomographyImageStorage                 "1.2.840.10008.5.1.4.1.1.128"
 #define UID_LegacyConvertedEnhancedPETImageStorage                 "1.2.840.10008.5.1.4.1.1.128.1"
 #define UID_RETIRED_StandalonePETCurveStorage                      "1.2.840.10008.5.1.4.1.1.129"
index ff49abf5b06194eb9f730004a74f3a0ccad5973b..7db51d0e5c745ac5aced97b5910721286bae0d3e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -269,7 +269,10 @@ public:
       setVR(evr);
     }
 
-    /** constructor
+    /** constructor.
+     *  Please note that only the first two characters of the passed string are
+     *  actually checked.  Value Representations that are labeled for internal
+     *  use only are mapped to EVR_UNKNOWN.
      *  @param vrName symbolic name of value representation
      */
     DcmVR(const char* vrName)
@@ -291,7 +294,10 @@ public:
      */
     void setVR(DcmEVR evr);
 
-    /** assign new VR value by name
+    /** assign new VR value by name.
+     *  Please note that only the first two characters of the passed string are
+     *  actually checked.  Value Representations that are labeled for internal
+     *  use only are mapped to EVR_UNKNOWN.
      *  @param vrName symbolic name of value representation
      */
     void setVR(const char* vrName);
index 6cfb93a20234f4adad36c55fd8ae8efbeed90003..4189aef408e281516d8dd70f03489c5bb2174520 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -73,15 +73,15 @@ class DCMTK_DCMDATA_EXPORT DcmAttributeTag
      *  object (if applicable).
      *  @param  rhs the right hand side of the comparison
      *  @return 0 if the object values are equal.
-     *          -1 if this element has fewer components than the rhs element.
-     *          Also -1 if the value of the first component that does not match
-     *          is lower in this object than in rhs. Also returned if rhs
-     *          cannot be casted to this object type or both objects are of
-     *          different VR (i.e. the DcmEVR returned by the element's ident()
-     *          call are different).
-     *          1 if either this element has more components than the rhs element, or
-     *          if the first component that does not match is greater in this object than
-     *          in rhs object.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    the first component that does not match is greater in this object than
+     *    in rhs object.
      */
     virtual int compare(const DcmElement& rhs) const;
 
@@ -127,6 +127,11 @@ class DCMTK_DCMDATA_EXPORT DcmAttributeTag
      */
     virtual unsigned long getVM();
 
+    /** get number of values stored in this element
+     *  @return number of values in this element
+     */
+    virtual unsigned long getNumberOfValues();
+
     /** print element to a stream.
      *  The output format of the value is a backslash separated sequence of group and
      *  element value pairs, e.g. "(0008,0020)\(0008,0030)"
index 8e216272d6a1c295439419fac1bf0a72aaa97760..bfda1a3255305820e3ae3472b1b637987ba677f0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -254,6 +254,27 @@ class DCMTK_DCMDATA_EXPORT DcmDate
                                                      OFString &formattedDate,
                                                      const OFBool supportOldFormat = OFTrue);
 
+    /** check whether the given string conforms to a single value of VR "DA" (Date).
+     *  The old (prior V3.0) date format is considered invalid.
+     *  @param dicomDate string value to be checked. An empty string is not regarded as valid
+     *    input, since the date would be unknown
+     *  @param dicomDateSize the size (in bytes) of the string 'dicomDate' refers to
+     *  @return OFTrue if the given string conforms to the Date format, OFFalse otherwise
+     */
+    static OFBool check(const char *dicomDate, const size_t dicomDateSize);
+
+    /** check whether the given string conforms to a single value of VR "DA" (Date).
+     *  @param dicomDate string value to be checked. An empty string is not regarded as valid
+     *    input, since the date would be unknown
+     *  @param dicomDateSize the size (in bytes) of the string 'dicomDate' refers to
+     *  @param supportOldFormat whether to accept the old (prior V3.0) date format.
+     *    Set to OFTrue for enabling support for "YYYY.MM.DD" in addition to "YYYYMMDD".
+     *  @return OFTrue if the given string conforms to the Date format, OFFalse otherwise
+     */
+    static OFBool check(const char *dicomDate,
+                        const size_t dicomDateSize,
+                        const OFBool supportOldFormat);
+
     /** check whether given string value conforms to the VR "DA" (Date)
      *  and to the specified VM.
      *  @param value string value to be checked (possibly multi-valued)
index c5d49f214715a58ecb23cece080e8c3ed6c9b319..fbfc646e19ed2ac2d6db21f33200437e34b63b88 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -282,6 +282,14 @@ class DCMTK_DCMDATA_EXPORT DcmDateTime
                                                          const OFString &dateTimeSeparator = " ",
                                                          const OFString &timeZoneSeparator = " ");
 
+    /** check whether the given string conforms to a single value of VR "DT" (Date Time).
+     *  @param dicomDateTime string value to be checked
+     *  @param dicomDateTimeSize the size (in bytes) of the string 'dicomDateTime' refers to
+     *  @return OFTrue if the given string conforms to the Date Time format, OFFalse otherwise
+     */
+    static OFBool check(const char *dicomDateTime,
+                        const size_t dicomDateTimeSize);
+
     /** check whether given string value conforms to the VR "DT" (Date Time)
      *  and to the specified VM.
      *  @param value string value to be checked (possibly multi-valued)
index b78108dd17b74797704a19653469b85022e2df65..c89f31aa6659e50f6fb44ca6bad307a2b98b0a70 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -69,13 +69,13 @@ class DCMTK_DCMDATA_EXPORT DcmFloatingPointDouble
      *  object (if applicable).
      *  @param  rhs the right hand side of the comparison
      *  @return 0 if the object values are equal.
-     *          -1 if either the value of the  first component that does not match
-     *          is lower in this object than in rhs, or all compared components match
-     *          but this object has fewer components than rhs. Also returned if rhs
-     *          cannot be casted to this object type.
-     *          1 if either the value of the first component that does not match
-     *          is greater in this object than in rhs object, or all compared
-     *          components match but the this component is longer.
+     *    -1 if either the value of the  first component that does not match
+     *    is lower in this object than in rhs, or all compared components match
+     *    but this object has fewer components than rhs. Also returned if rhs
+     *    cannot be casted to this object type.
+     *    1 if either the value of the first component that does not match
+     *    is greater in this object than in rhs object, or all compared
+     *    components match but the this component is longer.
      */
     virtual int compare(const DcmElement& rhs) const;
 
@@ -116,10 +116,15 @@ class DCMTK_DCMDATA_EXPORT DcmFloatingPointDouble
                                    const OFBool oldFormat = OFFalse);
 
     /** get value multiplicity
-     *  @return number of currently stored values
+     *  @return number of values in this element
      */
     virtual unsigned long getVM();
 
+    /** get number of values stored in this element
+     *  @return number of values in this element
+     */
+    virtual unsigned long getNumberOfValues();
+
     /** print element to a stream.
      *  The output format of the value is a backslash separated sequence of numbers.
      *  This function uses a variable number of digits for the floating point values
index 81b415470437349fee005eaa3e6c8cf8af0c6b64..052dc30421933101e659886bf82eab010e89115a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -69,15 +69,15 @@ class DCMTK_DCMDATA_EXPORT DcmFloatingPointSingle
      *  object (if applicable).
      *  @param  rhs the right hand side of the comparison
      *  @return 0 if the object values are equal.
-     *          -1 if this element has fewer components than the rhs element.
-     *          Also -1 if either the value of the first component that does not match
-     *          is lower in this object than in rhs. Also returned if rhs
-     *          cannot be casted to this object type or both objects are of
-     *          different VR (i.e. the DcmEVR returned by the element's ident()
-     *          call are different).
-     *          1 if either this element has more components than the rhs element, or
-     *          if the first component that does not match is greater in this object than
-     *          in rhs object.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if either the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object
+     *    than in rhs object.
      */
     virtual int compare(const DcmElement& rhs) const;
 
@@ -118,10 +118,15 @@ class DCMTK_DCMDATA_EXPORT DcmFloatingPointSingle
                                    const OFBool oldFormat = OFFalse);
 
     /** get value multiplicity
-     *  @return number of currently stored values
+     *  @return number of values in this element
      */
     virtual unsigned long getVM();
 
+    /** get number of values stored in this element
+     *  @return number of values in this element
+     */
+    virtual unsigned long getNumberOfValues();
+
     /** print element to a stream.
      *  The output format of the value is a backslash separated sequence of numbers.
      *  This function uses a variable number of digits for the floating point values
index 2709cf1212a4f3355dca58d1e91c289dbc61b6d4..846cada8896b1bb3a373292ef6db4ac368a02911 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -57,6 +57,26 @@ class DCMTK_DCMDATA_EXPORT DcmLongText
      */
     DcmLongText &operator=(const DcmLongText &obj);
 
+    /** comparison operator that compares the normalized value of this object
+     *  with a given object of the same type. The tag of the element is also
+     *  considered as the first component that is compared, followed by the
+     *  object types (VR, i.e. DCMTK'S EVR) and the comparison of all value
+     *  components of the object, preferably in the order declared in the
+     *  object (if applicable).
+     *  @param  rhs the right hand side of the comparison
+     *  @return 0 if the object values are equal.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object
+     *    than in rhs object.
+     */
+    virtual int compare(const DcmElement& rhs) const;
+
     /** clone method
      *  @return deep copy of this object
      */
index b9e1dbd6797a44400d63a19fcd712b023e0b0fe4..febc13a898bd66c4f48a00688ab6fcce242e4950 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -65,15 +65,15 @@ class DCMTK_DCMDATA_EXPORT DcmOtherByteOtherWord
      *  does compare the values of two elements in local endianness.
      *  @param  rhs the right hand side of the comparison
      *  @return 0 if the object values are equal.
-     *          -1 if this element has fewer components than the rhs element.
-     *          Also -1 if the value of the first component that does not match
-     *          is lower in this object than in rhs. Also returned if rhs
-     *          cannot be casted to this object type or both objects are of
-     *          different VR (i.e. the DcmEVR returned by the element's ident()
-     *          call are different).
-     *          1 if either this element has more components than the rhs element, or
-     *          if the first component that does not match is greater in this object than
-     *          in rhs object.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object
+     *    than in rhs object.
      */
     virtual int compare(const DcmElement& rhs) const;
 
@@ -127,6 +127,11 @@ class DCMTK_DCMDATA_EXPORT DcmOtherByteOtherWord
      */
     virtual unsigned long getVM();
 
+    /** get number of values stored in this element
+     *  @return number of values in this element
+     */
+    virtual unsigned long getNumberOfValues();
+
     /** set/change the current value representation
      *  @param vr new value representation to be set.  All VRs except for OW (Other
      *    Word String) are treated as 8 bit data (OB).  This is particularly useful
index 2ae66a732bda7f3b902a29b47bd90af68f86dd3e..984f6b9fcb9405b0b462b0038e28be3be48da7d8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -69,15 +69,15 @@ class DCMTK_DCMDATA_EXPORT DcmSignedLong
      *  object (if applicable).
      *  @param  rhs the right hand side of the comparison
      *  @return 0 if the object values are equal.
-     *          -1 if this element has fewer components than the rhs element.
-     *          Also -1 if the value of the first component that does not match
-     *          is lower in this object than in rhs. Also returned if rhs
-     *          cannot be casted to this object type or both objects are of
-     *          different VR (i.e. the DcmEVR returned by the element's ident()
-     *          call are different).
-     *          1 if either this element has more components than the rhs element, or
-     *          if the first component that does not match is greater in this object than
-     *          in rhs object.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object than
+     *    in rhs object.
      */
     virtual int compare(const DcmElement& rhs) const;
 
@@ -118,10 +118,15 @@ class DCMTK_DCMDATA_EXPORT DcmSignedLong
                                    const OFBool oldFormat = OFFalse);
 
     /** get value multiplicity
-     *  @return number of currently stored values
+     *  @return number of values in this element
      */
     virtual unsigned long getVM();
 
+    /** get number of values stored in this element
+     *  @return number of values in this element
+     */
+    virtual unsigned long getNumberOfValues();
+
     /** print element to a stream.
      *  The output format of the value is a backslash separated sequence of numbers.
      *  @param out output stream
index 9208ad95b3a5ccedc1feabfc6aa3d0536ac1a567..405abf70d955c5bf582e99aeb5193d351b491924 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -63,15 +63,15 @@ class DCMTK_DCMDATA_EXPORT DcmSignedShort
      *  object (if applicable).
      *  @param  rhs the right hand side of the comparison
      *  @return 0 if the object values are equal.
-     *          -1 if this element has fewer components than the rhs element.
-     *          Also -1 if the value of the first component that does not match
-     *          is lower in this object than in rhs. Also returned if rhs
-     *          cannot be casted to this object type or both objects are of
-     *          different VR (i.e. the DcmEVR returned by the element's ident()
-     *          call are different).
-     *          1 if either this element has more components than the rhs element, or
-     *          if the first component that does not match is greater in this object than
-     *          in rhs object.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object
+     *    than in rhs object.
      */
     virtual int compare(const DcmElement& rhs) const;
 
@@ -117,12 +117,16 @@ class DCMTK_DCMDATA_EXPORT DcmSignedShort
     virtual OFCondition checkValue(const OFString &vm = "1-n",
                                    const OFBool oldFormat = OFFalse);
 
-    /** get value multiplicity.
-     *  The number of entries can be determined by "getVM()".
-     *  @return number of currently stored values
+    /** get value multiplicity
+     *  @return number of values in this element
      */
     virtual unsigned long getVM();
 
+    /** get number of values stored in this element
+     *  @return number of values in this element
+     */
+    virtual unsigned long getNumberOfValues();
+
     /** print element to a stream.
      *  The output format of the value is a backslash separated sequence of numbers.
      *  @param out output stream
index 490b6bb06a28e335c668bacafe56d9987127a555..e012a46910f6da2f7e35b61fbd30008bbec88e88 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -58,6 +58,26 @@ class DCMTK_DCMDATA_EXPORT DcmShortText
      */
     DcmShortText &operator=(const DcmShortText &obj);
 
+    /** comparison operator that compares the normalized value of this object
+     *  with a given object of the same type. The tag of the element is also
+     *  considered as the first component that is compared, followed by the
+     *  object types (VR, i.e. DCMTK'S EVR) and the comparison of all value
+     *  components of the object, preferably in the order declared in the
+     *  object (if applicable).
+     *  @param  rhs the right hand side of the comparison
+     *  @return 0 if the object values are equal.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object
+     *    than in rhs object.
+     */
+    virtual int compare(const DcmElement& rhs) const;
+
     /** clone method
      *  @return deep copy of this object
      */
index f475717a614dc4002fcacbfff4734c36371cfd2b..295146beec767b64896c6cd723270baa15759f8e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -372,6 +372,26 @@ class DCMTK_DCMDATA_EXPORT DcmTime
                                              const size_t dicomTimeZoneSize,
                                              double &timeZone);
 
+    /** check whether given string conforms to a single value of VR "TM" (Time).
+     *  The old ACR/NEMA time format is considered invalid.
+     *  @param dicomTime string value to be checked
+     *  @param dicomTimeSize the size (in bytes) of the string 'dicomTime' refers to
+     *  @return OFTrue if the given string conforms to the Time format, OFFalse otherwise
+     */
+    static OFBool check(const char* dicomTime, const size_t dicomTimeSize);
+
+    /** check whether given string conforms to a single value of VR "TM" (Time).
+     *  @param dicomTime string value to be checked
+     *  @param dicomTimeSize the size (in bytes) of the string 'dicomTime' refers to
+     *  @param supportOldFormat whether to accept the old ACR/NEMA time format.
+     *    Set to OFTrue for enabling support for (HH:MM:SS in addition to HHMMSS...).
+     *    Defaults to OFFalse, disabling it by default.
+     *  @return OFTrue if the given string conforms to the Time format, OFFalse otherwise
+     */
+    static OFBool check(const char* dicomTime, /* STOP: DICOM time!! */
+                        const size_t dicomTimeSize,
+                        const OFBool supportOldFormat);
+
     /** check whether given string value conforms to the VR "TM" (Time)
      *  and to the specified VM.
      *  @param value string value to be checked (possibly multi-valued)
index 60dad2efba6935e154c68406e110598de6b5d8b1..e43073d5131e64d8810d173b03020b8c01f6d23b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -69,15 +69,15 @@ class DCMTK_DCMDATA_EXPORT DcmUnsignedLong
      *  object (if applicable).
      *  @param  rhs the right hand side of the comparison
      *  @return 0 if the object values are equal.
-     *          -1 if this element has fewer components than the rhs element.
-     *          Also -1 if the value of the first component that does not match
-     *          is lower in this object than in rhs. Also returned if rhs
-     *          cannot be casted to this object type or both objects are of
-     *          different VR (i.e. the DcmEVR returned by the element's ident()
-     *          call are different).
-     *          1 if either this element has more components than the rhs element, or
-     *          if the first component that does not match is greater in this object than
-     *          in rhs object.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object
+     *    than in rhs object.
      */
     virtual int compare(const DcmElement& rhs) const;
 
@@ -118,10 +118,15 @@ class DCMTK_DCMDATA_EXPORT DcmUnsignedLong
                                    const OFBool oldFormat = OFFalse);
 
     /** get value multiplicity
-     *  @return number of currently stored values
+     *  @return number of values in this element
      */
     virtual unsigned long getVM();
 
+    /** get number of values stored in this element
+     *  @return number of values in this element
+     */
+    virtual unsigned long getNumberOfValues();
+
     /** print element to a stream.
      *  The output format of the value is a backslash separated sequence of numbers.
      *  @param out output stream
index ff8e67b98c1d0b3c411096c6c3e9b8010bf1e2f1..a8a989b52aef2b82923ad6d38f0053e0cb4321ed 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2014-2017, OFFIS e.V.
+ *  Copyright (C) 2014-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -60,6 +60,26 @@ class DCMTK_DCMDATA_EXPORT DcmUniversalResourceIdentifierOrLocator
      */
     DcmUniversalResourceIdentifierOrLocator &operator=(const DcmUniversalResourceIdentifierOrLocator &obj);
 
+    /** comparison operator that compares the normalized value of this object
+     *  with a given object of the same type. The tag of the element is also
+     *  considered as the first component that is compared, followed by the
+     *  object types (VR, i.e. DCMTK'S EVR) and the comparison of all value
+     *  components of the object, preferably in the order declared in the
+     *  object (if applicable).
+     *  @param  rhs the right hand side of the comparison
+     *  @return 0 if the object values are equal.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object
+     *    than in rhs object.
+     */
+    virtual int compare(const DcmElement& rhs) const;
+
     /** clone method
      *  @return deep copy of this object
      */
index 8b0c73bf8e93e540462517efbcf94eced21b2e4b..ef328ae4f672ec160c5c3bc2d2d13df4d01b3705 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -59,15 +59,15 @@ class DCMTK_DCMDATA_EXPORT DcmUnsignedShort
      *  object (if applicable).
      *  @param  rhs the right hand side of the comparison
      *  @return 0 if the object values are equal.
-     *          -1 if this element has fewer components than the rhs element.
-     *          Also -1 if the value of the first component that does not match
-     *          is lower in this object than in rhs. Also returned if rhs
-     *          cannot be casted to this object type or both objects are of
-     *          different VR (i.e. the DcmEVR returned by the element's ident()
-     *          call are different).
-     *          1 if either this element has more components than the rhs element, or
-     *          if the first component that does not match is greater in this object than
-     *          in rhs object.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object
+     *    than in rhs object.
      */
     virtual int compare(const DcmElement& rhs) const;
 
@@ -118,10 +118,15 @@ class DCMTK_DCMDATA_EXPORT DcmUnsignedShort
                                    const OFBool oldFormat = OFFalse);
 
     /** get value multiplicity
-     *  @return number of currently stored values
+     *  @return number of values in this element
      */
     virtual unsigned long getVM();
 
+    /** get number of values stored in this element
+     *  @return number of values in this element
+     */
+    virtual unsigned long getNumberOfValues();
+
     /** print element to a stream.
      *  The output format of the value is a backslash separated sequence of numbers.
      *  @param out output stream
index 2a92423b52cad7a43dc8822b7fd4ace6c8df286e..a0b6248cd1e3980c110145af1f700c741172a4a2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -59,6 +59,26 @@ class DCMTK_DCMDATA_EXPORT DcmUnlimitedText
      */
     DcmUnlimitedText &operator=(const DcmUnlimitedText &obj);
 
+    /** comparison operator that compares the normalized value of this object
+     *  with a given object of the same type. The tag of the element is also
+     *  considered as the first component that is compared, followed by the
+     *  object types (VR, i.e. DCMTK'S EVR) and the comparison of all value
+     *  components of the object, preferably in the order declared in the
+     *  object (if applicable).
+     *  @param  rhs the right hand side of the comparison
+     *  @return 0 if the object values are equal.
+     *    -1 if this element has fewer components than the rhs element.
+     *    Also -1 if the value of the first component that does not match
+     *    is lower in this object than in rhs. Also returned if rhs
+     *    cannot be casted to this object type or both objects are of
+     *    different VR (i.e. the DcmEVR returned by the element's ident()
+     *    call are different).
+     *    1 if either this element has more components than the rhs element, or
+     *    if the first component that does not match is greater in this object than
+     *    in rhs object.
+     */
+    virtual int compare(const DcmElement& rhs) const;
+
     /** clone method
      *  @return deep copy of this object
      */
index 232b12865e1a7d0e7eddb5ed5fbaad654a7aa95a..bd0d99e2891ac8de0f09de45b3981e6eadea5ddb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -165,7 +165,8 @@ typedef enum
     /// unsupported stream compression
   , ESC_unsupported = 1
 #ifdef WITH_ZLIB
-    /// zlib stream compression
+    /// zlib stream compression.
+    /// This enum value only available if DCMTK is compiled with ZLIB support enabled.
   , ESC_zlib = 2
 #endif
 } E_StreamCompression;
@@ -287,6 +288,15 @@ public:
         return streamCompression;
     }
 
+    /** check whether transfer syntax uses (0028,7FE0) Pixel Data Provider URL
+     *  to reference pixel data
+     *  @return true if transfer syntax uses URL reference to pixel data
+     */
+    inline OFBool isReferenced() const
+    {
+        return referenced;
+    }
+
     /** return the number of bytes needed to describe the tag, length, VR
      *  and any reserved fields for this transfer syntax when encoding the
      *  specified VR.
@@ -331,6 +341,10 @@ private:
 
     /// transfer syntax stream compression type
     E_StreamCompression streamCompression;
+
+    /// flag indicating whether this transfer syntax uses a pixel data URL reference
+    OFBool              referenced;
+
 };
 
 /** global constant describing the byte order on the machine the application
index d0bce8e4711969c554d9ccfad33edb249c5fcfdb..84d9770367bc99b05a20029c9149970b9d02b5f0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2010-2011, OFFIS e.V.
+ *  Copyright (C) 2010-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -33,8 +33,7 @@ class DCMTK_DCMDATA_EXPORT vrscan
 {
 public:
     static int scan(const OFString& vr, const OFString& value);
-private:
-    static char* makeBuffer(const OFString& vr, const OFString& value, size_t& size);
+    static int scan(const OFString& vr, const char* const value, const size_t size);
 };
 
 #endif // VRSCAN_H
index 5c244c154b7ab243214e530983266960f38faf2b..ae328157da5e7d74cc4499f640f8418a79eef60c 100644 (file)
@@ -1,23 +1,21 @@
-i2dbmps.o: i2dbmps.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmdata/libi2d/i2dbmps.h \
- ../include/dcmtk/dcmdata/libi2d/i2dimgs.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+i2d.o: i2d.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmdata/libi2d/i2d.h \
+ ../include/dcmtk/dcmdata/libi2d/i2doutpl.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
- ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \
- ../../oflog/include/dcmtk/oflog/oflog.h \
- ../../oflog/include/dcmtk/oflog/logger.h \
- ../../oflog/include/dcmtk/oflog/config.h \
  ../../oflog/include/dcmtk/oflog/config/defines.h \
  ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
  ../../oflog/include/dcmtk/oflog/loglevel.h \
  ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../oflog/include/dcmtk/oflog/tchar.h \
  ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
@@ -37,42 +35,54 @@ i2dbmps.o: i2dbmps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
- ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
- ../include/dcmtk/dcmdata/libi2d/i2define.h \
- ../include/dcmtk/dcmdata/dcerror.h \
- ../include/dcmtk/dcmdata/libi2d/i2doutpl.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \
- ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dctag.h \
+ ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcdefine.h \
+ ../include/dcmtk/dcmdata/dcobject.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
+ ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
  ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
  ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \
- ../include/dcmtk/dcmdata/dcelem.h
-i2d.o: i2d.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmdata/libi2d/i2d.h \
- ../include/dcmtk/dcmdata/libi2d/i2doutpl.h \
- ../../oflog/include/dcmtk/oflog/oflog.h \
- ../../oflog/include/dcmtk/oflog/logger.h \
- ../../oflog/include/dcmtk/oflog/config.h \
+ ../include/dcmtk/dcmdata/dcelem.h \
+ ../include/dcmtk/dcmdata/libi2d/i2define.h \
+ ../include/dcmtk/dcmdata/libi2d/i2dimgs.h \
+ ../include/dcmtk/dcmdata/dcpixel.h ../include/dcmtk/dcmdata/dcvrpobw.h \
+ ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpxitem.h \
+ ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcfilefo.h \
+ ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcdeftag.h \
+ ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcpixseq.h \
+ ../include/dcmtk/dcmdata/dcpath.h
+i2dbmps.o: i2dbmps.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmdata/libi2d/i2dbmps.h \
+ ../include/dcmtk/dcmdata/libi2d/i2dimgs.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dctypes.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
  ../../oflog/include/dcmtk/oflog/config/defines.h \
  ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
  ../../oflog/include/dcmtk/oflog/loglevel.h \
  ../../ofstd/include/dcmtk/ofstd/ofvector.h \
- ../../ofstd/include/dcmtk/ofstd/oftypes.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../oflog/include/dcmtk/oflog/tstring.h \
- ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../oflog/include/dcmtk/oflog/tchar.h \
  ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
@@ -92,32 +102,26 @@ i2d.o: i2d.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \
- ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcdefine.h \
- ../include/dcmtk/dcmdata/dcobject.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
- ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
+ ../include/dcmtk/dcmdata/libi2d/i2define.h \
+ ../include/dcmtk/dcmdata/dcerror.h \
+ ../include/dcmtk/dcmdata/libi2d/i2doutpl.h \
+ ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \
+ ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dctag.h \
  ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
  ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \
- ../include/dcmtk/dcmdata/dcelem.h \
- ../include/dcmtk/dcmdata/libi2d/i2define.h \
- ../include/dcmtk/dcmdata/libi2d/i2dimgs.h \
- ../include/dcmtk/dcmdata/dcpixel.h ../include/dcmtk/dcmdata/dcvrpobw.h \
- ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpxitem.h \
- ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcfilefo.h \
- ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcdeftag.h \
- ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcpixseq.h \
- ../include/dcmtk/dcmdata/dcpath.h
+ ../include/dcmtk/dcmdata/dcelem.h
 i2djpgs.o: i2djpgs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/libi2d/i2djpgs.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -163,8 +167,10 @@ i2djpgs.o: i2djpgs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/libi2d/i2define.h \
@@ -211,6 +217,7 @@ i2dplnsc.o: i2dplnsc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -220,6 +227,7 @@ i2dplnsc.o: i2dplnsc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \
  ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmdata/dcobject.h \
@@ -268,6 +276,7 @@ i2dplsc.o: i2dplsc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -277,6 +286,7 @@ i2dplsc.o: i2dplsc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \
  ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmdata/dcobject.h \
@@ -325,6 +335,7 @@ i2dplvlp.o: i2dplvlp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -334,6 +345,7 @@ i2dplvlp.o: i2dplvlp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \
  ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmdata/dcobject.h \
index 7965ebcc506101e6d21aef482d695951ced951f5..40b3d468033d9b5f805379ae15c88995bc8616a2 100644 (file)
@@ -1,10 +1,10 @@
 # create library from source files
 
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}")
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
 
 DCMTK_ADD_LIBRARY(dcmdata
   cmdlnarg dcbytstr dcchrstr dccodec dcdatset dcdatutl dcddirif dcdicdir dcdicent
-  dcdict dcdictbi dcdirrec dcelem dcerror dcfilefo dcfilter dchashdi dcistrma
+  dcdict dcdictbi dcdirrec dcelem dcencdoc dcerror dcfilefo dcfilter dchashdi dcistrma
   dcistrmb dcistrmf dcistrmz dcitem dcjson dclist dcmatch dcmetinf dcobject dcostrma
   dcostrmb dcostrmf dcostrmz dcpath dcpcache dcpixel dcpixseq dcpxitem dcrleccd
   dcrlecce dcrlecp dcrledrg dcrleerg dcrlerp dcsequen dcspchrs dcstack dcswap dctag
@@ -17,35 +17,35 @@ DCMTK_TARGET_LINK_MODULES(dcmdata ofstd oflog)
 DCMTK_TARGET_LINK_LIBRARIES(dcmdata ${ZLIB_LIBS})
 
 # Various dictionary-related commands
-SET(DICOMDIC   "${dcmdata_SOURCE_DIR}/data/dicom.dic")
-SET(PRIVATEDIC "${dcmdata_SOURCE_DIR}/data/private.dic")
-SET(DICTIONARIES "${DICOMDIC}" "${PRIVATEDIC}")
+set(DICOMDIC   "${dcmdata_SOURCE_DIR}/data/dicom.dic")
+set(PRIVATEDIC "${dcmdata_SOURCE_DIR}/data/private.dic")
+set(DICTIONARIES "${DICOMDIC}" "${PRIVATEDIC}")
 
-IF(BUILD_APPS)
+if(BUILD_APPS)
   # don't use DCMTK_ADD_EXECUTABLE() since we don't want to install the files
-  ADD_EXECUTABLE(mkdictbi EXCLUDE_FROM_ALL mkdictbi dctagkey dcdicent dcdict dcvr dchashdi cmdlnarg dctypes)
-  ADD_EXECUTABLE(mkdeftag EXCLUDE_FROM_ALL mkdeftag dctagkey dcdicent dcdict dcvr dchashdi cmdlnarg dctypes)
+  add_executable(mkdictbi EXCLUDE_FROM_ALL mkdictbi dctagkey dcdicent dcdict dcvr dchashdi cmdlnarg dctypes)
+  add_executable(mkdeftag EXCLUDE_FROM_ALL mkdeftag dctagkey dcdicent dcdict dcvr dchashdi cmdlnarg dctypes)
   # workaround for Visual Studio to disable dll storage specifiers when linking directly into the executable.
   # this is needed since the built-in dictionary code is created by the tools below and thus those tools
   # statically link the few required dcmdata source files instead of linking to dcmdata as a whole.
-  SET_TARGET_PROPERTIES(mkdictbi mkdeftag PROPERTIES COMPILE_DEFINITIONS "DCMDATA_BUILD_DICTIONARY")
-ENDIF(BUILD_APPS)
+  set_target_properties(mkdictbi mkdeftag PROPERTIES COMPILE_DEFINITIONS "DCMDATA_BUILD_DICTIONARY")
+endif()
 DCMTK_TARGET_LINK_MODULES(mkdictbi ofstd oflog)
 DCMTK_TARGET_LINK_MODULES(mkdeftag ofstd oflog)
 
-ADD_CUSTOM_TARGET(updatedeftag
+add_custom_target(updatedeftag
         COMMAND mkdeftag -o "${dcmdata_SOURCE_DIR}/include/dcmtk/dcmdata/dcdeftag.h" ${DICTIONARIES}
         DEPENDS mkdeftag
         WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
         COMMENT "Generate a new include file of defined tags")
 
-ADD_CUSTOM_TARGET(updatebuiltindict
+add_custom_target(updatebuiltindict
         COMMAND mkdictbi -o dcdictbi.cc ${DICTIONARIES}
         DEPENDS mkdictbi
         WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
         COMMENT "Generate a builtin data dictionary")
 
-ADD_CUSTOM_TARGET(mkvrscan
+add_custom_target(mkvrscan
         COMMAND flex -8 --header-file=vrscanl.h --outfile=vrscanl.c vrscanl.l
         WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
         COMMENT "Generate vrscanl.c and vrscanl.h")
index 91da08163355623215a3fd6454e94d2050c7633d..d6a930437406756705dbf38e9c5d6ae416afbc2f 100644 (file)
@@ -35,6 +35,7 @@ cmdlnarg.o: cmdlnarg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -43,7 +44,8 @@ cmdlnarg.o: cmdlnarg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h
 dcbytstr.o: dcbytstr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
@@ -88,9 +90,11 @@ dcbytstr.o: dcbytstr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -143,8 +147,10 @@ dcchrstr.o: dcchrstr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -192,6 +198,7 @@ dccodec.o: dccodec.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -200,6 +207,7 @@ dccodec.o: dccodec.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -260,8 +268,10 @@ dcdatset.o: dcdatset.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -312,6 +322,7 @@ dcdatutl.o: dcdatutl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -321,7 +332,7 @@ dcdatutl.o: dcdatutl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \
  ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcerror.h \
@@ -376,8 +387,10 @@ dcddirif.o: dcddirif.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -444,8 +457,10 @@ dcdicdir.o: dcdicdir.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -473,20 +488,14 @@ dcdicent.o: dcdicent.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
- ../../ofstd/include/dcmtk/ofstd/ofthread.h
-dcdictbi.o: dcdictbi.cc ../include/dcmtk/dcmdata/dcdict.h \
- ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
- ../../ofstd/include/dcmtk/ofstd/oftypes.h \
- ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
- ../../ofstd/include/dcmtk/ofstd/ofcast.h \
- ../../ofstd/include/dcmtk/ofstd/ofexport.h \
- ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
- ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmdata/dchashdi.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
- ../include/dcmtk/dcmdata/dcdefine.h
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h
 dcdict.o: dcdict.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
@@ -535,25 +544,40 @@ dcdict.o: dcdict.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h
+dcdictbi.o: dcdictbi.cc ../include/dcmtk/dcmdata/dcdict.h \
+ ../../config/include/dcmtk/config/osconfig.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../include/dcmtk/dcmdata/dchashdi.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/dcmdata/dcdefine.h
 dcdirrec.o: dcdirrec.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
- ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcitem.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcitem.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -581,8 +605,10 @@ dcdirrec.o: dcdirrec.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -670,8 +696,10 @@ dcelem.o: dcelem.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
  ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcstack.h \
  ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcistrma.h \
  ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcfcache.h \
@@ -679,6 +707,94 @@ dcelem.o: dcelem.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \
  ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/vrscan.h \
  ../include/dcmtk/dcmdata/dcpath.h ../include/dcmtk/dcmdata/dcdatset.h
+dcencdoc.o: dcencdoc.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmdata/cmdlnarg.h ../include/dcmtk/dcmdata/dcdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../include/dcmtk/dcmdata/dccodec.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../include/dcmtk/dcmdata/dctypes.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcencdoc.h ../include/dcmtk/dcmdata/dcpath.h \
+ ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \
+ ../include/dcmtk/dcmdata/dcobject.h ../include/dcmtk/dcmdata/dcerror.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcstack.h \
+ ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcpcache.h \
+ ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dcswap.h \
+ ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \
+ ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdicent.h \
+ ../include/dcmtk/dcmdata/dchashdi.h ../include/dcmtk/dcmdata/dcdict.h \
+ ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcmetinf.h \
+ ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dcfilefo.h \
+ ../include/dcmtk/dcmdata/dcdicdir.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmap.h \
+ ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcvrulup.h \
+ ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcpixseq.h \
+ ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcbytstr.h \
+ ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvras.h \
+ ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcvrda.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdate.h \
+ ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvrdt.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
+ ../../ofstd/include/dcmtk/ofstd/oftime.h \
+ ../include/dcmtk/dcmdata/dcvris.h ../include/dcmtk/dcmdata/dcvrtm.h \
+ ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcvrur.h \
+ ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcvrlo.h \
+ ../include/dcmtk/dcmdata/dcvrlt.h ../include/dcmtk/dcmdata/dcvrpn.h \
+ ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcvrst.h \
+ ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrut.h \
+ ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcpixel.h \
+ ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcovlay.h \
+ ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrss.h \
+ ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrsl.h \
+ ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrfd.h \
+ ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrod.h \
+ ../include/dcmtk/dcmdata/dcvrol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofxml.h
 dcerror.o: dcerror.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcerror.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
@@ -738,20 +854,22 @@ dcfilefo.o: dcfilefo.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
- ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcdatset.h \
- ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h \
- ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcvrui.h \
- ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dcvrul.h \
- ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcvrae.h \
- ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcchrstr.h \
- ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdeftag.h \
- ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcostrma.h \
- ../include/dcmtk/dcmdata/dcostrmf.h ../include/dcmtk/dcmdata/dcistrma.h \
- ../include/dcmtk/dcmdata/dcistrmf.h ../include/dcmtk/dcmdata/dcwcache.h \
- ../include/dcmtk/dcmdata/dcfcache.h ../include/dcmtk/dcmdata/dcjson.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dclist.h \
+ ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \
+ ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcvrobow.h \
+ ../include/dcmtk/dcmdata/dcvrui.h ../include/dcmtk/dcmdata/dcbytstr.h \
+ ../include/dcmtk/dcmdata/dcvrul.h ../include/dcmtk/dcmdata/dcvrus.h \
+ ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcvrsh.h \
+ ../include/dcmtk/dcmdata/dcchrstr.h ../include/dcmtk/dcmdata/dcmetinf.h \
+ ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcuid.h \
+ ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcostrmf.h \
+ ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcistrmf.h \
+ ../include/dcmtk/dcmdata/dcwcache.h ../include/dcmtk/dcmdata/dcfcache.h \
+ ../include/dcmtk/dcmdata/dcjson.h
 dcfilter.o: dcfilter.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcfilter.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
@@ -802,11 +920,13 @@ dcfilter.o: dcfilter.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
- ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcdatset.h \
- ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dclist.h \
+ ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcitem.h \
+ ../include/dcmtk/dcmdata/dcpcache.h
 dchashdi.o: dchashdi.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dchashdi.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
@@ -850,13 +970,15 @@ dchashdi.o: dchashdi.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h
 dcistrma.o: dcistrma.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcistrma.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
@@ -901,8 +1023,10 @@ dcistrma.o: dcistrma.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcistrmz.h ../include/dcmtk/dcmdata/dcerror.h
@@ -950,8 +1074,10 @@ dcistrmb.o: dcistrmb.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h
@@ -999,8 +1125,10 @@ dcistrmf.o: dcistrmf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h
@@ -1048,8 +1176,10 @@ dcistrmz.o: dcistrmz.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h
@@ -1097,8 +1227,10 @@ dcitem.o: dcitem.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -1185,6 +1317,7 @@ dclist.o: dclist.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1192,8 +1325,9 @@ dclist.o: dclist.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h
 dcmatch.o: dcmatch.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
  ../../ofstd/include/dcmtk/ofstd/ofutil.h \
@@ -1237,6 +1371,7 @@ dcmatch.o: dcmatch.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1244,6 +1379,7 @@ dcmatch.o: dcmatch.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
@@ -1301,8 +1437,10 @@ dcmetinf.o: dcmetinf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -1360,8 +1498,10 @@ dcobject.o: dcobject.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
  ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcstack.h \
  ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h
@@ -1403,6 +1543,7 @@ dcostrma.o: dcostrma.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1411,6 +1552,7 @@ dcostrma.o: dcostrma.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcostrmz.h ../include/dcmtk/dcmdata/dcerror.h
@@ -1452,6 +1594,7 @@ dcostrmb.o: dcostrmb.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1460,6 +1603,7 @@ dcostrmb.o: dcostrmb.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h
@@ -1501,6 +1645,7 @@ dcostrmf.o: dcostrmf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1509,6 +1654,7 @@ dcostrmf.o: dcostrmf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h
@@ -1550,6 +1696,7 @@ dcostrmz.o: dcostrmz.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1558,6 +1705,7 @@ dcostrmz.o: dcostrmz.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h
@@ -1606,8 +1754,10 @@ dcpath.o: dcpath.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -1659,14 +1809,15 @@ dcpcache.o: dcpcache.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dcstack.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcstack.h
 dcpixel.o: dcpixel.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcpixel.h ../include/dcmtk/dcmdata/dcvrpobw.h \
  ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcelem.h \
@@ -1711,6 +1862,7 @@ dcpixel.o: dcpixel.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1718,13 +1870,13 @@ dcpixel.o: dcpixel.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
- ../include/dcmtk/dcmdata/dccodec.h ../include/dcmtk/dcmdata/dcpixseq.h \
- ../include/dcmtk/dcmdata/dcsequen.h ../include/dcmtk/dcmdata/dclist.h \
- ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcdeftag.h \
- ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h \
- ../include/dcmtk/dcmdata/dcpxitem.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dccodec.h \
+ ../include/dcmtk/dcmdata/dcpixseq.h ../include/dcmtk/dcmdata/dcsequen.h \
+ ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcofsetl.h \
+ ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcitem.h \
+ ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcpxitem.h
 dcpixseq.o: dcpixseq.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
@@ -1734,6 +1886,7 @@ dcpixseq.o: dcpixseq.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofrand.h \
  ../include/dcmtk/dcmdata/dcpixseq.h ../include/dcmtk/dcmdata/dcsequen.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
@@ -1774,13 +1927,14 @@ dcpixseq.o: dcpixseq.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
- ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcofsetl.h \
- ../include/dcmtk/dcmdata/dcpxitem.h ../include/dcmtk/dcmdata/dcvrobow.h \
- ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h \
- ../include/dcmtk/dcmdata/dcdeftag.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dclist.h \
+ ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcpxitem.h \
+ ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcitem.h \
+ ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcdeftag.h
 dcpxitem.o: dcpxitem.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
@@ -1824,6 +1978,7 @@ dcpxitem.o: dcpxitem.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1831,11 +1986,12 @@ dcpxitem.o: dcpxitem.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
- ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcswap.h \
- ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \
- ../include/dcmtk/dcmdata/dcwcache.h ../include/dcmtk/dcmdata/dcfcache.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcofsetl.h \
+ ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcistrma.h \
+ ../include/dcmtk/dcmdata/dcostrma.h ../include/dcmtk/dcmdata/dcwcache.h \
+ ../include/dcmtk/dcmdata/dcfcache.h
 dcrleccd.o: dcrleccd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcrleccd.h ../include/dcmtk/dcmdata/dccodec.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
@@ -1874,6 +2030,7 @@ dcrleccd.o: dcrleccd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1882,6 +2039,7 @@ dcrleccd.o: dcrleccd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1934,6 +2092,7 @@ dcrlecce.o: dcrlecce.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1942,6 +2101,7 @@ dcrlecce.o: dcrlecce.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1992,6 +2152,7 @@ dcrlecp.o: dcrlecp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2000,6 +2161,7 @@ dcrlecp.o: dcrlecp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h
@@ -2042,6 +2204,7 @@ dcrledrg.o: dcrledrg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2050,6 +2213,7 @@ dcrledrg.o: dcrledrg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcrleccd.h ../include/dcmtk/dcmdata/dcrlecp.h
@@ -2092,6 +2256,7 @@ dcrleerg.o: dcrleerg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2100,6 +2265,7 @@ dcrleerg.o: dcrleerg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcrlecce.h ../include/dcmtk/dcmdata/dcrlecp.h
@@ -2147,6 +2313,7 @@ dcrlerp.o: dcrlerp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2154,8 +2321,9 @@ dcrlerp.o: dcrlerp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h
 dcsequen.o: dcsequen.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
@@ -2205,16 +2373,17 @@ dcsequen.o: dcsequen.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dclist.h \
- ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dcpcache.h \
- ../include/dcmtk/dcmdata/dcdirrec.h ../include/dcmtk/dcmdata/dcfilefo.h \
- ../include/dcmtk/dcmdata/dcdatset.h ../include/dcmtk/dcmdata/dcpxitem.h \
- ../include/dcmtk/dcmdata/dcvrobow.h ../include/dcmtk/dcmdata/dcofsetl.h \
- ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcmetinf.h \
- ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcistrma.h \
- ../include/dcmtk/dcmdata/dcostrma.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcstack.h \
+ ../include/dcmtk/dcmdata/dclist.h ../include/dcmtk/dcmdata/dcitem.h \
+ ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcdirrec.h \
+ ../include/dcmtk/dcmdata/dcfilefo.h ../include/dcmtk/dcmdata/dcdatset.h \
+ ../include/dcmtk/dcmdata/dcpxitem.h ../include/dcmtk/dcmdata/dcvrobow.h \
+ ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcswap.h \
+ ../include/dcmtk/dcmdata/dcmetinf.h ../include/dcmtk/dcmdata/dcdeftag.h \
+ ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h
 dcspchrs.o: dcspchrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcspchrs.h \
  ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \
@@ -2262,8 +2431,10 @@ dcspchrs.o: dcspchrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -2320,6 +2491,7 @@ dcswap.o: dcswap.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2328,7 +2500,7 @@ dcswap.o: dcswap.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h
 dctag.o: dctag.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dctag.h \
@@ -2347,7 +2519,12 @@ dctag.o: dctag.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcdict.h \
  ../include/dcmtk/dcmdata/dchashdi.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
- ../include/dcmtk/dcmdata/dcdicent.h
+ ../include/dcmtk/dcmdata/dcdicent.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h
 dctagkey.o: dctagkey.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dctagkey.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
@@ -2357,7 +2534,14 @@ dctagkey.o: dctagkey.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
- ../include/dcmtk/dcmdata/dcdefine.h
+ ../include/dcmtk/dcmdata/dcdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h
 dctypes.o: dctypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -2394,6 +2578,7 @@ dctypes.o: dctypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2403,6 +2588,7 @@ dctypes.o: dctypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h
 dcuid.o: dcuid.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
@@ -2441,6 +2627,7 @@ dcuid.o: dcuid.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2450,26 +2637,29 @@ dcuid.o: dcuid.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../ofstd/include/dcmtk/ofstd/ofcrc32.h \
  ../../ofstd/include/dcmtk/ofstd/ofsockad.h
-dcvrae.o: dcvrae.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcbytstr.h \
- ../include/dcmtk/dcmdata/dctypes.h \
- ../../oflog/include/dcmtk/oflog/oflog.h \
- ../../oflog/include/dcmtk/oflog/logger.h \
- ../../oflog/include/dcmtk/oflog/config.h \
+dcvr.o: dcvr.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dctypes.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
  ../../oflog/include/dcmtk/oflog/config/defines.h \
  ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
  ../../oflog/include/dcmtk/oflog/loglevel.h \
  ../../ofstd/include/dcmtk/ofstd/ofvector.h \
- ../../ofstd/include/dcmtk/ofstd/oftypes.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../oflog/include/dcmtk/oflog/tstring.h \
- ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../oflog/include/dcmtk/oflog/tchar.h \
  ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
@@ -2489,24 +2679,18 @@ dcvrae.o: dcvrae.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
- ../include/dcmtk/dcmdata/dcobject.h \
- ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
- ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
- ../include/dcmtk/dcmdata/dcmatch.h
-dcvras.o: dcvras.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmdata/dcvras.h ../include/dcmtk/dcmdata/dcbytstr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h
+dcvrae.o: dcvrae.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmdata/dcvrae.h ../include/dcmtk/dcmdata/dcbytstr.h \
  ../include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -2542,6 +2726,7 @@ dcvras.o: dcvras.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2551,36 +2736,32 @@ dcvras.o: dcvras.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h
-dcvrat.o: dcvrat.cc ../../config/include/dcmtk/config/osconfig.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcelem.h \
- ../include/dcmtk/dcmdata/dcobject.h \
- ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
- ../../ofstd/include/dcmtk/ofstd/ofthread.h \
- ../../ofstd/include/dcmtk/ofstd/oftypes.h \
- ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
- ../../ofstd/include/dcmtk/ofstd/ofcast.h \
- ../../ofstd/include/dcmtk/ofstd/ofexport.h \
- ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
- ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmdata/dcerror.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \
+ ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
+ ../include/dcmtk/dcmdata/dcmatch.h
+dcvras.o: dcvras.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmdata/dcvras.h ../include/dcmtk/dcmdata/dcbytstr.h \
  ../include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../oflog/include/dcmtk/oflog/config/defines.h \
  ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
  ../../oflog/include/dcmtk/oflog/loglevel.h \
  ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../oflog/include/dcmtk/oflog/tchar.h \
  ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
@@ -2600,18 +2781,27 @@ dcvrat.o: dcvrat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
+ ../include/dcmtk/dcmdata/dcobject.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
  ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
- ../include/dcmtk/dcmdata/dcjson.h
-dcvr.o: dcvr.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h
+dcvrat.o: dcvrat.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcelem.h \
+ ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
@@ -2619,9 +2809,11 @@ dcvr.o: dcvr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dctypes.h \
+ ../include/dcmtk/dcmdata/dcerror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcxfer.h \
+ ../include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -2649,14 +2841,17 @@ dcvr.o: dcvr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcjson.h
 dcvrcs.o: dcvrcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../include/dcmtk/dcmdata/dcvrcs.h ../include/dcmtk/dcmdata/dcbytstr.h \
@@ -2694,6 +2889,7 @@ dcvrcs.o: dcvrcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2703,6 +2899,7 @@ dcvrcs.o: dcvrcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2747,6 +2944,7 @@ dcvrda.o: dcvrda.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2756,6 +2954,7 @@ dcvrda.o: dcvrda.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2803,6 +3002,7 @@ dcvrds.o: dcvrds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2812,6 +3012,7 @@ dcvrds.o: dcvrds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2856,6 +3057,7 @@ dcvrdt.o: dcvrdt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2865,6 +3067,7 @@ dcvrdt.o: dcvrdt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2923,8 +3126,10 @@ dcvrfd.o: dcvrfd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
  ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
  ../include/dcmtk/dcmdata/dcstack.h
 dcvrfl.o: dcvrfl.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -2974,8 +3179,10 @@ dcvrfl.o: dcvrfl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
  ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
  ../include/dcmtk/dcmdata/dcstack.h
 dcvris.o: dcvris.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -3015,6 +3222,7 @@ dcvris.o: dcvris.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -3024,6 +3232,7 @@ dcvris.o: dcvris.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -3070,6 +3279,7 @@ dcvrlo.o: dcvrlo.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -3079,6 +3289,7 @@ dcvrlo.o: dcvrlo.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -3121,6 +3332,7 @@ dcvrlt.o: dcvrlt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -3130,6 +3342,7 @@ dcvrlt.o: dcvrlt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -3152,6 +3365,7 @@ dcvrobow.o: dcvrobow.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../../ofstd/include/dcmtk/ofstd/ofuuid.h \
+ ../../ofstd/include/dcmtk/ofstd/ofrand.h \
  ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dctagkey.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvrobow.h \
  ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \
@@ -3185,8 +3399,10 @@ dcvrobow.o: dcvrobow.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
  ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcstack.h \
  ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcswap.h \
  ../include/dcmtk/dcmdata/dcuid.h
@@ -3199,6 +3415,7 @@ dcvrod.o: dcvrod.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofrand.h \
  ../include/dcmtk/dcmdata/dcvrod.h ../include/dcmtk/dcmdata/dcvrfd.h \
  ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -3234,6 +3451,7 @@ dcvrod.o: dcvrod.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3241,9 +3459,10 @@ dcvrod.o: dcvrod.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
- ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcjson.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcswap.h \
+ ../include/dcmtk/dcmdata/dcjson.h
 dcvrof.o: dcvrof.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofuuid.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
@@ -3253,6 +3472,7 @@ dcvrof.o: dcvrof.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofrand.h \
  ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dctagkey.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvrof.h \
  ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcelem.h \
@@ -3289,6 +3509,7 @@ dcvrof.o: dcvrof.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3296,8 +3517,9 @@ dcvrof.o: dcvrof.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcswap.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dcstack.h \
+ ../include/dcmtk/dcmdata/dcswap.h
 dcvrol.o: dcvrol.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofuuid.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
@@ -3307,6 +3529,7 @@ dcvrol.o: dcvrol.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofrand.h \
  ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrul.h \
  ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -3342,6 +3565,7 @@ dcvrol.o: dcvrol.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3349,9 +3573,10 @@ dcvrol.o: dcvrol.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h \
- ../include/dcmtk/dcmdata/dcjson.h ../include/dcmtk/dcmdata/dcswap.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h ../include/dcmtk/dcmdata/dcjson.h \
+ ../include/dcmtk/dcmdata/dcswap.h
 dcvrpn.o: dcvrpn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcjson.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -3391,6 +3616,7 @@ dcvrpn.o: dcvrpn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -3400,6 +3626,7 @@ dcvrpn.o: dcvrpn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
@@ -3448,6 +3675,7 @@ dcvrpobw.o: dcvrpobw.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3455,8 +3683,9 @@ dcvrpobw.o: dcvrpobw.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h
 dcvrsh.o: dcvrsh.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcvrsh.h ../include/dcmtk/dcmdata/dcchrstr.h \
  ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dctypes.h \
@@ -3494,6 +3723,7 @@ dcvrsh.o: dcvrsh.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -3503,6 +3733,7 @@ dcvrsh.o: dcvrsh.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -3553,6 +3784,7 @@ dcvrsl.o: dcvrsl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3560,8 +3792,9 @@ dcvrsl.o: dcvrsl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h
 dcvrss.o: dcvrss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../include/dcmtk/dcmdata/dcvrss.h ../include/dcmtk/dcmdata/dcelem.h \
@@ -3605,6 +3838,7 @@ dcvrss.o: dcvrss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3612,8 +3846,9 @@ dcvrss.o: dcvrss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h
 dcvrst.o: dcvrst.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcvrst.h ../include/dcmtk/dcmdata/dcchrstr.h \
  ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dctypes.h \
@@ -3651,6 +3886,7 @@ dcvrst.o: dcvrst.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -3660,6 +3896,7 @@ dcvrst.o: dcvrst.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -3702,6 +3939,7 @@ dcvrtm.o: dcvrtm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -3711,6 +3949,7 @@ dcvrtm.o: dcvrtm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcbytstr.h \
  ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -3755,6 +3994,7 @@ dcvruc.o: dcvruc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -3764,6 +4004,7 @@ dcvruc.o: dcvruc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcchrstr.h \
  ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
@@ -3814,9 +4055,11 @@ dcvrui.o: dcvrui.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -3867,6 +4110,7 @@ dcvrul.o: dcvrul.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3874,8 +4118,9 @@ dcvrul.o: dcvrul.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h
 dcvrulup.o: dcvrulup.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcvrulup.h ../include/dcmtk/dcmdata/dcvrul.h \
  ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \
@@ -3919,6 +4164,7 @@ dcvrulup.o: dcvrulup.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3926,8 +4172,9 @@ dcvrulup.o: dcvrulup.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h
 dcvrur.o: dcvrur.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcvrur.h ../include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -3964,6 +4211,7 @@ dcvrur.o: dcvrur.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -3973,6 +4221,7 @@ dcvrur.o: dcvrur.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcbytstr.h \
  ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -4023,6 +4272,7 @@ dcvrus.o: dcvrus.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4030,8 +4280,9 @@ dcvrus.o: dcvrus.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmdata/dcvr.h ../include/dcmtk/dcmdata/dctag.h \
- ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dcstack.h
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../include/dcmtk/dcmdata/dctag.h ../include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmdata/dcstack.h
 dcvrut.o: dcvrut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmdata/dcvrut.h ../include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -4068,6 +4319,7 @@ dcvrut.o: dcvrut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -4077,6 +4329,7 @@ dcvrut.o: dcvrut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcchrstr.h \
  ../include/dcmtk/dcmdata/dcbytstr.h ../include/dcmtk/dcmdata/dcelem.h \
  ../include/dcmtk/dcmdata/dcobject.h \
@@ -4130,8 +4383,10 @@ dcwcache.o: dcwcache.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcelem.h ../include/dcmtk/dcmdata/dcobject.h \
@@ -4174,6 +4429,7 @@ dcxfer.o: dcxfer.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -4183,6 +4439,7 @@ dcxfer.o: dcxfer.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcdefine.h ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcuid.h
@@ -4281,6 +4538,8 @@ vrscan.o: vrscan.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h vrscani.h vrscanl.h
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h vrscani.h vrscanl.h
index 04b14f2ce685c3b0b1b89c69d4b87a21517aa0e3..d1964dbd006c0adc966720528d79348e2069c6be 100644 (file)
@@ -35,7 +35,7 @@ privatedic = $(top_srcdir)/data/private.dic
 # Dictionary objects for building the helper tools mkdeftag and mkdictbi
 dict_tools_objs = dctagkey.o dcdicent.o dcdict.o dcvr.o dchashdi.o
 
-objs = dcpixseq.o dcpxitem.o dcuid.o dcerror.o \
+objs = dcpixseq.o dcpxitem.o dcuid.o dcerror.o dcencdoc.o\
        dcstack.o dclist.o dcswap.o dctag.o dcxfer.o \
        dcobject.o dcelem.o dcitem.o dcmetinf.o dcdatset.o dcdatutl.o dcspchrs.o \
        dcsequen.o dcfilefo.o dcbytstr.o dcpixel.o dcvrae.o dcvras.o dcvrcs.o \
index 6673a16caa7ebaf2947e6905ffb54933dd656cd0..ad5afe1b64f40d20c0aea8b5b9b2c6433debe5fc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2017, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -41,6 +41,7 @@
 #include "dcmtk/ofstd/ofstdinc.h"
 
 #include "dcmtk/ofstd/ofstream.h"
+#include "dcmtk/ofstd/ofstd.h"
 
 void prepareCmdLineArgs(int& argc, char* argv[],
                         const char* progname)
@@ -49,8 +50,9 @@ void prepareCmdLineArgs(int& argc, char* argv[],
     char buf[bufsize];
     char arg[1024];
 
-    argv[0] = new char[strlen(progname)+1];
-    strcpy(argv[0], progname);
+    size_t len = strlen(progname)+1;
+    argv[0] = new char[len];
+    OFStandard::strlcpy(argv[0], progname, len);
     argc = 1;
 
     ofConsole.lockCout() << "CmdLineArgs-> ";
@@ -63,8 +65,9 @@ void prepareCmdLineArgs(int& argc, char* argv[],
     while (is.good()) {
         is >> arg;
         if (strlen(arg) > 0) {
-            argv[argc] = new char[strlen(arg)+1];
-            strcpy(argv[argc], arg);
+            size_t len = strlen(arg)+1;
+            argv[argc] = new char[len];
+            OFStandard::strlcpy(argv[argc], arg, len);
             argc++;
         }
         arg[0] = '\0';
index 4d58c9a8937c6a8ed8463389cdf1a46fd542d60a..db0cab013e3244e5353f233a5e7bfa155efe8bcc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -153,20 +153,20 @@ int DcmByteString::compare(const DcmElement& rhs) const
     myThis = OFconst_cast(DcmByteString*, this);
     myRhs = OFstatic_cast(DcmByteString*, OFconst_cast(DcmElement*, &rhs));
 
-    /* check number of components. */
-    unsigned long rhsVM = myRhs->getVM();
-    unsigned long thisVM = myThis->getVM();
-    if (thisVM < rhsVM)
+    /* compare number of values */
+    unsigned long rhsNumValues = myRhs->getNumberOfValues();
+    unsigned long thisNumValues = myThis->getNumberOfValues();
+    if (thisNumValues < rhsNumValues)
     {
         return -1;
     }
-    else if (thisVM > rhsVM)
+    else if (thisNumValues > rhsNumValues)
     {
         return 1;
     }
 
     /* iterate over all components and test equality */
-    for (unsigned long count = 0; count < thisVM; count++)
+    for (unsigned long count = 0; count < thisNumValues; count++)
     {
         OFString val;
         if (myThis->getOFString(val, count).good())
@@ -221,6 +221,13 @@ unsigned long DcmByteString::getVM()
 }
 
 
+unsigned long DcmByteString::getNumberOfValues()
+{
+    /* same as value multiplicity unless overwritten in a derived class */
+    return getVM();
+}
+
+
 OFCondition DcmByteString::clear()
 {
     /* call inherited method */
index e5bb8ac0280542b865c60b35b754a473640d3c26..77c896281b123d228785a44d439a16856c482129 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -721,14 +721,41 @@ OFCondition DcmDataset::chooseRepresentation(const E_TransferSyntax repType,
                                              const DcmRepresentationParameter *repParam)
 {
     OFCondition l_error = EC_Normal;
+    OFBool pixelDataEncountered = OFFalse;
     OFStack<DcmStack> pixelStack;
+    DcmXfer torep(repType);
+    DcmXfer fromrep(CurrentXfer);
 
     DcmStack resultStack;
     resultStack.push(this);
-    // in a first step, search for all PixelData elements in this dataset
-    while (search(DCM_PixelData, resultStack, ESM_afterStackTop, OFTrue).good() && l_error.good())
+
+    // check if we are attempting to compress but the image contains
+    // floating point or double floating point pixel data, which our codecs don't support.
+    if ((tagExists(DCM_FloatPixelData, OFTrue) || tagExists(DCM_DoubleFloatPixelData, OFTrue)) &&
+         (fromrep.isEncapsulated() || torep.isEncapsulated()))
+    {
+        DCMDATA_ERROR("DcmDataset: Unable to compress/decompress floating point pixel data, cannot change representation");
+        l_error = EC_CannotChangeRepresentation;
+        return l_error;
+    }
+
+    // check if we are attempting to convert a dataset containing
+    // a pixel data URL. In that case we only continue if the target
+    // transfer syntax also uses a pixel data URL.
+    if (tagExists(DCM_PixelDataProviderURL, OFTrue))
     {
+      if (! torep.isReferenced())
+      {
+        DCMDATA_ERROR("DcmDataset: Unable to compress image containing a pixel data provider URL, cannot change representation");
+        l_error = EC_CannotChangeRepresentation;
+        return l_error;
+      }
+    }
 
+    // Now search for all PixelData elements in this dataset
+    while (search(DCM_PixelData, resultStack, ESM_afterStackTop, OFTrue).good() && l_error.good())
+    {
+        pixelDataEncountered = OFTrue;
         if (resultStack.top()->ident() == EVR_PixelData)
         {
             DcmPixelData *pixelData = OFstatic_cast(DcmPixelData *, resultStack.top());
@@ -741,7 +768,21 @@ OFCondition DcmDataset::chooseRepresentation(const E_TransferSyntax repType,
             l_error = EC_CannotChangeRepresentation;
         }
     }
-    // then call the method doing the real work for all these elements
+
+    // If there are no pixel data elements in the dataset, issue a warning
+    if (! pixelDataEncountered)
+    {
+      if (torep.isEncapsulated() && ! fromrep.isEncapsulated())
+      {
+        DCMDATA_WARN("DcmDataset: No pixel data present, nothing to compress");
+      }
+      if (! torep.isEncapsulated() && fromrep.isEncapsulated())
+      {
+        DCMDATA_WARN("DcmDataset: No pixel data present, nothing to decompress");
+      }
+    }
+
+    // then call the method doing the real work for all pixel data elements found
     while (l_error.good() && (pixelStack.size() > 0))
     {
         l_error = OFstatic_cast(DcmPixelData *, pixelStack.top().top())->
@@ -757,7 +798,8 @@ OFCondition DcmDataset::chooseRepresentation(const E_TransferSyntax repType,
 
         pixelStack.pop();
     }
-    // store current transfer syntax (if conversion was successfully)
+
+    // store current transfer syntax (if conversion was successful)
     if (l_error.good())
         CurrentXfer = repType;
     return l_error;
index e25c0e7adc8dce50dc6909a3b8f9c29168332f46..8fd97ecad3e9523d553cc5002e772663f5046324 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2002-2017, OFFIS e.V.
+ *  Copyright (C) 2002-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -731,7 +731,8 @@ static E_DirRecType sopClassToRecordType(const OFString &sopClass)
     else if (compare(sopClass, UID_MRSpectroscopyStorage))
         result = ERT_Spectroscopy;
     else if (compare(sopClass, UID_EncapsulatedPDFStorage) ||
-             compare(sopClass, UID_EncapsulatedCDAStorage))
+             compare(sopClass, UID_EncapsulatedCDAStorage) ||
+             compare(sopClass, UID_EncapsulatedSTLStorage))
     {
         result = ERT_EncapDoc;
     }
@@ -1610,7 +1611,8 @@ OFCondition DicomDirInterface::checkSOPClassAndXfer(DcmMetaInfo *metainfo,
                     if (!found)
                     {
                         found = compare(mediaSOPClassUID, UID_EncapsulatedPDFStorage) ||
-                                compare(mediaSOPClassUID, UID_EncapsulatedCDAStorage);
+                                compare(mediaSOPClassUID, UID_EncapsulatedCDAStorage) ||
+                                compare(mediaSOPClassUID, UID_EncapsulatedSTLStorage);
                     }
                     /* is it one of the spatial registration SOP Classes? */
                     if (!found)
index bff230de6be746f19d9bf3ce07de5367af14bd13..3584f7613198365fe586e80fb39ac83c302bb9e4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2010, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -26,6 +26,7 @@
 #include "dcmtk/ofstd/ofstdinc.h"
 
 #include "dcmtk/dcmdata/dcdicent.h"
+#include "dcmtk/ofstd/ofstd.h"
 
 /*
 ** DcmDictEntry member functions
@@ -36,8 +37,9 @@ char* strdup_new(const char* str)
 {
     char* s = NULL;
     if (str != NULL) {
-        s = new char[strlen(str)+1];
-        strcpy(s, str);
+        size_t len = strlen(str)+1;
+        s = new char[len];
+        OFStandard::strlcpy(s, str, len);
     }
     return s;
 }
index d9d278886ec2722ae1593718b01040ce8f9c7b72..2c7793fcd7f2eefb5c1f45ffde0dbdd237bb5168 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -27,6 +27,7 @@
 #include "dcmtk/ofstd/ofdefine.h"
 #include "dcmtk/dcmdata/dcdicent.h"
 #include "dcmtk/dcmdata/dctypes.h"
+#include "dcmtk/ofstd/ofstd.h"
 
 #define INCLUDE_CSTDLIB
 #define INCLUDE_CSTDIO
@@ -114,6 +115,15 @@ DcmDataDictionary::DcmDataDictionary(OFBool loadBuiltin, OFBool loadExternal)
     skeletonCount(0),
     dictionaryLoaded(OFFalse)
 {
+    /* Make sure any DCMDICTPATH dictionary is loaded even if loading
+     * of external (default) dictionary is not enabled.
+     */
+    if (!loadExternal)
+    {
+        const char* env = getenv(DCM_DICT_ENVIRONMENT_VARIABLE);
+        if ((env != NULL) && (strlen(env) != 0))
+            loadExternal = OFTrue;
+    }
     reloadDictionaries(loadBuiltin, loadExternal);
 }
 
@@ -360,8 +370,9 @@ parseWholeTagField(char* s, DcmTagKey& key,
     if (pi > 0)
     {
       // copy private creator name
-      privCreator = new char[strlen(pc) + 1]; // deleted by caller
-      if (privCreator) strcpy(privCreator,pc);
+      size_t buflen = strlen(pc) + 1;
+      privCreator = new char[buflen]; // deleted by caller
+      if (privCreator) OFStandard::strlcpy(privCreator, pc, buflen);
     }
 
     key.set(OFstatic_cast(unsigned short, gl), OFstatic_cast(unsigned short, el));
@@ -820,7 +831,7 @@ void GlobalDcmDataDictionary::createDataDict()
   if (!dataDict)
     dataDict = new DcmDataDictionary(OFTrue /*loadBuiltin*/, loadExternal);
 #ifdef WITH_THREADS
-  dataDictLock.unlock();
+  dataDictLock.wrunlock();
 #endif
 }
 
@@ -833,7 +844,7 @@ const DcmDataDictionary& GlobalDcmDataDictionary::rdlock()
   {
     /* dataDictLock must not be locked during createDataDict() */
 #ifdef WITH_THREADS
-    dataDictLock.unlock();
+    dataDictLock.rdunlock();
 #endif
     createDataDict();
 #ifdef WITH_THREADS
@@ -852,7 +863,7 @@ DcmDataDictionary& GlobalDcmDataDictionary::wrlock()
   {
     /* dataDictLock must not be locked during createDataDict() */
 #ifdef WITH_THREADS
-    dataDictLock.unlock();
+    dataDictLock.wrunlock();
 #endif
     createDataDict();
 #ifdef WITH_THREADS
@@ -862,22 +873,29 @@ DcmDataDictionary& GlobalDcmDataDictionary::wrlock()
   return *dataDict;
 }
 
-void GlobalDcmDataDictionary::unlock()
+void GlobalDcmDataDictionary::rdunlock()
+{
+#ifdef WITH_THREADS
+  dataDictLock.rdunlock();
+#endif
+}
+
+void GlobalDcmDataDictionary::wrunlock()
 {
 #ifdef WITH_THREADS
-  dataDictLock.unlock();
+  dataDictLock.wrunlock();
 #endif
 }
 
 OFBool GlobalDcmDataDictionary::isDictionaryLoaded()
 {
   OFBool result = rdlock().isDictionaryLoaded();
-  unlock();
+  rdunlock();
   return result;
 }
 
 void GlobalDcmDataDictionary::clear()
 {
   wrlock().clear();
-  unlock();
+  wrunlock();
 }
index c04703454257147bcf586f647399255066b1aa9f..06eec3c9eb4b305aed85ce65c17d27a62b891abf 100644 (file)
@@ -4,7 +4,7 @@
 **
 **   User: joergr
 **   Host: thinkpad
-**   Date: 2017-12-07 15:02:17
+**   Date: 2018-11-15 17:07:40
 **   Prog: /home/joergr/Source/dcmtk-full/public/dcmdata/libsrc/mkdictbi
 **
 **   From: ../data/dicom.dic
@@ -824,6 +824,10 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_LO, "InstitutionalDepartmentName", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x0008, 0x1041, 0x0008, 0x1041,
+      EVR_SQ, "InstitutionalDepartmentTypeCodeSequence", 1, 1, "DICOM/CP_1809",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x0008, 0x1048, 0x0008, 0x1048,
       EVR_PN, "PhysiciansOfRecord", 1, -1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
@@ -928,6 +932,10 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_UI, "ReferencedSOPInstanceUID", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x0008, 0x1156, 0x0008, 0x1156,
+      EVR_SQ, "DefinitionSourceSequence", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x0008, 0x115a, 0x0008, 0x115a,
       EVR_UI, "SOPClassesSupported", 1, -1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
@@ -6108,6 +6116,150 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_SQ, "CTAdditionalXRaySourceSequence", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x0018, 0x9361, 0x0018, 0x9361,
+      EVR_CS, "MultienergyCTAcquisition", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9362, 0x0018, 0x9362,
+      EVR_SQ, "MultienergyCTAcquisitionSequence", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9363, 0x0018, 0x9363,
+      EVR_SQ, "MultienergyCTProcessingSequence", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9364, 0x0018, 0x9364,
+      EVR_SQ, "MultienergyCTCharacteristicsSequence", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9365, 0x0018, 0x9365,
+      EVR_SQ, "MultienergyCTXRaySourceSequence", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9366, 0x0018, 0x9366,
+      EVR_US, "XRaySourceIndex", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9367, 0x0018, 0x9367,
+      EVR_UC, "XRaySourceID", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9368, 0x0018, 0x9368,
+      EVR_CS, "MultienergySourceTechnique", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9369, 0x0018, 0x9369,
+      EVR_DT, "SourceStartDateTime", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x936a, 0x0018, 0x936a,
+      EVR_DT, "SourceEndDateTime", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x936b, 0x0018, 0x936b,
+      EVR_US, "SwitchingPhaseNumber", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x936c, 0x0018, 0x936c,
+      EVR_DS, "SwitchingPhaseNominalDuration", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x936d, 0x0018, 0x936d,
+      EVR_DS, "SwitchingPhaseTransitionDuration", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x936e, 0x0018, 0x936e,
+      EVR_DS, "EffectiveBinEnergy", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x936f, 0x0018, 0x936f,
+      EVR_SQ, "MultienergyCTXRayDetectorSequence", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9370, 0x0018, 0x9370,
+      EVR_US, "XRayDetectorIndex", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9371, 0x0018, 0x9371,
+      EVR_UC, "XRayDetectorID", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9372, 0x0018, 0x9372,
+      EVR_CS, "MultienergyDetectorType", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9373, 0x0018, 0x9373,
+      EVR_ST, "XRayDetectorLabel", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9374, 0x0018, 0x9374,
+      EVR_DS, "NominalMaxEnergy", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9375, 0x0018, 0x9375,
+      EVR_DS, "NominalMinEnergy", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9376, 0x0018, 0x9376,
+      EVR_US, "ReferencedXRayDetectorIndex", 1, -1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9377, 0x0018, 0x9377,
+      EVR_US, "ReferencedXRaySourceIndex", 1, -1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9378, 0x0018, 0x9378,
+      EVR_US, "ReferencedPathIndex", 1, -1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9379, 0x0018, 0x9379,
+      EVR_SQ, "MultienergyCTPathSequence", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x937a, 0x0018, 0x937a,
+      EVR_US, "MultienergyCTPathIndex", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x937b, 0x0018, 0x937b,
+      EVR_UT, "MultienergyAcquisitionDescription", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x937c, 0x0018, 0x937c,
+      EVR_FD, "MonoenergeticEnergyEquivalent", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x937d, 0x0018, 0x937d,
+      EVR_SQ, "MaterialCodeSequence", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x937e, 0x0018, 0x937e,
+      EVR_CS, "DecompositionMethod", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x937f, 0x0018, 0x937f,
+      EVR_UT, "DecompositionDescription", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9380, 0x0018, 0x9380,
+      EVR_SQ, "DecompositionAlgorithmIdentificationSequence", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9381, 0x0018, 0x9381,
+      EVR_SQ, "DecompositionMaterialSequence", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9382, 0x0018, 0x9382,
+      EVR_SQ, "MaterialAttenuationSequence", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9383, 0x0018, 0x9383,
+      EVR_DS, "PhotonEnergy", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0018, 0x9384, 0x0018, 0x9384,
+      EVR_DS, "XRayMassAttenuationCoefficient", 1, 1, "DICOM/Supplement_188",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x0018, 0x9401, 0x0018, 0x9401,
       EVR_SQ, "ProjectionPixelCalibrationSequence", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
@@ -13108,6 +13260,10 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_SQ, "SourceOfOphthalmicAxialLengthCodeSequence", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x0022, 0x1036, 0x0022, 0x1036,
+      EVR_SQ, "SourceOfCornealSizeDataCodeSequence", 1, 1, "DICOM/CP_1803",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x0022, 0x1037, 0x0022, 0x1037,
       EVR_FL, "TargetRefraction", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
@@ -18206,6 +18362,10 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_LO, "RETIRED_SlideIdentifier", 1, 1, "DICOM/retired",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x0040, 0x0710, 0x0040, 0x0710,
+      EVR_SQ, "WholeSlideMicroscopyImageFrameTypeSequence", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x0040, 0x071a, 0x0040, 0x071a,
       EVR_SQ, "ImageCenterPointCoordinatesSequence", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
@@ -18391,7 +18551,11 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
   , { 0x0040, 0x4007, 0x0040, 0x4007,
-      EVR_SQ, "PerformedProcessingApplicationsCodeSequence", 1, 1, "DICOM",
+      EVR_SQ, "RETIRED_PerformedProcessingApplicationsCodeSequence", 1, 1, "DICOM/retired",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0040, 0x4008, 0x0040, 0x4008,
+      EVR_DT, "ScheduledProcedureStepExpirationDateTime", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
   , { 0x0040, 0x4009, 0x0040, 0x4009,
@@ -20100,6 +20264,10 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_FD, "CornealSize", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x0046, 0x0047, 0x0046, 0x0047,
+      EVR_SQ, "CornealSizeSequence", 1, 1, "DICOM/CP_1803",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x0046, 0x0050, 0x0046, 0x0050,
       EVR_SQ, "AutorefractionRightEyeSequence", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
@@ -20690,6 +20858,14 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_CS, "PixelOriginInterpretation", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x0048, 0x0302, 0x0048, 0x0302,
+      EVR_UL, "NumberOfOpticalPaths", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0048, 0x0303, 0x0048, 0x0303,
+      EVR_UL, "TotalPixelMatrixFocalPlanes", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x0050, 0x0004, 0x0050, 0x0004,
       EVR_CS, "CalibrationImage", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
@@ -21294,6 +21470,10 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_SQ, "UsedSegmentsSequence", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x0062, 0x0013, 0x0062, 0x0013,
+      EVR_CS, "SegmentsOverlap", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x0062, 0x0020, 0x0062, 0x0020,
       EVR_UT, "TrackingID", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
@@ -21882,6 +22062,18 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_FD, "ThreeDPlaneNormal", 3, 3, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x0068, 0x7001, 0x0068, 0x7001,
+      EVR_CS, "ModelModification", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0068, 0x7002, 0x0068, 0x7002,
+      EVR_CS, "ModelMirroring", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
+  , { 0x0068, 0x7003, 0x0068, 0x7003,
+      EVR_SQ, "ModelUsageCodeSequence", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x0070, 0x0001, 0x0070, 0x0001,
       EVR_SQ, "GraphicAnnotationSequence", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
@@ -22282,6 +22474,10 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_UI, "FiducialUID", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x0070, 0x031b, 0x0070, 0x031b,
+      EVR_UI, "ReferencedFiducialUID", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x0070, 0x031c, 0x0070, 0x031c,
       EVR_SQ, "FiducialSetSequence", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
@@ -23607,11 +23803,11 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
   , { 0x0080, 0x0010, 0x0080, 0x0010,
-      EVR_OF, "UValueData", 1, -1, "DICOM",
+      EVR_OF, "UValueData", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
   , { 0x0080, 0x0011, 0x0080, 0x0011,
-      EVR_OF, "VValueData", 1, -1, "DICOM",
+      EVR_OF, "VValueData", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
   , { 0x0080, 0x0012, 0x0080, 0x0012,
@@ -23952,6 +24148,10 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_CS, "ReasonForTheAttributeModification", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x0400, 0x0600, 0x0400, 0x0600,
+      EVR_CS, "InstanceOriginStatus", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
 #ifdef ENABLE_PRIVATE_TAGS
   , { 0x0601, 0x0000, 0x0601, 0x0000,
       EVR_SH, "ImplementationVersion", 1, 1, "PrivateTag",
@@ -25300,6 +25500,10 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_CS, "ROIGenerationAlgorithm", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x3006, 0x0037, 0x3006, 0x0037,
+      EVR_SQ, "ROIDerivationAlgorithmIdentificationSequence", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x3006, 0x0038, 0x3006, 0x0038,
       EVR_LO, "ROIGenerationDescription", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
@@ -26084,6 +26288,10 @@ static const DBI_SimpleEntry simpleBuiltinDict[] = {
       EVR_CS, "DepthValueAveragingFlag", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
       NULL }
+  , { 0x300a, 0x0094, 0x300a, 0x0094,
+      EVR_DS, "BeamDosePointSourceToExternalContourDistance", 1, 1, "DICOM",
+      DcmDictRange_Unspecified, DcmDictRange_Unspecified,
+      NULL }
   , { 0x300a, 0x00a0, 0x300a, 0x00a0,
       EVR_IS, "NumberOfBrachyApplicationSetups", 1, 1, "DICOM",
       DcmDictRange_Unspecified, DcmDictRange_Unspecified,
index bd5a90176de5a1289a29e088686eb3c14b67b776..4588a2b490a0eabb68af16a4a36c4d4cca9536e1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -32,6 +32,7 @@
 
 #include "dcmtk/ofstd/ofstream.h"
 #include "dcmtk/ofstd/ofcast.h"
+#include "dcmtk/ofstd/ofstd.h"
 
 #include "dcmtk/dcmdata/dcdirrec.h"
 #include "dcmtk/dcmdata/dctk.h"
@@ -270,7 +271,8 @@ E_DirRecType DcmDirectoryRecord::recordNameToType(const char *recordTypeName)
 
 
 char *DcmDirectoryRecord::buildFileName(const char *origName,
-                                        char *destName)
+                                        char *destName,
+                                        size_t len) const
 {
     const char *from = origName;
     char *to = destName;
@@ -298,13 +300,14 @@ char *DcmDirectoryRecord::buildFileName(const char *origName,
     {
         fclose(f);
     } else {
-        char* newname = new char[strlen(destName) + 2];
-        strcpy(newname, destName);
-        strcat(newname, ".");
+        size_t buflen = strlen(destName) + 2;
+        char* newname = new char[buflen];
+        OFStandard::strlcpy(newname, destName, buflen);
+        OFStandard::strlcat(newname, ".", buflen);
         if ((f = fopen(newname, "rb")) != NULL)
         {
             fclose(f);
-            strcpy(destName, newname);
+            OFStandard::strlcpy(destName, newname, len);
         } else {
             /* we cannot find the file. let the caller deal with this */
         }
@@ -370,7 +373,7 @@ OFCondition DcmDirectoryRecord::checkHierarchy(const E_DirRecType upperRecord,
             switch (lowerRecord)
             {
                 case ERT_Study:
-                case ERT_HL7StrucDoc:
+                case ERT_HL7StrucDoc:  // retired
                 case ERT_Private:
                     l_error = EC_Normal;
                     break;
@@ -518,7 +521,7 @@ OFCondition DcmDirectoryRecord::checkHierarchy(const E_DirRecType upperRecord,
         case ERT_ValueMap:
         case ERT_HangingProtocol:
         case ERT_Stereometric:
-        case ERT_HL7StrucDoc:
+        case ERT_HL7StrucDoc:  // retired
         case ERT_Palette:
         case ERT_Surface:
         case ERT_Measurement:
@@ -625,8 +628,9 @@ OFCondition DcmDirectoryRecord::setReferencedFileID(const char *referencedFileID
 {
     OFCondition l_error = EC_Normal;
 
-    char* newFname = new char[strlen(referencedFileID) + 1];
-    strcpy(newFname, referencedFileID);
+    size_t bufsize = strlen(referencedFileID) + 1;
+    char* newFname = new char[bufsize];
+    OFStandard::strlcpy(newFname, referencedFileID, bufsize);
     hostToDicomFilename(newFname);
 
     DcmTag refFileTag(DCM_ReferencedFileID);
@@ -908,8 +912,9 @@ OFCondition DcmDirectoryRecord::fillElementsAndReadSOP(const char *referencedFil
         if (sourceFileName.isEmpty())
         {
             /* create a new source filename */
-            char *newname = new char[strlen(referencedFileID) + 2];
-            buildFileName(referencedFileID, newname);
+            size_t bufsize = strlen(referencedFileID) + 2;
+            char *newname = new char[bufsize];
+            buildFileName(referencedFileID, newname, bufsize);
             fileName.set(newname);
             delete[] newname;
         } else {
@@ -1079,8 +1084,9 @@ OFCondition DcmDirectoryRecord::purgeReferencedFile()
         const char *fileName = lookForReferencedFileID();
         if (fileName != NULL)
         {
-            localFileName = new char[strlen(fileName) + 2];
-            buildFileName(fileName, localFileName);
+            size_t buflen = strlen(fileName) + 2;
+            localFileName = new char[buflen];
+            buildFileName(fileName, localFileName, buflen);
             setReferencedFileID(NULL);
         }
 
index b8d1272f3a60886c3aa703d007aaeafc70629189..8c5d59fc325b1b2d04f8fdb518ef60da5b51165c 100644 (file)
@@ -2094,13 +2094,15 @@ int DcmElement::scanValue(const OFString &value,
                           const size_t pos,
                           const size_t num)
 {
-  // Only create a copy of the string if we have to, this could be a lot of data
-  if (pos == 0 && (num == OFString_npos || num >= value.length()))
-      return vrscan::scan(vr, value);
+  return scanValue(vr, value.data() + pos, num != OFString_npos ? num : value.size() - pos);
+}
+
 
-  // construct input string to be scanned
-  OFString realValue(value, pos, num);
-  return vrscan::scan(vr, realValue);
+int DcmElement::scanValue(const OFString& vr,
+                          const char* const value,
+                          const size_t size)
+{
+  return vrscan::scan(vr, value, size);
 }
 
 
diff --git a/dcmdata/libsrc/dcencdoc.cc b/dcmdata/libsrc/dcencdoc.cc
new file mode 100644 (file)
index 0000000..398c263
--- /dev/null
@@ -0,0 +1,1416 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  dcmdata
+ *
+ *  Author:  Pedro Arizpe
+ *
+ *  Purpose: Implementation of Document encapsulation
+ *
+ */
+
+//make sure OS specific configuration is included first
+#include "dcmtk/config/osconfig.h"
+#include "dcmtk/dcmdata/cmdlnarg.h"
+#include "dcmtk/dcmdata/dccodec.h"
+//for tag constants
+#include "dcmtk/dcmdata/dcdeftag.h"
+#include "dcmtk/dcmdata/dcencdoc.h"
+//for dcmtk version name
+#include "dcmtk/dcmdata/dcuid.h"
+#include "dcmtk/dcmiod/modequipment.h"
+#include "dcmtk/ofstd/ofdatime.h"
+#include "dcmtk/ofstd/ofstd.h"
+#include "dcmtk/ofstd/ofstdinc.h"
+
+#define SHORTCOL 3
+#define LONGCOL 21
+
+// exit codes for this command line tool
+// (common codes are defined in "ofexit.h"
+// included from "ofconapp.h")
+
+// general errors
+#define EXITCODE_MEMORY_EXHAUSTED                4
+
+DcmEncapsulatedDocument::DcmEncapsulatedDocument() :
+  opt_patientBirthdate(),
+  opt_patientID(),
+  opt_patientName(),
+  opt_patientSex(),
+
+  opt_conceptCM(),
+  opt_conceptCSD(),
+  opt_conceptCV(),
+
+  opt_documentTitle(),
+  opt_seriesFile(),
+  opt_seriesUID(),
+  opt_studyUID(),
+
+  opt_oenctype(EET_ExplicitLength),
+  opt_writeMode(EWM_fileformat),
+  opt_oglenc(EGL_withoutGL),
+  opt_opadenc(EPD_withoutPadding),
+  opt_oxfer(EXS_LittleEndianExplicit),
+  opt_filepad(0),
+  opt_itempad(0),
+
+  opt_readSeriesInfo(OFFalse),
+  opt_annotation(OFTrue),
+  opt_increment(OFFalse),
+
+  opt_instance(1),
+  opt_overrideKeys(),
+
+  cda_mediaTypes(),
+  hl7_InstanceIdentifier(),
+  opt_override(OFFalse),
+  // Frame of Reference Module (STL)
+  opt_frameOfReferenceUID(),
+  opt_positionReferenceIndicator(),
+  // Frame of Reference Module (STL)
+  opt_manufacturer(),
+  opt_manufacturerModelName(),
+  opt_deviceSerialNumber(),
+  opt_softwareVersions(),
+  // Enhanced General Equipment Module (STL)
+  opt_measurementUnitsCM(),
+  opt_measurementUnitsCSD(),
+  opt_measurementUnitsCV(),
+  //encapsulation file type
+  ftype()
+{
+}
+
+OFBool DcmEncapsulatedDocument::XMLsearchAttribute(
+  XMLNode currnode,
+  OFList<OFString> *results,
+  OFString attr)
+{
+  OFBool found = OFFalse;
+  if (currnode.nChildNode() == 0)
+  {
+    //"currnode has no children (leaf)";
+    if (currnode.isAttributeSet(attr.c_str()))
+    {
+      //attribute found on leaf
+      results->push_back(OFSTRING_GUARD(currnode.getAttribute(attr.c_str())));
+      found = OFTrue;
+    }
+  }
+  else
+  {
+    //"currnode has children (branch)";
+    if (currnode.isAttributeSet(attr.c_str()))
+    {
+      //attribute found on branch
+      results->push_back(OFSTRING_GUARD(currnode.getAttribute(attr.c_str())));
+      found = OFTrue;
+    }
+    for (int i = 0; i < currnode.nChildNode(); i++)
+    {
+      //search all children recursively
+      OFBool childfound = XMLsearchAttribute(currnode.getChildNode(i), results, attr);
+      found |= childfound;
+    }
+  }
+  return found;
+}
+
+OFString DcmEncapsulatedDocument::XMLgetAllAttributeValues(
+  XMLNode fileNode,
+  OFString attr)
+{
+  OFList<OFString> attributeValueslist;
+  OFString attributeValues;
+  if (XMLsearchAttribute(fileNode, &attributeValueslist, attr))
+  {
+    //If the Attribute is mediaType, initialize with text/xml to exclude
+    //the primary MIME Type of the encapsulated document
+    if (attr == "mediaType") attributeValues.append("text/xml");
+    while (!attributeValueslist.empty())
+    {
+      if (attributeValues.find(attributeValueslist.front()) == OFString_npos)
+      {
+        if (!attributeValues.empty()) attributeValues.append("\\");
+        attributeValues.append(attributeValueslist.front());
+      }
+      attributeValueslist.pop_front();
+    }
+    //remove the primary MIME Type of the
+    //encapsulated document
+    if (attr == "mediaType")
+    {
+      if (attributeValues.size() > 9)
+        attributeValues.erase(0, 9);
+      else
+        attributeValues = "";
+    }
+  }
+  return attributeValues;
+}
+
+OFString DcmEncapsulatedDocument::XMLgetAttribute(
+  XMLNode fileNode,
+  DcmTagKey attr)
+{
+  OFString result = "";
+  if (attr == DCM_DocumentTitle)
+  {
+    if (fileNode.getChildNode("title").getText() != NULL)
+    {
+      result = OFString(OFSTRING_GUARD(fileNode.getChildNode("title").getText()));
+    }
+  }
+  if (attr == DCM_HL7InstanceIdentifier)
+  {
+      result = OFString(OFSTRING_GUARD(
+        fileNode.getChildNode("id").getAttribute("root"))) + "^" + OFString(OFSTRING_GUARD(
+          fileNode.getChildNode("id").getAttribute("extension")));
+  }
+  /*PatientNameExtension could reflect the type of name (PHON, IDE, ABC)
+  if (attr == DCM_PatientNameExtension)
+  {
+  result = OFString(OFSTRING_GUARD(fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name").getAttribute("use")));
+  }*/
+  if (attr == DCM_PatientName)
+  {
+    result = OFString(OFSTRING_GUARD(
+      fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name/family").getText())) + "^" + OFString(OFSTRING_GUARD(
+        fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name").getChildNode("given", 0).getText())) + "^" + OFString(OFSTRING_GUARD(
+          fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name").getChildNode("given", 1).getText())) + "^" + OFString(OFSTRING_GUARD(
+            fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name/prefix").getText())) + "^" + OFString(OFSTRING_GUARD(
+              fileNode.getChildNodeByPath("recordTarget/patientRole/patient/name/suffix").getText()));
+  }
+  if (attr == DCM_PatientSex)
+  {
+    result = OFString(OFSTRING_GUARD(fileNode.getChildNodeByPath("recordTarget/patientRole/patient/administrativeGenderCode").getAttribute("code")));
+  }
+  if (attr == DCM_PatientBirthDate)
+  {
+    result = OFString(OFSTRING_GUARD(fileNode.getChildNodeByPath("recordTarget/patientRole/patient/birthTime").getAttribute("value")));
+  }
+  //Table A.8-1. Basic Code Attributes Mapping to HL7 V3 Code Data Types (CV, CS, CE and CD)
+  if (attr == DCM_PatientID)
+  {
+    result = OFString(OFSTRING_GUARD(fileNode.getChildNodeByPath("recordTarget/patientRole/id").getAttribute("extension")));
+  }
+  if (attr == DCM_CodeValue)//Code Value
+  {
+    result = OFString(OFSTRING_GUARD(fileNode.getChildNode("code").getAttribute("code")));
+  }
+  if (attr == DCM_CodingSchemeUID)//Coding Scheme UID (PS3.16)
+  {
+    result = OFString(OFSTRING_GUARD(fileNode.getChildNode("code").getAttribute("codeSystem")));
+  }
+  if (attr == DCM_CodingSchemeDesignator)//Coding Scheme Designator (0008,0102)
+  {
+    OFString CSDtemp=OFString(OFSTRING_GUARD(fileNode.getChildNode("code").getAttribute("codeSystemName")));
+    // Abbreviate most common CSNs
+    if(CSDtemp==OFString("LOINC"))
+    {
+    result = OFString("LN");
+    }
+    else
+    {
+      if(CSDtemp==OFString("DICOM"))
+      {
+      result = OFString("DC");
+      }
+      else
+      {
+        if(CSDtemp==OFString("SNOMED"))
+        {
+          result = OFString("SRT");
+        }
+        else
+        {
+          result=CSDtemp;
+        }
+      }
+    }
+  }
+  if (attr == DCM_CodingSchemeVersion)//Coding Scheme Version (0008,0103)
+  {
+    result = OFString(OFSTRING_GUARD(fileNode.getChildNode("code").getAttribute("codeSystemVersion")));
+  }
+  if (attr == DCM_CodeMeaning)//Code Meaning (0008,0104)
+  {
+    result = OFString(OFSTRING_GUARD(fileNode.getChildNode("code").getAttribute("displayName")));
+  }
+  return result;
+}
+
+int DcmEncapsulatedDocument::getCDAData(
+  const char *filename,
+  OFLogger &appLogger)
+{
+  if (ftype != "cda")
+  {
+    OFLOG_WARN(appLogger, "Filetype mismatch or filetype not set. Current ftype is " << ftype);
+  }
+  XMLResults err;
+  XMLNode fileNode = XMLNode::parseFile(filename, "ClinicalDocument", &err);
+  OFLOG_TRACE(appLogger, "checking if the XML file is correctly formatted");
+  if (0 != err.error)
+  {
+    OFLOG_ERROR(appLogger, fileNode.getError(err.error));
+    return EXITCODE_INVALID_INPUT_FILE;
+  }
+  else
+  {
+    OFLOG_TRACE(appLogger, "XML file is correctly formatted");
+  }
+  OFLOG_TRACE(appLogger, "Getting all media types from CDA file");
+  cda_mediaTypes = XMLgetAllAttributeValues(fileNode, "mediaType");
+  OFLOG_TRACE(appLogger, "Following mediaTypes were found: " << cda_mediaTypes);
+  OFLOG_TRACE(appLogger, "Getting HL7 Instance Identifier from CDA file");
+  hl7_InstanceIdentifier = XMLgetAttribute(fileNode, DCM_HL7InstanceIdentifier);
+  OFLOG_TRACE(appLogger, "Reading and comparing patient information between CDA File and options");
+  OFString pID = XMLgetAttribute(fileNode, DCM_PatientID);
+  if ((pID != "") && (opt_patientID != pID))
+  {
+    if (opt_patientID != "")
+    {
+      //if no-override option is inactive, return an error
+      if (!opt_override)
+      {
+        OFLOG_ERROR(appLogger, "Patient ID mismatch:" << OFendl
+          << "Found in the CDA file : " << pID << OFendl
+          << "Entered (or found in DCM file): " << opt_patientID << OFendl
+          << "If you wish to override, run again with +ov");
+        return EXITCODE_COMMANDLINE_SYNTAX_ERROR;
+      }
+      else
+      {
+        OFLOG_WARN(appLogger, "Patient ID mismatch:" << OFendl
+          << "Found in the CDA file : " << pID << OFendl
+          << "Provided (in DCM file): " << opt_patientID);
+      }
+    }
+    else
+    {
+      opt_patientID = pID;
+    }
+  }
+  OFString pBirthDate = XMLgetAttribute(fileNode, DCM_PatientBirthDate);
+  if ((pBirthDate != "") && (opt_patientBirthdate != pBirthDate))
+  {
+    if (opt_patientBirthdate != "")
+    {
+      if (!opt_override)
+      {
+        OFLOG_ERROR(appLogger, "Patient Birth Date mismatch:" << OFendl
+          << "Found in the CDA file : " << pBirthDate << OFendl
+          << "Provided (in DCM file): " << opt_patientBirthdate << OFendl
+          << "If you wish to override, run again with +ov");
+        return EXITCODE_COMMANDLINE_SYNTAX_ERROR;
+      }
+      else {
+        OFLOG_WARN(appLogger, "Patient Birth Date mismatch:" << OFendl
+          << "Found in the CDA file : " << pBirthDate << OFendl
+          << "Provided (in DCM file): " << opt_patientBirthdate);
+      }
+    }
+    else opt_patientBirthdate = pBirthDate;
+  }
+  OFString pSex = XMLgetAttribute(fileNode, DCM_PatientSex);
+  if ((pSex != "") && (opt_patientSex != pSex))
+  {
+    if (opt_patientSex != "")
+    {
+      if (!opt_override)
+      {
+        OFLOG_ERROR(appLogger, "Patient Sex mismatch:" << OFendl
+          << "Found in the CDA file : " << pSex << OFendl
+          << "Provided (in DCM file): " << opt_patientSex << OFendl
+          << "If you wish to override, run again with +ov");
+        return EXITCODE_COMMANDLINE_SYNTAX_ERROR;
+      }
+      else {
+        OFLOG_WARN(appLogger, "Patient Sex mismatch:" << OFendl
+          << "Found in the CDA file : " << pSex << OFendl
+          << "Provided (in DCM file): " << opt_patientSex);
+      }
+    }
+    else opt_patientSex = pSex;
+  }
+  OFString pName = XMLgetAttribute(fileNode, DCM_PatientName);
+  if ((pName != "^^^^") && (opt_patientName != pName))
+  {
+    if (opt_patientName != "")
+    {
+      if (!opt_override)
+      {
+        OFLOG_ERROR(appLogger, "Patient Name mismatch:" << OFendl
+          << "Found in the CDA file : " << pName << OFendl
+          << "Provided (in DCM file): " << opt_patientName << OFendl
+          << "If you wish to override, run again with +ov");
+        return EXITCODE_COMMANDLINE_SYNTAX_ERROR;
+      }
+      else {
+        OFLOG_WARN(appLogger, "Patient Name mismatch:" << OFendl
+          << "Found in the CDA file : " << pName << OFendl
+          << "Provided (in DCM file): " << opt_patientName);
+      }
+    }
+    else opt_patientName = pName;
+  }
+  //get document title from CDA
+  OFString dTitle = XMLgetAttribute(fileNode, DCM_DocumentTitle);
+  if (opt_documentTitle == "")
+  {
+    if (opt_conceptCSD != "") opt_documentTitle = opt_conceptCSD;
+    if (opt_conceptCV != "") opt_documentTitle = opt_conceptCV;
+    if (opt_conceptCM != "") opt_documentTitle = opt_conceptCM;
+  }
+
+  if ((dTitle != "") && (opt_documentTitle != dTitle))
+  {
+    if (opt_documentTitle != "")
+    {
+      if (!opt_override)
+      {
+        OFLOG_ERROR(appLogger, "Document Title mismatch:" << OFendl
+          << "Found in the CDA file : " << dTitle << OFendl
+          << "Provided (in DCM file): " << opt_documentTitle << OFendl
+          << "If you wish to override, run again with +ov");
+        return EXITCODE_COMMANDLINE_SYNTAX_ERROR;
+      }
+      else {
+        OFLOG_WARN(appLogger, "Document Title mismatch:" << OFendl
+          << "Found in the CDA file : " << dTitle << OFendl
+          << "Provided (in DCM file): " << opt_documentTitle);
+      }
+    }
+    else opt_documentTitle = dTitle;
+  }
+  //get Concept information from CDA
+  OFString cCSD = XMLgetAttribute(fileNode, DCM_CodingSchemeDesignator);
+  if ((cCSD != "") && (opt_conceptCSD != cCSD))
+  {
+    if (opt_conceptCSD != "")
+    {
+      if (!opt_override)
+      {
+        OFLOG_ERROR(appLogger, "concept CSD mismatch:" << OFendl
+          << "Found in the CDA file : " << cCSD << OFendl
+          << "Provided (in DCM file): " << opt_conceptCSD << OFendl
+          << "If you wish to override, run again with +ov");
+        return EXITCODE_COMMANDLINE_SYNTAX_ERROR;
+      }
+      else {
+        OFLOG_WARN(appLogger, "concept CSD mismatch:" << OFendl
+          << "Found in the CDA file : " << cCSD << OFendl
+          << "Provided (in DCM file): " << opt_conceptCSD);
+      }
+    }
+    else opt_conceptCSD = cCSD;
+  }
+  OFString cCV = XMLgetAttribute(fileNode, DCM_CodeValue);
+  if ((cCV != "") && (opt_conceptCV != cCV))
+  {
+    if (opt_conceptCV != "")
+    {
+      if (!opt_override)
+      {
+        OFLOG_ERROR(appLogger, "concept CV mismatch:" << OFendl
+          << "Found in the CDA file : " << cCV << OFendl
+          << "Provided (in DCM file): " << opt_conceptCV << OFendl
+          << "If you wish to override, run again with +ov");
+        return EXITCODE_COMMANDLINE_SYNTAX_ERROR;
+      }
+      else {
+        OFLOG_WARN(appLogger, "concept CV mismatch:" << OFendl
+          << "Found in the CDA file : " << cCV << OFendl
+          << "Provided (in DCM file): " << opt_conceptCV);
+      }
+    }
+    else opt_conceptCV = cCV;
+  }
+  OFString cCM = XMLgetAttribute(fileNode, DCM_CodeMeaning);
+  if ((cCM != "") && (opt_conceptCM != cCM))
+  {
+    if (opt_conceptCM != "")
+    {
+      if (!opt_override)
+      {
+        OFLOG_ERROR(appLogger, "concept CM mismatch:" << OFendl
+          << "Found in the CDA file : " << cCM << OFendl
+          << "Provided (in DCM file): " << opt_conceptCM << OFendl
+          << "If you wish to override, run again with +ov");
+        return EXITCODE_COMMANDLINE_SYNTAX_ERROR;
+      }
+      else {
+        OFLOG_WARN(appLogger, "concept CM mismatch:" << OFendl
+          << "Found in the CDA file : " << cCM << OFendl
+          << "Provided (in DCM file): " << opt_conceptCM);
+      }
+    }
+    else opt_conceptCM = cCM;
+  }
+  return EXITCODE_NO_ERROR;
+}
+
+void DcmEncapsulatedDocument::addCDACommandlineOptions(OFCommandLine &cmd)
+{
+  ftype = "cda";
+  cmd.setOptionColumns(LONGCOL, SHORTCOL);
+  cmd.setParamColumn(LONGCOL + SHORTCOL + 4);
+  cmd.addParam(     "cdafile-in",                         "CDA input filename to be converted");
+  cmd.addParam(     "dcmfile-out",                        "DICOM output filename");
+  addGeneralOptions(cmd);
+  addDocumentOptions(cmd);
+  cmd.addSubGroup("override CDA data:");
+      cmd.addOption("--no-override",          "-ov",      "CDA patient and document data must match study,\nseries or manually entered information (default)");
+      cmd.addOption("--override",             "+ov",      "CDA's data will be overwritten by study, series\nor manually entered information");
+  addOutputOptions(cmd);
+}
+
+void DcmEncapsulatedDocument::addPDFCommandlineOptions(OFCommandLine &cmd)
+{
+  ftype = "pdf";
+  cmd.setOptionColumns(LONGCOL, SHORTCOL);
+  cmd.setParamColumn(LONGCOL + SHORTCOL + 4);
+  cmd.addParam(     "pdffile-in",                         "PDF input filename to be converted");
+  cmd.addParam(     "dcmfile-out",                        "DICOM output filename");
+  addGeneralOptions(cmd);
+  addDocumentOptions(cmd);
+  addOutputOptions(cmd);
+}
+
+void DcmEncapsulatedDocument::addSTLCommandlineOptions(OFCommandLine &cmd)
+{
+  ftype = "stl";
+  cmd.setOptionColumns(LONGCOL, SHORTCOL);
+  cmd.setParamColumn(LONGCOL + SHORTCOL + 4);
+  cmd.addParam(     "stlfile-in",                         "STL input filename to be converted");
+  cmd.addParam(     "dcmfile-out",                        "DICOM output filename");
+  addGeneralOptions(cmd);
+  addDocumentOptions(cmd);
+  cmd.addSubGroup("enhanced general equipment:");
+      cmd.addOption("--manufacturer",         "+mn",  1,  "[n]ame: string",
+                                                          "manufacturer's name");
+      cmd.addOption("--manufacturer-model",   "+mm",  1,  "[n]ame: string",
+                                                          "manufacturer's model name");
+      cmd.addOption("--device-serial",        "+ds",  1,  "[n]umber: string",
+                                                          "device serial number");
+      cmd.addOption("--software-versions",    "+sv",  1,  "[v]ersions: string",
+                                                          "software versions");
+  cmd.addSubGroup("3d model measurement units:");
+      cmd.addOption("--measurement-units",    "+mu",  3,  "[CSD] [CV] [CM]: string (default: UCUM, um, um)",
+                                                          "measurement units defined by coding scheme\ndesignator CSD, code value CV, code meaning CM");
+  addOutputOptions(cmd);
+}
+
+void DcmEncapsulatedDocument::addGeneralOptions(OFCommandLine &cmd)
+{
+  cmd.addGroup(     "general options:", LONGCOL, SHORTCOL + 2);
+    cmd.addOption(  "--help",                 "-h",       "print this help text and exit",          OFCommandLine::AF_Exclusive);
+    cmd.addOption(  "--version",                          "print version information and exit",     OFCommandLine::AF_Exclusive);
+  OFLog::addOptions(cmd);
+}
+
+void DcmEncapsulatedDocument::addDocumentOptions(OFCommandLine &cmd)
+{
+  cmd.addGroup(     "DICOM document options:");
+    cmd.addSubGroup("document title:");
+      cmd.addOption("--title",                "+t",   1,  "[t]itle: string (default: empty)",
+                                                          "document title");
+      cmd.addOption("--concept-name",         "+cn",  3,  "[CSD] [CV] [CM]: string (default: empty)",
+                                                          "coded representation of document title defined\nby coding scheme designator CSD,\ncode value CV and code meaning CM");
+    cmd.addSubGroup("patient data:");
+      cmd.addOption("--patient-name",         "+pn",  1,  "[n]ame: string",
+                                                          "patient's name in DICOM PN syntax");
+      cmd.addOption("--patient-id",           "+pi",  1,  "[i]d: string",
+                                                          "patient identifier");
+      cmd.addOption("--patient-birthdate",    "+pb",  1,  "[d]ate: string (YYYYMMDD)",
+                                                          "patient's birth date");
+      cmd.addOption("--patient-sex",          "+ps",  1,  "[s]ex: string (M, F or O)",
+                                                          "patient's sex");
+    cmd.addSubGroup("study and series:");
+      cmd.addOption("--generate",             "+sg",      "generate new study and\nseries UIDs (default)");
+      cmd.addOption("--study-from",           "+st",  1,  "[f]ilename: string",
+                                                          "read patient/study data from DICOM file");
+      cmd.addOption("--series-from",          "+se",  1,  "[f]ilename: string",
+                                                          "read patient/study/series data from DICOM file");
+    cmd.addSubGroup("instance number:");
+      cmd.addOption("--instance-one",         "+i1",      "use instance number 1\n(default, not with +se)");
+      cmd.addOption("--instance-inc",         "+ii",      "increment instance number (only with +se)");
+      cmd.addOption("--instance-set",         "+is",  1,  "[i]nstance number: integer", "use instance number i");
+    cmd.addSubGroup("burned-in annotation:");
+      cmd.addOption("--annotation-yes",       "+an",      "document contains patient identifying data\n(default)");
+      cmd.addOption("--annotation-no",        "-an",      "document does not contain patient identif. data");
+}
+
+void DcmEncapsulatedDocument::addOutputOptions(OFCommandLine &cmd)
+{
+  cmd.addGroup(     "processing options:");
+    cmd.addSubGroup("other processing options:");
+      cmd.addOption("--key",                  "-k",   1,  "[k]ey: gggg,eeee=\"str\", path or dict. name=\"str\"",
+                                                          "add further attribute");
+  cmd.addGroup(     "output options:");
+    cmd.addSubGroup("output transfer syntax:");
+      cmd.addOption("--write-xfer-little",    "+te",      "write with explicit VR little endian (default)");
+      cmd.addOption("--write-xfer-big",       "+tb",      "write with explicit VR big endian TS");
+      cmd.addOption("--write-xfer-implicit",  "+ti",      "write with implicit VR little endian TS");
+    cmd.addSubGroup("group length encoding:");
+      cmd.addOption("--group-length-recalc",  "+g=",      "recalculate group lengths if present (default)");
+      cmd.addOption("--group-length-create",  "+g",       "always write with group length elements");
+      cmd.addOption("--group-length-remove",  "-g",       "always write without group length elements");
+    cmd.addSubGroup("length encoding in sequences and items:");
+      cmd.addOption("--length-explicit",      "+e",       "write with explicit lengths (default)");
+      cmd.addOption("--length-undefined",     "-e",       "write with undefined lengths");
+    cmd.addSubGroup("data set trailing padding (not with --write-dataset):");
+      cmd.addOption("--padding-retain",       "-p=",      "do not change padding (default)");
+      cmd.addOption("--padding-off",          "-p",       "no padding (implicit if --write-dataset)");
+      cmd.addOption("--padding-create",       "+p",   2,  "[f]ile-pad [i]tem-pad: integer",
+                                                          "align file on multiple of f bytes\nand items on multiple of i bytes");
+}
+
+void DcmEncapsulatedDocument::parseArguments(
+  OFConsoleApplication& app,
+  OFCommandLine& cmd)
+{
+  //command line parameters and options
+  cmd.getParam(1, opt_ifname);
+  cmd.getParam(2, opt_ofname);
+
+  OFLog::configureFromCommandLine(cmd, app);
+
+  dcmEnableGenerationOfNewVRs();
+
+  // Override keys are applied at the very end of the conversion "pipeline"
+  OFList<OFString> overrideKeys;
+
+  cmd.beginOptionBlock();
+  if (cmd.findOption("--generate"))
+  {
+    opt_seriesFile = "";
+    opt_readSeriesInfo = OFFalse;
+  }
+
+  if (cmd.findOption("--series-from"))
+  {
+    app.checkValue(cmd.getValue(opt_seriesFile));
+    opt_readSeriesInfo = OFTrue;
+  }
+
+  if (cmd.findOption("--study-from"))
+  {
+    app.checkValue(cmd.getValue(opt_seriesFile));
+    opt_readSeriesInfo = OFFalse;
+  }
+  cmd.endOptionBlock();
+  if (cmd.findOption("--title"))
+  {
+    app.checkValue(cmd.getValue(opt_documentTitle));
+  }
+  if (cmd.findOption("--concept-name"))
+  {
+    app.checkValue(cmd.getValue(opt_conceptCSD));
+    app.checkValue(cmd.getValue(opt_conceptCV));
+    app.checkValue(cmd.getValue(opt_conceptCM));
+  }
+  if (cmd.findOption("--patient-name"))
+  {
+    app.checkValue(cmd.getValue(opt_patientName));
+    app.checkConflict("--patient-name", "--study-from or --series-from",
+                        opt_seriesFile != "");
+  }
+  if (cmd.findOption("--patient-id"))
+  {
+    app.checkValue(cmd.getValue(opt_patientID));
+    app.checkConflict("--patient-id", "--study-from or --series-from",
+                        opt_seriesFile != "");
+  }
+  if (cmd.findOption("--patient-birthdate"))
+  {
+    app.checkValue(cmd.getValue(opt_patientBirthdate));
+    app.checkConflict("--patient-birthdate", "--study-from or --series-from", opt_seriesFile != "");
+  }
+  if (cmd.findOption("--patient-sex"))
+  {
+    app.checkValue(cmd.getValue(opt_patientSex));
+    app.checkConflict("--patient-sex", "--study-from or --series-from", opt_seriesFile != "");
+  }
+  cmd.beginOptionBlock();
+  if (cmd.findOption("--annotation-yes"))
+  {
+    opt_annotation = OFTrue;
+  }
+  if (cmd.findOption("--annotation-no"))
+  {
+    opt_annotation = OFFalse;
+  }
+  cmd.endOptionBlock();
+  if (ftype == "cda")
+  {
+    cmd.beginOptionBlock();
+    if (cmd.findOption("--override"))
+    {
+      opt_override = OFTrue;
+    }
+    if (cmd.findOption("--no-override"))
+    {
+      opt_override = OFFalse;
+    }
+    cmd.endOptionBlock();
+  }
+  if (ftype == "stl")
+  {
+    if (cmd.findOption("--measurement-units"))
+    {
+      app.checkValue(cmd.getValue(opt_measurementUnitsCSD));
+      app.checkValue(cmd.getValue(opt_measurementUnitsCV));
+      app.checkValue(cmd.getValue(opt_measurementUnitsCM));
+    }
+    if (cmd.findOption("--manufacturer")) app.checkValue(cmd.getValue(opt_manufacturer));
+    if (cmd.findOption("--manufacturer-model")) app.checkValue(cmd.getValue(opt_manufacturerModelName));
+    if (cmd.findOption("--device-serial")) app.checkValue(cmd.getValue(opt_deviceSerialNumber));
+    if (cmd.findOption("--software-versions")) app.checkValue(cmd.getValue(opt_softwareVersions));
+  }
+  cmd.beginOptionBlock();
+  if (cmd.findOption("--write-xfer-little")) opt_oxfer = EXS_LittleEndianExplicit;
+  if (cmd.findOption("--write-xfer-big")) opt_oxfer = EXS_BigEndianExplicit;
+  if (cmd.findOption("--write-xfer-implicit")) opt_oxfer = EXS_LittleEndianImplicit;
+  cmd.endOptionBlock();
+
+  cmd.beginOptionBlock();
+  if (cmd.findOption("--group-length-recalc")) opt_oglenc = EGL_recalcGL;
+  if (cmd.findOption("--group-length-create")) opt_oglenc = EGL_withGL;
+  if (cmd.findOption("--group-length-remove")) opt_oglenc = EGL_withoutGL;
+  cmd.endOptionBlock();
+
+  cmd.beginOptionBlock();
+  if (cmd.findOption("--length-explicit")) opt_oenctype = EET_ExplicitLength;
+  if (cmd.findOption("--length-undefined")) opt_oenctype = EET_UndefinedLength;
+  cmd.endOptionBlock();
+
+  cmd.beginOptionBlock();
+  if (cmd.findOption("--padding-retain"))
+  {
+    app.checkConflict("--padding-retain", "--write-dataset",
+                        opt_writeMode == EWM_dataset);
+    opt_opadenc = EPD_noChange;
+  }
+  if (cmd.findOption("--padding-off")) opt_opadenc = EPD_withoutPadding;
+  if (cmd.findOption("--padding-create"))
+  {
+    app.checkConflict("--padding-create", "--write-dataset",
+                        opt_writeMode == EWM_dataset);
+    app.checkValue(cmd.getValueAndCheckMin(opt_filepad, 0));
+    app.checkValue(cmd.getValueAndCheckMin(opt_itempad, 0));
+    opt_opadenc = EPD_withPadding;
+  }
+  cmd.endOptionBlock();
+
+  // create override attribute dataset (copied from findscu code)
+  if (cmd.findOption("--key", 0, OFCommandLine::FOM_FirstFromLeft ) )
+  {
+    const char *ovKey = NULL;
+    do {
+      app.checkValue(cmd.getValue(ovKey));
+      overrideKeys.push_back(ovKey);
+    } while (cmd.findOption("--key", 0, OFCommandLine::FOM_NextFromLeft ) );
+  }
+  DcmEncapsulatedDocument::setOverrideKeys(overrideKeys);
+  // initialize default for --series-from
+  if (opt_seriesFile!="" && opt_readSeriesInfo) opt_increment = OFTrue;
+
+  cmd.beginOptionBlock();
+  if (cmd.findOption("--instance-one"))
+  {
+    app.checkConflict("--instance-one", "--series-from",
+                      (opt_seriesFile != "") && opt_readSeriesInfo);
+    opt_increment = OFFalse;
+    opt_instance = 1;
+  }
+  if (cmd.findOption("--instance-inc"))
+  {
+    app.checkDependence("--instance-inc", "--series-from",
+                        (opt_seriesFile != "") && opt_readSeriesInfo);
+    opt_increment = OFTrue;
+  }
+  if (cmd.findOption("--instance-set"))
+  {
+    opt_increment = OFFalse;
+    app.checkValue(cmd.getValueAndCheckMin(opt_instance, 1));
+  }
+  cmd.endOptionBlock();
+}
+
+OFCondition DcmEncapsulatedDocument::createIdentifiers(OFLogger& appLogger)
+{
+  char buf[100];
+  OFCondition cond = EC_Normal;
+  Sint32 incrementedInstance = 0;
+  if (opt_seriesFile != "")
+  {
+    DcmFileFormat dfile;
+    cond = dfile.loadFile(opt_seriesFile, EXS_Unknown, EGL_noChange);
+    if (cond.bad())
+    {
+      OFLOG_WARN(appLogger, cond.text() <<
+                  ": reading file: " << opt_seriesFile);
+    }
+    else
+    {
+      const char *c = NULL;
+      DcmDataset *dset = dfile.getDataset();
+      if (dset)
+      {
+        OFLOG_TRACE(appLogger, "reading patient attributes");
+        c = NULL;
+        if (dset->findAndGetString(DCM_PatientName, c).good() && c)
+        {
+        opt_patientName = c;
+        }
+        c = NULL;
+        if (dset->findAndGetString(DCM_PatientID, c).good() && c)
+        {
+        opt_patientID = c;
+        }
+        c = NULL;
+        if (dset->findAndGetString(DCM_PatientBirthDate, c).good() && c)
+        {
+        opt_patientBirthdate = c;
+        }
+        c = NULL;
+        if (dset->findAndGetString(DCM_PatientSex, c).good() && c)
+        {
+        opt_patientSex = c;
+        }
+        OFLOG_TRACE(appLogger, "reading study attributes");
+        c = NULL;
+        if (dset->findAndGetString(DCM_StudyInstanceUID, c).good() && c)
+        {
+        opt_studyUID = c;
+        }
+        OFLOG_TRACE(appLogger, "reading series attributes");
+        if (opt_readSeriesInfo)
+        {
+          c = NULL;
+          if (dset->findAndGetString(DCM_SeriesInstanceUID, c).good() && c)
+          {
+          opt_seriesUID = c;
+          }
+          if (dset->findAndGetSint32(DCM_InstanceNumber,
+                                      incrementedInstance).good())
+          {
+            ++incrementedInstance;
+          }
+          else
+          {
+            incrementedInstance = 0;
+          }
+          if (opt_increment) opt_instance = incrementedInstance;
+        }
+        if (ftype == "stl")
+        {
+          OFLOG_TRACE(appLogger, "reading STL specific information");
+          c = NULL;
+          OFLOG_TRACE(appLogger, "reading Frame of Reference Info");
+          if (dset->findAndGetString(DCM_FrameOfReferenceUID, c).good() && c)
+          {
+            opt_frameOfReferenceUID = c;
+          }
+          c = NULL;
+          if (dset->findAndGetString(DCM_PositionReferenceIndicator, c).good() && c)
+          {
+            opt_positionReferenceIndicator = c;
+          }
+          OFLOG_TRACE(appLogger, "reading Enhanced Equipment info");
+          c = NULL;
+          if (dset->findAndGetString(DCM_Manufacturer, c).good() && c)
+          {
+            opt_manufacturer = c;
+          }
+          c = NULL;
+          if (dset->findAndGetString(DCM_ManufacturerModelName, c).good() && c)
+          {
+            opt_manufacturerModelName = c;
+          }
+          c = NULL;
+          if (dset->findAndGetString(DCM_DeviceSerialNumber, c).good() && c)
+          {
+            opt_deviceSerialNumber = c;
+          }
+          c = NULL;
+          if (dset->findAndGetString(DCM_SoftwareVersions, c).good() && c)
+          {
+            opt_softwareVersions = c;
+          }
+          OFLOG_TRACE(appLogger, "reading manufacturing 3d model info");
+          {
+
+            OFLOG_TRACE(appLogger, "manufacturing 3d model info read successfully");
+          }
+        }
+      }
+    }
+  }
+  if (opt_studyUID.empty())
+  {
+    dcmGenerateUniqueIdentifier(buf, SITE_STUDY_UID_ROOT);
+    opt_studyUID = buf;
+  }
+  if (opt_seriesUID.empty())
+  {
+    dcmGenerateUniqueIdentifier(buf, SITE_SERIES_UID_ROOT);
+    opt_seriesUID = buf;
+  }
+  return cond;
+}
+
+int DcmEncapsulatedDocument::insertEncapsulatedDocument(
+  DcmItem *dataset,
+  OFLogger& appLogger)
+{
+  char buf[100];
+  size_t fileSize = 0;
+  size_t buflen = 100;
+  struct stat fileStat;
+
+  if (0 == stat(opt_ifname.c_str(), &fileStat))
+  {
+    fileSize = OFstatic_cast(size_t, fileStat.st_size);
+  }
+  else
+  {
+    OFLOG_ERROR(appLogger, "file " << opt_ifname << " not found");
+    return EXITCODE_NO_INPUT_FILES;
+  }
+  if (fileSize == 0)
+  {
+    OFLOG_ERROR(appLogger, "file " << opt_ifname << " is empty");
+    return EXITCODE_INVALID_INPUT_FILE;
+  }
+  FILE *encapfile = fopen(opt_ifname.c_str(), "rb");
+  if (encapfile == NULL)
+  {
+    OFLOG_ERROR(appLogger, "unable to read file " << opt_ifname);
+    return EXITCODE_CANNOT_READ_INPUT_FILE;
+  }
+  if (fileSize < buflen)
+  {
+    buflen = fileSize;
+  }
+  if (buflen != fread(buf, 1, buflen, encapfile))
+  {
+    OFLOG_ERROR(appLogger, "read error in file " << opt_ifname);
+    fclose(encapfile);
+    return EXITCODE_INVALID_INPUT_FILE;
+  }
+  if (ftype == "pdf")
+  {
+    // check magic word for PDF file
+    if (0 != strncmp("%PDF-", buf, 5))
+    {
+      OFLOG_ERROR(appLogger, "file " << opt_ifname << " is not a PDF file");
+      fclose(encapfile);
+      return EXITCODE_INVALID_INPUT_FILE;
+    }
+    // check PDF version number
+    char *version = buf + 5;
+    OFBool found = OFFalse;
+    for (int i = 0; i < 5; ++i)
+    {
+      if (version[i] == 10 || version[i] == 13)
+      {
+        version[i] = 0; // insert end of string
+        found = OFTrue;
+        break;
+      }
+    }
+    if (!found)
+    {
+      OFLOG_ERROR(appLogger, "file " << opt_ifname
+        << ": unable to decode PDF version number");
+      fclose(encapfile);
+      return EXITCODE_INVALID_INPUT_FILE;
+    }
+    OFLOG_INFO(appLogger, "file " << opt_ifname
+      << ": PDF " << version << ", "
+      << (fileSize + 1023) / 1024 << "kB");
+  }
+  else
+  {
+    if (ftype == "cda")
+    {
+      //xml validation occurs when getting data
+      OFLOG_INFO(appLogger, "file " << opt_ifname
+        << ": HL7 CDA file (XML Format)" << ", "
+        << (fileSize + 1023) / 1024 << "kB");
+    }
+    else
+    {
+      if (ftype == "stl")
+      {
+        // Each facet contains:
+        //  - Normals: 3 floats (4 bytes)
+        //  - Vertices: 3x floats (4 byte each, 12 bytes total)
+        //  - AttributeCount: 1 short (2 bytes)
+        // Total: 50 bytes per facet
+        const size_t facetSize32 = 3 * sizeof(Float32)
+          + 3 * 3 * sizeof(Float32)
+          + sizeof(Uint16);
+        const size_t facetSize64 = 3 * sizeof(Float64)
+          + 3 * 3 * sizeof(Float64)
+          + sizeof(Uint16);
+        // STL validation for ASCII CODE
+        if (fileSize < 15)
+        {
+          // "solid " and "endsolid " markers for an ASCII file
+          OFLOG_ERROR(appLogger, "The STL file is not long enough"
+            << " (" << fileSize << "kB)");
+          fclose(encapfile);
+          return EXITCODE_INVALID_INPUT_FILE;
+        }
+        // Binary files should never start with "solid ",
+        // but just in case, check for ASCII,
+        // and if not valid then check for binary...
+        // Look for text "solid " in first 6 bytes,
+        // indicating the possibility that this is an
+        // ASCII STL format.
+        if (0 == strncmp("solid ", buf, 6))
+        {
+          OFLOG_ERROR(appLogger, "File " << opt_ifname
+            << " starts with 'solid '. "
+            << "It is a valid STL file but it is in ASCII Code"
+            << "and DICOM only accepts binary STL");
+          return EXITCODE_INVALID_INPUT_FILE;
+        }
+        //////STL validation for Binary Format
+        else
+        {
+          OFLOG_DEBUG(appLogger, "Magic word 'solid ' not found. "
+            << "Validating STL file "
+            << "in Binary format");
+          // 80-byte header + 4-byte "number of triangles" for a binary file
+          if (fileSize < 84)
+          {
+            OFLOG_ERROR(appLogger, "The binary STL file is not long enough"
+              << " (" << fileSize << "kB)");
+            fclose(encapfile);
+            return EXITCODE_INVALID_INPUT_FILE;
+          }
+          // Header is from bytes 0-79
+          // The number of Triangles starts at byte offset 80 and is a uint32 (4 Bytes)
+          char ntriangleschar[5];
+          for (int j = 0; j < 4; j++)
+            ntriangleschar[j] = buf[80 + j];
+          ntriangleschar[4] = 0;
+          Uint32* nTriangles = OFreinterpret_cast(Uint32*, ntriangleschar);
+          // Verify that file size equals the sum of
+          // header + nTriangles value + all triangles
+          OFLOG_DEBUG(appLogger, "verifying if the file size is consistent");
+          if (fileSize == (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize32) ||
+            fileSize == (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize64))
+          {
+            OFLOG_DEBUG(appLogger, "File " << opt_ifname
+              << " passed binary STL validation." << OFendl
+              << "Assuming valid STL file "
+              << "in binary format"
+            );
+            OFLOG_TRACE(appLogger, "The binary STL file is:" << OFendl
+              << fileSize << " kB " << " as expected." << OFendl
+              << (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize32) << " kB for x86" << OFendl
+              << (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize64) << " kB for x64" << OFendl
+              << "(84 + triangles number * facet size)" << OFendl
+              << " number of Triangles " << *OFconst_cast(Uint32*, nTriangles) << OFendl
+              << " nTriangles (Uint32): " << nTriangles << OFendl
+              << " facetSize32: " << facetSize32 << OFendl
+              << " facetSize64: " << facetSize64 << OFendl
+            );
+          }
+          else
+          {
+            OFLOG_ERROR(appLogger, "The binary STL file is not consistent." << OFendl
+              << (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize32) << " kB for x86 and "
+              << (84 + *OFconst_cast(Uint32*, nTriangles) * facetSize64) << " kB for x64 " << OFendl
+              << "(84 + triangles number * facet size)" << OFendl
+              << " number of Triangles " << *OFconst_cast(Uint32*, nTriangles) << OFendl
+              << " nTriangles (Uint32): " << nTriangles << OFendl
+              << " facetSize32: " << facetSize32 << OFendl
+              << " facetSize64: " << facetSize64 << OFendl
+            );
+            fclose(encapfile);
+            return EXITCODE_INVALID_INPUT_FILE;
+          }
+        }
+      }
+      else
+      {
+        OFLOG_WARN(appLogger, "Filetype not supported or filetype not set. Current ftype is " << ftype << OFendl
+          << "The name of the passed logger is: " << appLogger.getName());
+      }
+    }
+  }
+  if (0 != fseek(encapfile, 0, SEEK_SET))
+  {
+    OFLOG_ERROR(appLogger, "file " << opt_ifname << ": seek error");
+    fclose(encapfile);
+    return EXITCODE_CANNOT_READ_INPUT_FILE;
+  }
+  OFCondition result = EC_Normal;
+  DcmPolymorphOBOW *elem = new DcmPolymorphOBOW(DCM_EncapsulatedDocument);
+  if (elem)
+  {
+    size_t numBytes = fileSize;
+    if (numBytes & 1) ++numBytes;
+    Uint8 *bytes = NULL;
+    result = elem->createUint8Array(OFstatic_cast(Uint32, numBytes), bytes);
+    if (result.good())
+    {
+      // blank pad byte
+      bytes[numBytes - 1] = 0;
+      // read file content
+      if (fileSize != fread(bytes, 1, fileSize, encapfile))
+      {
+        OFLOG_ERROR(appLogger, "read error in file " << opt_ifname);
+        return EXITCODE_CANNOT_READ_INPUT_FILE;
+      }
+    }
+  }
+  else
+  {
+    fclose(encapfile);
+    return EXITCODE_MEMORY_EXHAUSTED;
+  }
+  // if successful, insert element into dataset
+  if (result.good())
+  {
+    result = dataset->insert(elem);
+  }
+  else
+  {
+    delete elem;
+    OFLOG_ERROR(appLogger, "Unsuccessful, did not insert element.");
+    return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+  }
+  // close file
+  fclose(encapfile);
+  if (result.good())
+  {
+    return EXITCODE_NO_ERROR;
+  }
+  else
+  {
+    return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+  }
+}
+
+OFCondition DcmEncapsulatedDocument::createHeader(
+  DcmItem *dataset,
+  OFLogger& logger)
+{
+  OFCondition result = EC_Normal;
+  char buf[80];
+  // insert empty type 2 attributes
+  if (result.good()) result = dataset->insertEmptyElement(DCM_StudyDate);
+  if (result.good()) result = dataset->insertEmptyElement(DCM_StudyTime);
+  if (result.good()) result = dataset->insertEmptyElement(DCM_AccessionNumber);
+  if (result.good()) result = dataset->insertEmptyElement(DCM_Manufacturer);
+  if (result.good()) result = dataset->insertEmptyElement(DCM_ReferringPhysicianName);
+  if (result.good()) result = dataset->insertEmptyElement(DCM_StudyID);
+  if (result.good()) result = dataset->insertEmptyElement(DCM_ContentDate);
+  if (result.good()) result = dataset->insertEmptyElement(DCM_ContentTime);
+  if (result.good()) result = dataset->insertEmptyElement(DCM_AcquisitionDateTime);
+  if (result.good())
+  {
+    if (opt_conceptCSD!="" && opt_conceptCV != "" && opt_conceptCM != "")
+    {
+      result = DcmCodec::insertCodeSequence(dataset, DCM_ConceptNameCodeSequence,
+                                            opt_conceptCSD.c_str(),
+                                            opt_conceptCV.c_str(),
+                                            opt_conceptCM.c_str());
+    }
+    else
+    {
+      result = dataset->insertEmptyElement(DCM_ConceptNameCodeSequence);
+    }
+  }
+  // insert const value attributes
+  if (result.good())
+  {
+  result = dataset->putAndInsertString(DCM_SpecificCharacterSet, "ISO_IR 100");
+  }
+  //insert encapsulated file storage UID (CDA/PDF/STL)
+  if (result.good())
+  {
+    if (ftype == "pdf")
+    {
+      OFLOG_TRACE(logger, "Inserting SOPClassUID to dataset");
+      result = dataset->putAndInsertString(DCM_SOPClassUID, UID_EncapsulatedPDFStorage);
+    }
+    if (ftype == "cda")
+    {
+      OFLOG_TRACE(logger, "Inserting SOPClassUID to dataset");
+      result = dataset->putAndInsertString(DCM_SOPClassUID, UID_EncapsulatedCDAStorage);
+    }
+    if (ftype == "stl")
+    {//STL Specific modules
+      OFLOG_TRACE(logger, "Validating Frame of Reference UID value");
+      if (opt_frameOfReferenceUID.empty())
+      {
+        OFLOG_DEBUG(logger, "Frame of Reference UID "
+                    << DCM_FrameOfReferenceUID
+                    << "value was empty, generating a new one."
+                      );
+        dcmGenerateUniqueIdentifier(buf, SITE_SERIES_UID_ROOT);
+        opt_frameOfReferenceUID = buf;
+      }
+      else
+      {
+        if (DcmUniqueIdentifier::checkStringValue(opt_frameOfReferenceUID, "1").bad())
+        {
+          OFLOG_DEBUG(logger, "Frame of Reference UID "
+                      << DCM_FrameOfReferenceUID
+                      << "value was faulty, generating a new one."
+                        );
+          dcmGenerateUniqueIdentifier(buf, SITE_SERIES_UID_ROOT);
+          opt_frameOfReferenceUID = buf;
+        }
+      }
+      if (result.good())
+      {
+        OFLOG_TRACE(logger, "Inserting Frame of Reference info to dataset");
+        result = dataset->putAndInsertOFStringArray(DCM_FrameOfReferenceUID, opt_frameOfReferenceUID);
+      }
+      if (result.good())result = dataset->putAndInsertOFStringArray(DCM_PositionReferenceIndicator, opt_positionReferenceIndicator);
+      OFLOG_TRACE(logger, "Validating and inserting Enhanced General Equipment fields");
+      if (result.good())
+      {
+        if (opt_manufacturer.empty())
+        {
+          OFLOG_ERROR(logger, "No Manufacturer "
+                      << DCM_Manufacturer
+                      << " provided nor found in series "
+                      <<"(required for Enhanced General Equipment module)."
+                        );
+          result = EC_InvalidValue;
+        }
+        else result = dataset->putAndInsertOFStringArray(DCM_Manufacturer, opt_manufacturer);
+      }
+      if (result.good())
+      {
+        if (opt_manufacturerModelName.empty())
+        {
+          OFLOG_ERROR(logger, "No Manufacturer Model Name "
+                      << DCM_ManufacturerModelName
+                      << " provided nor found in series "
+                      <<"(required for Enhanced General Equipment module)."
+                        );
+          result = EC_InvalidValue;
+        }
+        else result = dataset->putAndInsertOFStringArray(DCM_ManufacturerModelName, opt_manufacturerModelName);
+      }
+      if (result.good())
+      {
+        if (opt_deviceSerialNumber.empty())
+        {
+          OFLOG_ERROR(logger, "No Device Serial Number "
+                      << DCM_DeviceSerialNumber
+                      << " provided nor found in series "
+                      <<"(required for Enhanced General Equipment module)."
+                        );
+          result = EC_InvalidValue;
+        }
+        else result = dataset->putAndInsertOFStringArray(DCM_DeviceSerialNumber, opt_deviceSerialNumber);
+      }
+      if (result.good())
+      {
+        if (opt_softwareVersions.empty())
+        {
+          OFLOG_ERROR(logger, "No Software Versions "
+                      << DCM_SoftwareVersions
+                      << " provided nor found in series "
+                      <<"(required for Enhanced General Equipment module)."
+                        );
+          result = EC_InvalidValue;
+        }
+        else result = dataset->putAndInsertOFStringArray(DCM_SoftwareVersions, opt_softwareVersions);
+      }
+      if (result.good())
+      {
+        if (opt_measurementUnitsCSD != "" && opt_measurementUnitsCV != "" && opt_measurementUnitsCM != "")
+        {
+          result = DcmCodec::insertCodeSequence(dataset, DCM_MeasurementUnitsCodeSequence,
+            opt_measurementUnitsCSD.c_str(),
+            opt_measurementUnitsCV.c_str(),
+            opt_measurementUnitsCM.c_str());
+        }
+        else
+        {
+          OFLOG_DEBUG(logger, "Measurement Units Code Sequence "
+                      << DCM_FrameOfReferenceUID
+                      << "had one or more empty values, generating default values."
+                        );
+          result = DcmCodec::insertCodeSequence(dataset, DCM_MeasurementUnitsCodeSequence, "UCUM","um","um");
+        }
+      }
+      if (result.good())
+      {
+        OFLOG_TRACE(logger, "Inserting SOPClassUID to dataset");
+        result = dataset->putAndInsertString(DCM_SOPClassUID, UID_EncapsulatedSTLStorage);
+      }
+    }
+  }
+  if (result.good())
+  {
+    if (ftype=="stl")
+    {
+      result = dataset->putAndInsertString(DCM_Modality, "M3D");
+    }
+    else
+    {
+      // we are now using "DOC" for the modality, which seems to be more appropriate than "OT" (see CP-749)
+      result = dataset->putAndInsertString(DCM_Modality, "DOC");
+    }
+  }
+  if (result.good())
+  {
+    if (ftype != "stl")
+    {
+      OFLOG_TRACE(logger, "Inserting default Conversion type: Workstation (WSD) to dataset");
+      result = dataset->putAndInsertString(DCM_ConversionType, "WSD");
+    }
+    else
+    {
+      OFLOG_TRACE(logger, "STL has no Conversion Type");
+      result = EC_Normal;
+    }
+  }
+  if (result.good())
+  {
+    // according to C.24.2.1 on part 3, (0042,0012) is text/XML for CDA.
+    if (ftype=="cda")
+      result = dataset->putAndInsertString(DCM_MIMETypeOfEncapsulatedDocument, "text/XML");
+    // according to A.45.1.4.1 on part 3, MIME Type is application/pdf for PDF.
+    if (ftype=="pdf")
+      result = dataset->putAndInsertString(DCM_MIMETypeOfEncapsulatedDocument, "application/pdf");
+    // according to A.85.1.4.2 on part 3, MIME Type is model/stl.
+    if (ftype=="stl")
+      result = dataset->putAndInsertString(DCM_MIMETypeOfEncapsulatedDocument, "model/stl");
+  }
+  // there is no way we could determine a meaningful series number, so we just use a constant.
+  if (result.good()) result = dataset->putAndInsertString(DCM_SeriesNumber, "1");
+  // insert variable value attributes
+  if (result.good()) result = dataset->putAndInsertString(DCM_DocumentTitle, opt_documentTitle.c_str());
+  if (result.good()) result = dataset->putAndInsertString(DCM_PatientName, opt_patientName.c_str());
+  if (result.good()) result = dataset->putAndInsertString(DCM_PatientID, opt_patientID.c_str());
+  if (result.good()) result = dataset->putAndInsertString(DCM_PatientBirthDate, opt_patientBirthdate.c_str());
+  if (result.good()) result = dataset->putAndInsertString(DCM_PatientSex, opt_patientSex.c_str());
+  if (result.good()) result = dataset->putAndInsertString(DCM_BurnedInAnnotation, opt_annotation ? "YES" : "NO");
+  if (strlen(cda_mediaTypes.c_str()) >0)
+  {
+    if (result.good()) result = dataset->putAndInsertString(DCM_ListOfMIMETypes, cda_mediaTypes.c_str());
+  }
+  if (hl7_InstanceIdentifier.size() >0)
+  {
+    if (result.good()) result = dataset->putAndInsertString(DCM_HL7InstanceIdentifier, hl7_InstanceIdentifier.c_str());
+  }
+  sprintf(buf, "%ld", OFstatic_cast(long, opt_instance));
+  if (result.good()) result = dataset->putAndInsertString(DCM_InstanceNumber, buf);
+  dcmGenerateUniqueIdentifier(buf, SITE_INSTANCE_UID_ROOT);
+  if (result.good()) result = dataset->putAndInsertString(DCM_StudyInstanceUID, opt_studyUID.c_str());
+  if (result.good()) result = dataset->putAndInsertString(DCM_SeriesInstanceUID, opt_seriesUID.c_str());
+  if (result.good()) result = dataset->putAndInsertString(DCM_SOPInstanceUID, buf);
+  // set instance creation date and time
+  OFString s;
+  if (result.good()) result = DcmDate::getCurrentDate(s);
+  if (result.good()) result = dataset->putAndInsertOFStringArray(DCM_InstanceCreationDate, s);
+  if (result.good()) result = DcmTime::getCurrentTime(s);
+  if (result.good()) result = dataset->putAndInsertOFStringArray(DCM_InstanceCreationTime, s);
+  return result;
+}
+
+OFCondition DcmEncapsulatedDocument::applyOverrideKeys(DcmDataset *outputDset)
+{
+  // replace specific keys by those in overrideKeys, copied from findscu
+  OFListConstIterator(OFString) path = opt_overrideKeys.begin();
+  OFListConstIterator(OFString) endOfList = opt_overrideKeys.end();
+  OFCondition cond;
+  DcmPathProcessor proc;
+  while (path != endOfList)
+  {
+    cond = proc.applyPathWithValue(outputDset, *path);
+    if (cond.bad())
+    {
+      OFString err;
+      err += "Bad override key/path: "; err += *path; err += ": "; err += cond.text();
+      return makeOFCondition(OFM_dcmdata, 18, OF_error, err.c_str());
+    }
+    path++;
+  }
+  return cond;
+}
+
+void DcmEncapsulatedDocument::setOverrideKeys(const OFList<OFString>& ovkeys)
+{
+  OFListConstIterator(OFString) it = ovkeys.begin();
+  OFListConstIterator(OFString) end = ovkeys.end();
+  while (it != end)
+  {
+    opt_overrideKeys.push_back(*it);
+    it++;
+  }
+}
+
+OFCondition DcmEncapsulatedDocument::saveFile(DcmFileFormat fileformat)
+{
+  return fileformat.saveFile(opt_ofname, opt_oxfer, opt_oenctype, opt_oglenc,
+                              opt_opadenc, OFstatic_cast(Uint32, opt_filepad),
+                              OFstatic_cast(Uint32, opt_itempad));
+}
+
+OFString DcmEncapsulatedDocument::getInputFileName()
+{
+  return opt_ifname;
+}
+
+void DcmEncapsulatedDocument::setInputFileName(OFString fName)
+{
+  opt_ifname= fName;
+}
+
+OFString DcmEncapsulatedDocument::getOutputFileName()
+{
+  return opt_ofname;
+}
+
+void DcmEncapsulatedDocument::setOutputFileName(OFString fName)
+{
+  opt_ofname = fName;
+}
+
+OFString DcmEncapsulatedDocument::getFileType()
+{
+  return ftype;
+}
+
+void DcmEncapsulatedDocument::setFileType(OFString fType)
+{
+  ftype = fType;
+}
+
+E_TransferSyntax DcmEncapsulatedDocument::getTransferSyntax()
+{
+  return opt_oxfer;
+}
+
+DcmEncapsulatedDocument::~DcmEncapsulatedDocument()
+{
+}
index 4cc2ef2af44326f80200da943249f8507b293258..c1f39d670bed1b3bb5413babe8697927669f0b60 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2016, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -757,7 +757,7 @@ OFCondition DcmFileFormat::readUntilTag(DcmInputStream &inStream,
                 {
                     if (dataset && dataset->transferState() != ERW_ready)
                     {
-                        errorFlag = dataset->readUntilTag(inStream, newxfer, glenc, maxReadLength,stopParsingAtElement);
+                        errorFlag = dataset->readUntilTag(inStream, newxfer, glenc, maxReadLength, stopParsingAtElement);
                     }
                 }
             }
index 20c7abee4a944dfe8d578f41e8fe67074f8c8770..49b385c92347b0a7c196450473d0510f16e24195 100644 (file)
@@ -167,18 +167,18 @@ int DcmItem::compare(const DcmItem& rhs) const
     myRhs =  OFconst_cast(DcmItem*, &rhs);
 
     // check length, i.e. number of elements in item
-    unsigned long thisVM = myThis->card();
-    unsigned long rhsVM = myRhs->card();
-    if (thisVM < rhsVM)
+    unsigned long thisNumValues = myThis->card();
+    unsigned long rhsNumValues = myRhs->card();
+    if (thisNumValues < rhsNumValues)
     {
         return -1;
     }
-    else if (thisVM > rhsVM)
+    else if (thisNumValues > rhsNumValues)
     {
         return 1;
     }
     // iterate over all items and test equality
-    for (unsigned long count = 0; count < thisVM; count++)
+    for (unsigned long count = 0; count < thisNumValues; count++)
     {
         DcmElement* val = myThis->getElement(count);
         if (val)
@@ -416,6 +416,13 @@ void DcmItem::checkAndUpdateVR(DcmItem &item,
             << tag.getTagName() << " " << tag << " to 'OB'");
         tag.setVR(EVR_OB);
     }
+    /* currently unhandled:
+     * - MappedPixelValue (0022,1452), US or SS
+     * - RedPaletteColorLookupTableDescriptor (0028,1101), US or SS
+     * - GreenPaletteColorLookupTableDescriptor (0028,1102), US or SS
+     * - BluePaletteColorLookupTableDescriptor (0028,1103), US or SS
+     * and some retired DICOM attributes as well as some DICONDE attributes
+     */
 }
 
 
@@ -434,8 +441,21 @@ unsigned long DcmItem::getVM()
 }
 
 
+unsigned long DcmItem::getNumberOfValues()
+{
+    return elementList->card();
+}
+
+
+unsigned long DcmItem::card() const
+{
+    return elementList->card();
+}
+
+
 // ********************************
 
+
 void DcmItem::print(STD_NAMESPACE ostream &out,
                     const size_t flags,
                     const int level,
@@ -1283,7 +1303,7 @@ OFCondition DcmItem::read(DcmInputStream & inStream,
                           const E_GrpLenEncoding glenc,
                           const Uint32 maxReadLength)
 {
-       return DcmItem::readUntilTag(inStream, xfer, glenc, maxReadLength, DCM_UndefinedTagKey);
+    return DcmItem::readUntilTag(inStream, xfer, glenc, maxReadLength, DCM_UndefinedTagKey);
 }
 
 OFCondition DcmItem::readUntilTag(DcmInputStream & inStream,
@@ -1694,15 +1714,6 @@ void DcmItem::transferEnd()
 // ********************************
 
 
-unsigned long DcmItem::card() const
-{
-    return elementList->card();
-}
-
-
-// ********************************
-
-
 OFCondition DcmItem::insert(DcmElement *elem,
                             OFBool replaceOld,
                             OFBool checkInsertOrder)
@@ -3413,7 +3424,10 @@ OFCondition DcmItem::putAndInsertUint16Array(const DcmTag& tag,
         case EVR_ox:
             /* special handling */
             if (tag == DCM_PixelData)
+            {
                 elem = new DcmPixelData(tag);
+                if (elem != NULL) elem->setVR(EVR_OW);
+            }
             else
                 elem = new DcmPolymorphOBOW(tag);
             break;
@@ -3938,6 +3952,16 @@ OFCondition DcmItem::insertEmptyElement(const DcmTag& tag,
         case EVR_UT:
             elem = new DcmUnlimitedText(tag);
             break;
+        case EVR_PixelData:
+            elem = new DcmPixelData(tag);
+            // set VR to OW to make sure that we never write/send the internal VR
+            if (elem) elem->setVR(EVR_OW);
+            break;
+        case EVR_OverlayData:
+            elem = new DcmOverlayData(tag);
+            // set VR to OW to make sure that we never write/send the internal VR
+            if (elem) elem->setVR(EVR_OW);
+            break;
         case EVR_UNKNOWN:
             /* Unknown VR, e.g. tag not found in data dictionary */
             status = EC_UnknownVR;
@@ -4433,6 +4457,22 @@ OFCondition DcmItem::newDicomElement(DcmElement *&newElement,
                 newElement = new DcmOtherByteOtherWord(tag, length);
             break;
 
+        // This case should only occur if we encounter an element with an invalid
+        // "Pi" VR. Make sure this does not cause problems later on
+        case EVR_PixelData :
+            newElement = new DcmPixelData(tag, length);
+            // set VR to OW to make sure that we never write/send the internal VR
+            if (newElement) newElement->setVR(EVR_OW);
+            break;
+
+        // This case should only occur if we encounter an element with an invalid
+        // "Ov" VR. Make sure this does not cause problems later on
+        case EVR_OverlayData :
+            newElement = new DcmOverlayData(tag, length);
+            // set VR to OW to make sure that we never write/send the internal VR
+            if (newElement) newElement->setVR(EVR_OW);
+            break;
+
         case EVR_lt :
             newElement = new DcmOtherByteOtherWord(tag, length);
             break;
@@ -4505,7 +4545,6 @@ OFCondition DcmItem::newDicomElement(DcmElement *&newElement,
         case EVR_UNKNOWN :
         case EVR_UNKNOWN2B :
         case EVR_UN :
-        default :
             if (length == DCM_UndefinedLength)
             {
                 // The attribute VR is UN with undefined length. Assume it is really
@@ -4525,6 +4564,21 @@ OFCondition DcmItem::newDicomElement(DcmElement *&newElement,
                 newElement = new DcmOtherByteOtherWord(tag, length);
             }
             break;
+
+        // these types should never occur
+        case EVR_item :
+        case EVR_metainfo :
+        case EVR_dataset :
+        case EVR_fileFormat :
+        case EVR_dicomDir :
+        case EVR_dirRecord :
+        case EVR_pixelSQ :
+        case EVR_pixelItem :
+            l_error = EC_IllegalCall;
+            break;
+
+        // we deliberately have no default clause to make sure a warning is raised
+        // when an DcmEVR enum is not explicitly handled here
     }
 
     /* check for valid element pointer */
index e736c9532d0567c19cb5f53bfc2a1b0a28475550..ebb103ef283fb362ee33d88108e091ec6ee72c31 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, OFFIS e.V.
+ *  Copyright (C) 2017-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -101,27 +101,36 @@ private:
     const char* const candidateDataEnd;
 };
 
-struct DcmAttributeMatching::DashSeparated
+DcmAttributeMatching::Range::Range( const void* const data, const size_t size, const char separator )
+: first( OFreinterpret_cast( const char* const, data ) )
+, firstSize( 0 )
+, second( first )
+, secondSize( size )
 {
-    DashSeparated( const void* data, const size_t size )
-    : first( OFreinterpret_cast( const char*, data ) )
-    , firstSize( 0 )
-    , second( first )
-    , secondSize( size )
+    while( firstSize != secondSize && separator != first[firstSize] )
+        ++firstSize;
+    if( firstSize != secondSize )
     {
-        while( firstSize != secondSize && first[firstSize] != '-' )
-            ++firstSize;
-        if( firstSize != secondSize )
-        {
-            secondSize = secondSize - firstSize - 1;
-            second = second + firstSize + 1;
-        }
+        secondSize = secondSize - firstSize - 1;
+        second = second + firstSize + 1;
     }
-    const char* first;
-    size_t firstSize;
-    const char* second;
-    size_t secondSize;
-};
+}
+
+OFBool DcmAttributeMatching::Range::isRange() const
+{
+    return first != second;
+}
+
+
+OFBool DcmAttributeMatching::Range::hasOpenBeginning() const
+{
+    return !firstSize;
+}
+
+OFBool DcmAttributeMatching::Range::hasOpenEnd() const
+{
+    return !secondSize;
+}
 
 OFBool DcmAttributeMatching::singleValueMatching( const void* queryData, const size_t querySize,
                                                   const void* candidateData, const size_t candidateSize )
@@ -144,6 +153,34 @@ OFBool DcmAttributeMatching::wildCardMatching( const void* queryData, const size
     );
 }
 
+OFBool DcmAttributeMatching::checkRangeQuery( OFBool (*check)(const char*,const size_t),
+                                              const void* queryData, const size_t querySize )
+{
+    const Range range( queryData, querySize );
+    if( !range.isRange() )
+        return check( range.first, range.firstSize );
+    return ( range.hasOpenBeginning() || check( range.first, range.firstSize ) ) &&
+        ( range.hasOpenEnd() || check( range.second, range.secondSize ) )
+    ;
+}
+
+template<typename T>
+OFBool DcmAttributeMatching::rangeMatchingTemplate( OFCondition (*parse)(const char*,const size_t,T&),
+                                                    const Range& query, const T& candidate )
+{
+    T first;
+    if( query.hasOpenBeginning() || parse( query.first, query.firstSize, first ).good() )
+    {
+        if( !query.isRange() )
+            return query.firstSize && first == candidate;
+        T second;
+        if( query.hasOpenEnd() || parse( query.second, query.secondSize, second ).good() )
+            return ( query.hasOpenBeginning() || first <= candidate )
+                && ( query.hasOpenEnd() || second >= candidate );
+    }
+    return OFFalse;
+}
+
 template<typename T>
 OFBool DcmAttributeMatching::rangeMatchingTemplate( OFCondition (*parse)(const char*,const size_t,T&),
                                                     const void* queryData, const size_t querySize,
@@ -154,18 +191,22 @@ OFBool DcmAttributeMatching::rangeMatchingTemplate( OFCondition (*parse)(const c
     T candidate;
     if( parse( OFreinterpret_cast( const char*, candidateData ), candidateSize, candidate ).bad() )
         return OFFalse;
-    const DashSeparated query( queryData, querySize );
-    T first;
-    if( !query.firstSize || parse( query.first, query.firstSize, first ).good() )
-    {
-        // test whether it's a single date/time and not a range
-        if( query.first == query.second )
-            return query.firstSize && first == candidate;
-        T second;
-        if( !query.secondSize || parse( query.second, query.secondSize, second ).good() )
-            return ( !query.firstSize || first <= candidate ) && ( !query.secondSize || second >= candidate );
-    }
-    return OFFalse;
+    return rangeMatchingTemplate( parse, Range( queryData, querySize ), candidate );
+}
+
+OFBool DcmAttributeMatching::isDateQuery( const void* queryData, const size_t querySize )
+{
+    return checkRangeQuery( &DcmDate::check, queryData, querySize );
+}
+
+OFBool DcmAttributeMatching::isTimeQuery( const void* queryData, const size_t querySize )
+{
+    return checkRangeQuery( &DcmTime::check, queryData, querySize );
+}
+
+OFBool DcmAttributeMatching::isDateTimeQuery( const void* queryData, const size_t querySize )
+{
+    return checkRangeQuery( &DcmDateTime::check, queryData, querySize );
 }
 
 OFBool DcmAttributeMatching::rangeMatchingDate( const void* queryData, const size_t querySize,
@@ -200,36 +241,43 @@ OFBool DcmAttributeMatching::rangeMatchingDateTime( const void* dateQueryData, c
         return OFFalse;
     if( timeCandidateSize && DcmTime::getOFTimeFromString( OFreinterpret_cast( const char*, timeCandidateData ), timeCandidateSize, candidate.Time ).bad() )
         return OFFalse;
-    const DashSeparated dateQuery( dateQueryData, dateQuerySize );
-    const DashSeparated timeQuery( timeQueryData, timeQuerySize );
+    const Range dateQuery( dateQueryData, dateQuerySize );
+    const Range timeQuery( timeQueryData, timeQuerySize );
     // check that both date/time ranges have the same structure
-    if( ( dateQuery.first != dateQuery.second ) != ( timeQuery.first != timeQuery.second ) )
-        return OFFalse;
-    if( ( !dateQuery.firstSize && timeQuery.firstSize ) || ( !dateQuery.secondSize && timeQuery.secondSize ) )
-        return OFFalse;
+    if
+    (
+        ( dateQuery.isRange() != timeQuery.isRange() )                    ||
+        ( dateQuery.hasOpenBeginning() && !timeQuery.hasOpenBeginning() ) ||
+        ( dateQuery.hasOpenEnd() && !timeQuery.hasOpenEnd() )
+    )
+    {
+        // fall back to individually matching them in case they don't
+        return rangeMatchingTemplate( &DcmDate::getOFDateFromString, dateQuery, candidate.getDate() )
+            && rangeMatchingTemplate( &DcmTime::getOFTimeFromString, timeQuery, candidate.getTime() );
+    }
     OFDateTime first;
     // parse the first date/time
-    if( dateQuery.firstSize )
+    if( !dateQuery.hasOpenBeginning() )
     {
         if( DcmDate::getOFDateFromString( dateQuery.first, dateQuery.firstSize, first.Date ).bad() )
             return OFFalse;
-        if( timeQuery.firstSize && DcmTime::getOFTimeFromString( timeQuery.first, timeQuery.firstSize, first.Time ).bad() )
+        if( !timeQuery.hasOpenBeginning() && DcmTime::getOFTimeFromString( timeQuery.first, timeQuery.firstSize, first.Time ).bad() )
             return OFFalse;
     }
-    // test whether it's a single date/time and not a range
-    if( dateQuery.first == dateQuery.second )
+    if( !dateQuery.isRange() )
         return dateQuery.firstSize && first == candidate;
     OFDateTime second;
     // parse the second date/time
-    if( dateQuery.secondSize )
+    if( !dateQuery.hasOpenEnd() )
     {
         if( DcmDate::getOFDateFromString( dateQuery.second, dateQuery.secondSize, second.Date ).bad() )
             return OFFalse;
-        if( timeQuery.secondSize && DcmTime::getOFTimeFromString( timeQuery.second, timeQuery.secondSize, second.Time ).bad() )
+        if( !timeQuery.hasOpenEnd() && DcmTime::getOFTimeFromString( timeQuery.second, timeQuery.secondSize, second.Time ).bad() )
             return OFFalse;
     }
     // compare candidate with the date/time range
-    return ( !dateQuery.firstSize || first <= candidate ) && ( !dateQuery.secondSize || second >= candidate );
+    return ( dateQuery.hasOpenBeginning() || first <= candidate )
+        && ( dateQuery.hasOpenEnd() || second >= candidate );
 }
 
 OFBool DcmAttributeMatching::listOfUIDMatching( const void* queryData, const size_t querySize,
index e211c05a686c62bf9b7a6ddda3716ed38821ff44..8d6b7a5b25c24da8ffcbc0bbff70f668d5d6b59d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2016, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -502,6 +502,8 @@ OFCondition DcmMetaInfo::read(DcmInputStream &inStream,
             {
                 errorFlag = EC_Normal;      // there is no meta header
                 Xfer = EXS_Unknown;
+                if (preambleUsed)           // ... but a preamble!
+                    DCMDATA_WARN("DcmMetaInfo: Found Preamble but no Meta Information Header");
             } else if (errorFlag == EC_ItemEnd)
                 errorFlag = EC_Normal;
             if (errorFlag.good())
index 828425619391856c414da621f081aaf0b645daad..ae8acfc775bc0d4a3625c5d4211120359d944d23 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2008-2017, OFFIS e.V.
+ *  Copyright (C) 2008-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -25,6 +25,9 @@
 #include "dcmtk/dcmdata/dcpath.h"
 #include "dcmtk/dcmdata/dcsequen.h"
 
+#define INCLUDE_CINTTYPES
+#include "dcmtk/ofstd/ofstdinc.h"
+
 
 /*******************************************************************/
 /*              Implementation of class DcmPath                    */
@@ -84,7 +87,7 @@ DcmPathNode* DcmPath::back()
   return m_path.back();
 }
 
-// Returns iterator to the end of path, ie. dummy after actual last element
+// Returns iterator to the end of path, i.e. dummy after actual last element
 OFListIterator(DcmPathNode*) DcmPath::end()
 {
   return m_path.end();
@@ -98,7 +101,7 @@ Uint32 DcmPath::size() const
 }
 
 
-// Returns true if path is empty, ie. number of path nodes is zero
+// Returns true if path is empty, i.e. number of path nodes is zero
 OFBool DcmPath::empty() const
 {
   return (m_path.size() == 0);
@@ -125,7 +128,9 @@ OFString DcmPath::toString() const
     }
     else if ( (vr == EVR_item) || (vr == EVR_dataset) )
     {
-#if SIZEOF_LONG == 8
+#ifdef PRIu32
+      sprintf(buf, "[%" PRIu32 "]", (*it)->m_itemNo);
+#elif SIZEOF_LONG == 8
       sprintf(buf, "[%u]", (*it)->m_itemNo);
 #else
       sprintf(buf, "[%lu]", (*it)->m_itemNo);
@@ -259,7 +264,7 @@ DcmPath::~DcmPath()
 }
 
 
-// Seperate a string path into the different nodes
+// Separate a string path into the different nodes
 OFCondition DcmPath::separatePathNodes(const OFString& path,
                                        OFList<OFString>& result)
 {
@@ -288,7 +293,9 @@ OFCondition DcmPath::separatePathNodes(const OFString& path,
         result.push_back("[*]");
       else
       {
-#if SIZEOF_LONG == 8
+#ifdef PRIu32
+        if (sprintf(buf, "[%" PRIu32 "]", itemNo) < 2) return EC_IllegalParameter;
+#elif SIZEOF_LONG == 8
         if (sprintf(buf, "[%u]", itemNo) < 2) return EC_IllegalParameter;
 #else
         if (sprintf(buf, "[%lu]", itemNo) < 2) return EC_IllegalParameter;
@@ -436,12 +443,12 @@ OFCondition DcmPathProcessor::findOrDeletePath(DcmObject* obj,
 }
 
 
-// Get results of a an operation started before (e. g. findOrCreatePath())
+// Get results of a an operation started before (e.g. findOrCreatePath())
 Uint32 DcmPathProcessor::getResults(OFList<DcmPath*>& searchResults)
 {
   if (m_results.size() > 0)
   {
-    // explicitely copy (shallow)
+    // explicitly copy (shallow)
     OFListIterator(DcmPath*) it = m_results.begin();
     while (it != m_results.end())
     {
@@ -632,7 +639,7 @@ OFCondition DcmPathProcessor::findOrCreateItemPath(DcmItem* item,
   {
     if (m_createIfNecessary)
     {
-      // private tags needs special handling, e. g. checking reservation
+      // private tags needs special handling, e.g. checking reservation
       if (tag.isPrivate() && m_checkPrivateReservations)
       {
         status = checkPrivateTagReservation(item, tag);
@@ -823,7 +830,7 @@ OFCondition DcmPathProcessor::findOrCreateSequencePath(DcmSequenceOfItems* seq,
   else
     return EC_TagNotFound;
 
-  // at this point, the item has been obtained and everyhthing is fine so far
+  // at this point, the item has been obtained and everything is fine so far
 
   // finding/creating the path was successful. now check whether there is more to do
   if (!restPath.empty())
index 7cdd37688e693d01a048f3a8da029388f370440b..57b767a26e6017a0d641e79d202d9190a033d28b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -187,8 +187,7 @@ DcmPixelData::calcElementLength(
     if (xferSyn.isEncapsulated() && (! writeUnencapsulated(xfer)))
     {
         DcmRepresentationListIterator found;
-        errorFlag =
-            findConformingEncapsulatedRepresentation(xfer, NULL, found);
+        errorFlag = findConformingEncapsulatedRepresentation(xfer, NULL, found);
         if (errorFlag == EC_Normal)
             elementLength = (*found)->pixSeq->calcElementLength(xfer, enctype);
     }
@@ -212,7 +211,7 @@ DcmPixelData::canChooseRepresentation(
     const DcmRepresentationEntry findEntry(repType, repParam, NULL);
     DcmRepresentationListIterator resultIt(repListEnd);
     // find out whether we have the desired target representation available. Three possibilities:
-    // 1. we have uncompressed data, and target is uncompressed (conversion betweeen uncompressed always possible)
+    // 1. we have uncompressed data, and target is uncompressed (conversion between uncompressed always possible)
     // 2. we have uncompressed and want compressed, but we are forced to write uncompressed anyway
     // 3. we want to go to compressed, and already have the desired representation available
     if ((!toType.isEncapsulated() && existUnencapsulated) ||
@@ -374,7 +373,7 @@ int DcmPixelData::compare(const DcmElement& rhs) const
         if (myPix->getItem(myPixItem, n).good() && rhsPix->getItem(rhsPixItem, n).good())
         {
           // compare them value by value, using DcmOtherByteOtherWord::compare() method
-          int result = myPixItem->compare(*rhsPixItem);
+          result = myPixItem->compare(*rhsPixItem);
           if (result != 0)
           {
             return result;
@@ -1214,7 +1213,7 @@ OFCondition DcmPixelData::getDecompressedColorModel(
     DcmItem *dataset,
     OFString &decompressedColorModel)
 {
-    OFCondition result = EC_IllegalCall;
+    OFCondition result = EC_IllegalParameter;
     if (dataset != NULL)
     {
       if (existUnencapsulated)
@@ -1222,7 +1221,21 @@ OFCondition DcmPixelData::getDecompressedColorModel(
         // we already have an uncompressed version of the pixel data either in memory or in file,
         // so just retrieve the color model from the given dataset
         result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, decompressedColorModel);
-      } else {
+        if (result == EC_TagNotFound)
+        {
+          DCMDATA_WARN("DcmPixelData: Mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation << " is missing");
+          result = EC_MissingAttribute;
+        }
+        else if (result.bad())
+        {
+          DCMDATA_WARN("DcmPixelData: Cannot retrieve value of element PhotometricInterpretation " << DCM_PhotometricInterpretation << ": " << result.text());
+        }
+        else if (decompressedColorModel.empty())
+        {
+          DCMDATA_WARN("DcmPixelData: No value for mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation);
+          result = EC_MissingValue;
+        }
+    } else {
         // we only have a compressed version of the pixel data.
         // Identify a codec for determining the color model.
         result = DcmCodecList::determineDecompressedColorModel(
index b823ffa144301ab378676362243e8fbd4bf3ba68..4e036f0394f0c6c07a57a2e35afa514262060d81 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -54,6 +54,13 @@ DcmPixelItem::DcmPixelItem(const DcmPixelItem &old)
 }
 
 
+DcmPixelItem &DcmPixelItem::operator=(const DcmPixelItem &obj)
+{
+  DcmOtherByteOtherWord::operator=(obj);
+  return *this;
+}
+
+
 OFCondition DcmPixelItem::copyFrom(const DcmObject &rhs)
 {
   if (this != &rhs)
index 503a5efe2119d646f0af9d8d435941b76480623d..11048b12d195e28794e7c221a4480e9d5981f5ca 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2002-2016, OFFIS e.V.
+ *  Copyright (C) 2002-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -182,6 +182,7 @@ OFCondition DcmRLECodecDecoder::decode(
               Uint32 byteOffset = 0;
 
               OFBool lastStripe = OFFalse;
+              OFBool lastStripeOfColor = OFFalse;
               Uint32 inputBytes = 0;
 
               // pointers for buffer copy operations
@@ -225,6 +226,9 @@ OFCondition DcmRLECodecDecoder::decode(
                   }
                 }
 
+                // something went wrong; most likely the byte offset in the RLE header is incorrect.
+                if (result.bad()) return EC_CannotChangeRepresentation;
+
                 // byteOffset now points to the first byte of the new RLE stripe
                 // check if the current stripe is the last one for this frame
                 if (i+1 == numberOfStripes) lastStripe = OFTrue; else lastStripe = OFFalse;
@@ -309,8 +313,17 @@ OFCondition DcmRLECodecDecoder::decode(
                   }
                 }
 
+                // copy the decoded stuff over to the buffer here...
                 // make sure the RLE decoder has produced the right amount of data
-                if (result.good() && (rledecoder.size() != bytesPerStripe))
+                lastStripeOfColor = lastStripe || ((imagePlanarConfiguration == 1) && ((i+1) % imageBytesAllocated == 0));
+
+                if (lastStripeOfColor && (rledecoder.size() < bytesPerStripe))
+                {
+                    // stripe ended prematurely? report a warning and continue
+                    DCMDATA_WARN("RLE decoder is finished but has produced insufficient data for this stripe, filling remaining pixels");
+                    result = EC_Normal;
+                }
+                else if (rledecoder.size() != bytesPerStripe)
                 {
                     DCMDATA_ERROR("RLE decoder is finished but has produced insufficient data for this stripe");
                     result = EC_CannotChangeRepresentation;
@@ -503,6 +516,7 @@ OFCondition DcmRLECodecDecoder::decodeFrame(
     Uint32 byteOffset = 0;
 
     OFBool lastStripe = OFFalse;
+    OFBool lastStripeOfColor = OFFalse;
     Uint32 inputBytes = 0;
 
     // pointers for buffer copy operations
@@ -569,14 +583,12 @@ OFCondition DcmRLECodecDecoder::decodeFrame(
 
         // copy the decoded stuff over to the buffer here...
         // make sure the RLE decoder has produced the right amount of data
-        if (lastStripe && (rledecoder.size() < bytesPerStripe))
+        lastStripeOfColor = lastStripe || ((imagePlanarConfiguration == 1) && ((i+1) % imageBytesAllocated == 0));
+        if (lastStripeOfColor && (rledecoder.size() < bytesPerStripe))
         {
-            // stream ended premature? report a warning and continue
-            if (result == EC_StreamNotifyClient)
-            {
-                DCMDATA_WARN("RLE decoder is finished but has produced insufficient data for this stripe, filling remaining pixels");
-                result = EC_Normal;
-            }
+            // stripe ended prematurely? report a warning and continue
+            DCMDATA_WARN("RLE decoder is finished but has produced insufficient data for this stripe, filling remaining pixels");
+            result = EC_Normal;
         }
         else if (rledecoder.size() != bytesPerStripe)
         {
@@ -682,11 +694,29 @@ OFCondition DcmRLECodecDecoder::determineDecompressedColorModel(
     DcmItem *dataset,
     OFString &decompressedColorModel) const
 {
-    OFCondition result = EC_InvalidTag;
-    if ((dataset != NULL ) && ((dataset->ident() == EVR_dataset) || (dataset->ident() == EVR_item)))
+    OFCondition result = EC_IllegalParameter;
+    if (dataset != NULL )
     {
-        // retrieve color model from given dataset
-        result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, decompressedColorModel);
+        if ((dataset->ident() == EVR_dataset) || (dataset->ident() == EVR_item))
+        {
+            // retrieve color model from given dataset
+            result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, decompressedColorModel);
+            if (result == EC_TagNotFound)
+            {
+                DCMDATA_WARN("DcmRLECodecDecoder: Mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation << " is missing");
+                result = EC_MissingAttribute;
+            }
+            else if (result.bad())
+            {
+                DCMDATA_WARN("DcmRLECodecDecoder: Cannot retrieve value of element PhotometricInterpretation " << DCM_PhotometricInterpretation << ": " << result.text());
+            }
+            else if (decompressedColorModel.empty())
+            {
+                DCMDATA_WARN("DcmRLECodecDecoder: No value for mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation);
+                result = EC_MissingValue;
+            }
+        } else
+            result = EC_CorruptedData;
     }
     return result;
 }
index a44f450444490d1f121cdfaac25332805f67b9de..942e7a7d7b0d8c4eb4ea74d8b44775c124d75540 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -205,19 +205,19 @@ int DcmSequenceOfItems::compare(const DcmElement& rhs) const
     myRhs = OFstatic_cast(DcmSequenceOfItems*, OFconst_cast(DcmElement*, &rhs));
 
     /* check number of items */
-    unsigned long rhsVM = myRhs->card();
-    unsigned long thisVM = myThis->card();
-    if (thisVM < rhsVM)
+    unsigned long rhsNumItems = myRhs->card();
+    unsigned long thisNumItems = myThis->card();
+    if (thisNumItems < rhsNumItems)
     {
         return -1;
     }
-    else if (thisVM > rhsVM)
+    else if (thisNumItems > rhsNumItems)
     {
         return 1;
     }
 
     /* iterate over all items and test equality */
-    for (unsigned long count = 0; count < thisVM; count++)
+    for (unsigned long count = 0; count < thisNumItems; count++)
     {
         DcmItem* val = myThis->getItem(count);
         if (val)
@@ -250,6 +250,24 @@ OFCondition DcmSequenceOfItems::checkValue(const OFString &cardinality,
 }
 
 
+unsigned long  DcmSequenceOfItems::getVM()
+{
+    return 1;
+}
+
+
+unsigned long DcmSequenceOfItems::getNumberOfValues()
+{
+    return itemList->card();
+}
+
+
+unsigned long DcmSequenceOfItems::card() const
+{
+    return itemList->card();
+}
+
+
 // ********************************
 
 
@@ -1003,15 +1021,6 @@ void DcmSequenceOfItems::transferEnd()
 // ********************************
 
 
-unsigned long DcmSequenceOfItems::card() const
-{
-    return itemList->card();
-}
-
-
-// ********************************
-
-
 OFCondition DcmSequenceOfItems::prepend(DcmItem *item)
 {
     errorFlag = EC_Normal;
index 56e57c7678bb00aaf1bc18c87ec49ae3b220463d..3a4692a71bb8f776433e3b57e538c6fcdf8a3352 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2011, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -24,6 +24,7 @@
 #include "dcmtk/dcmdata/dcerror.h"    /* for dcmdata error constants */
 #include "dcmtk/dcmdata/dcdict.h"
 #include "dcmtk/dcmdata/dcdicent.h"
+#include "dcmtk/ofstd/ofstd.h"
 
 #define INCLUDE_CSTDIO
 #define INCLUDE_CSTRING
@@ -129,7 +130,7 @@ void DcmTag::lookupVRinDictionary()
         vr = dictRef->getVR();
         errorFlag = EC_Normal;
     }
-    dcmDataDict.unlock();
+    dcmDataDict.rdunlock();
 }
 
 // ********************************
@@ -162,7 +163,7 @@ const char *DcmTag::getTagName()
     if (newTagName == NULL)
         newTagName = DcmTag_ERROR_TagName;
     updateTagName(newTagName);
-    dcmDataDict.unlock();
+    dcmDataDict.rdunlock();
 
     if (tagName)
         return tagName;
@@ -222,7 +223,7 @@ OFCondition DcmTag::findTagFromName(const char *name, DcmTag &value)
             }
             else
                 result = EC_TagNotFound;
-            dcmDataDict.unlock();
+            dcmDataDict.rdunlock();
         }
     }
     return result;
@@ -248,9 +249,10 @@ void DcmTag::updateTagName(const char *c)
     delete[] tagName;
     if (c)
     {
-        tagName = new char[strlen(c) + 1];
+        size_t buflen = strlen(c) + 1;
+        tagName = new char[buflen];
         if (tagName)
-            strcpy(tagName, c);
+            OFStandard::strlcpy(tagName, c, buflen);
     } else
         tagName = NULL;
 }
@@ -260,9 +262,10 @@ void DcmTag::updatePrivateCreator(const char *c)
     delete[] privateCreator;
     if (c)
     {
-        privateCreator = new char[strlen(c) + 1];
+        size_t buflen = strlen(c) + 1;
+        privateCreator = new char[buflen];
         if (privateCreator)
-            strcpy(privateCreator, c);
+            OFStandard::strlcpy(privateCreator, c, buflen);
     } else
         privateCreator = NULL;
 }
index 28492e6ab49f67e95b9406e5ec1e12ff17cbd026..a9090cf74c9ad8ec346a0f4eb8470e8d5ee11837 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 #include "dcmtk/dcmdata/dctagkey.h"
+#include "dcmtk/ofstd/ofstd.h"
 
 #define INCLUDE_CSTDIO
 #define INCLUDE_CSTRING
@@ -49,7 +50,7 @@ OFString DcmTagKey::toString() const
 
     if (group == 0xffff && element == 0xffff)
     {
-        strcpy(tagBuf, "(\?\?\?\?,\?\?\?\?)"); // prevent trigraph expansion in string constant
+        OFStandard::strlcpy(tagBuf, "(\?\?\?\?,\?\?\?\?)", 16); // prevent trigraph expansion in string constant
     } else {
         sprintf(tagBuf, "(%04x,%04x)", OFstatic_cast(unsigned, group), OFstatic_cast(unsigned, element));
     }
index 06fb7de72919fea23ad69cec590b47bc14df41b3..a9026d7390b6f682e58d2d5bf29add1c52a3f1f7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -69,6 +69,10 @@ BEGIN_EXTERN_C
 #endif
 #endif
 
+#ifdef __MINGW32__
+#include <winerror.h> /* needed for NO_ERROR constant on MinGW */
+#endif
+
 END_EXTERN_C
 
 #include "dcmtk/ofstd/ofstream.h"
@@ -175,6 +179,7 @@ static const UIDNameMap uidNameMap[] = {
     { UID_DigitalXRayImageStorageForProcessing,                "DigitalXRayImageStorageForProcessing" },
     { UID_EncapsulatedCDAStorage,                              "EncapsulatedCDAStorage" },
     { UID_EncapsulatedPDFStorage,                              "EncapsulatedPDFStorage" },
+    { UID_EncapsulatedSTLStorage,                              "EncapsulatedSTLStorage" },
     { UID_EnhancedCTImageStorage,                              "EnhancedCTImageStorage" },
     { UID_EnhancedMRColorImageStorage,                         "EnhancedMRColorImageStorage" },
     { UID_EnhancedMRImageStorage,                              "EnhancedMRImageStorage" },
@@ -290,7 +295,7 @@ static const UIDNameMap uidNameMap[] = {
     { UID_RETIRED_UltrasoundImageStorage,                      "RETIRED_UltrasoundImageStorage" },
     { UID_RETIRED_UltrasoundMultiframeImageStorage,            "RETIRED_UltrasoundMultiframeImageStorage" },
     { UID_RETIRED_VLImageStorage,                              "RETIRED_VLImageStorage" },
-    { UID_RETIRED_VLMultiFrameImageStorage,                    "RETIRED_VLMultiFrameImageStorage" },
+    { UID_RETIRED_VLMultiframeImageStorage,                    "RETIRED_VLMultiframeImageStorage" },
     { UID_RETIRED_XRayAngiographicBiPlaneImageStorage,         "RETIRED_XRayAngiographicBiPlaneImageStorage" },
     // Storage (DICOS)
     { UID_DICOS_CTImageStorage,                                "DICOS_CTImageStorage" },
@@ -601,6 +606,7 @@ const char* dcmAllStorageSOPClassUIDs[] = {
     UID_DigitalXRayImageStorageForProcessing,
     UID_EncapsulatedCDAStorage,
     UID_EncapsulatedPDFStorage,
+    UID_EncapsulatedSTLStorage,
     UID_EnhancedCTImageStorage,
     UID_EnhancedMRColorImageStorage,
     UID_EnhancedMRImageStorage,
@@ -712,7 +718,7 @@ const char* dcmAllStorageSOPClassUIDs[] = {
     UID_RETIRED_UltrasoundImageStorage,
     UID_RETIRED_UltrasoundMultiframeImageStorage,
     UID_RETIRED_VLImageStorage,
-    UID_RETIRED_VLMultiFrameImageStorage,
+    UID_RETIRED_VLMultiframeImageStorage,
     UID_RETIRED_XRayAngiographicBiPlaneImageStorage,
     // draft
     UID_DRAFT_SRAudioStorage,
@@ -879,6 +885,7 @@ const char* dcmLongSCUStorageSOPClassUIDs[] = {
 //  UID_ContentAssessmentResultsStorage,
 //  UID_CornealTopographyMapStorage,
 //  UID_CTPerformedProcedureProtocolStorage,
+//  UID_EncapsulatedSTLStorage,
 //  UID_ExtensibleSRStorage,
 //  UID_GrayscalePlanarMPRVolumetricPresentationStateStorage
 //  UID_MultipleVolumeRenderingVolumetricPresentationStateStorage,
@@ -915,7 +922,7 @@ const char* dcmLongSCUStorageSOPClassUIDs[] = {
     UID_RETIRED_UltrasoundImageStorage,
     UID_RETIRED_UltrasoundMultiframeImageStorage,
     UID_RETIRED_VLImageStorage,
-    UID_RETIRED_VLMultiFrameImageStorage,
+    UID_RETIRED_VLMultiframeImageStorage,
     UID_RETIRED_XRayAngiographicBiPlaneImageStorage,
     // draft
 //  UID_DRAFT_RTBeamsDeliveryInstructionStorage,
@@ -1104,7 +1111,7 @@ const char* dcmImageSOPClassUIDs[] = {
     UID_RETIRED_UltrasoundImageStorage,
     UID_RETIRED_UltrasoundMultiframeImageStorage,
     UID_RETIRED_VLImageStorage,
-    UID_RETIRED_VLMultiFrameImageStorage,
+    UID_RETIRED_VLMultiframeImageStorage,
     UID_RETIRED_XRayAngiographicBiPlaneImageStorage,
     // DICOS
     UID_DICOS_CTImageStorage,
@@ -1169,6 +1176,7 @@ static const DcmModalityTable modalities[] = {
     { UID_DigitalXRayImageStorageForProcessing,                    "DP",  2048 * 2048 * 2 },
     { UID_EncapsulatedCDAStorage,                                  "CDA", 4096 },
     { UID_EncapsulatedPDFStorage,                                  "PDF", 1024 * 1024 },
+    { UID_EncapsulatedSTLStorage,                                  "STL", 4096 },
     { UID_EnhancedCTImageStorage,                                  "CTe", 256 * 512 * 512 },
     { UID_EnhancedMRColorImageStorage,                             "MRc", 256 * 512 * 512 * 3 },
     { UID_EnhancedMRImageStorage,                                  "MRe", 256 * 512 * 512 },
@@ -1283,7 +1291,7 @@ static const DcmModalityTable modalities[] = {
     { UID_RETIRED_UltrasoundImageStorage,                          "USr", 512 * 512 },
     { UID_RETIRED_UltrasoundMultiframeImageStorage,                "USf", 512 * 512 },
     { UID_RETIRED_VLImageStorage,                                  "VLr", 768 * 576 * 3 },
-    { UID_RETIRED_VLMultiFrameImageStorage,                        "VMr", 768 * 576 * 3 },
+    { UID_RETIRED_VLMultiframeImageStorage,                        "VMr", 768 * 576 * 3 },
     { UID_RETIRED_XRayAngiographicBiPlaneImageStorage,             "XB",  512 * 512 * 2 },
     // draft
     { UID_DRAFT_RTBeamsDeliveryInstructionStorage,                 "RBd", 4096 },
index 1c9e4ca5ad6092acf0f759754381bc7c5a8bf0c3..910135ea234a49fe7ecbfc727de606fcda4f02b0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -223,9 +223,13 @@ DcmVR::setVR(const char* vrName)
     {
         int found = OFFalse;
         int i = 0;
-        for (i = 0;  (!found && (i < DcmVRDict_DIM)); i++)
+        for (i = 0; (!found && (i < DcmVRDict_DIM)); i++)
         {
-            if (strncmp(vrName, DcmVRDict[i].vrName, 2) == 0)
+            /* We only compare the first two characters of the passed string and
+             * never accept a VR that is labeled for internal use only.
+             */
+            if ((strncmp(vrName, DcmVRDict[i].vrName, 2) == 0) &&
+                !(DcmVRDict[i].propertyFlags & DCMVR_PROP_INTERNAL))
             {
                 found = OFTrue;
                 vr = DcmVRDict[i].vr;
index c5c7437c08ab85bb47358e4c14c6bca910f3bf06..428f9a59173b9117734711bfe86a9494b542eaf5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -76,20 +76,20 @@ int DcmAttributeTag::compare(const DcmElement& rhs) const
     myThis = OFconst_cast(DcmAttributeTag*, this);
     myRhs = OFstatic_cast(DcmAttributeTag*, OFconst_cast(DcmElement*, &rhs));
 
-    /* compare VMs  */
-    unsigned long thisVM = myThis->getVM();
-    unsigned long rhsVM = myRhs->getVM();
-    if (thisVM < rhsVM)
+    /* compare number of values */
+    unsigned long thisNumValues = myThis->getNumberOfValues();
+    unsigned long rhsNumValues = myRhs->getNumberOfValues();
+    if (thisNumValues < rhsNumValues)
     {
         return -1;
     }
-    else if (thisVM > rhsVM)
+    else if (thisNumValues > rhsNumValues)
     {
         return 1;
     }
 
     /* iterate over all components and test equality */
-    for (unsigned long count = 0; count < thisVM; count++)
+    for (unsigned long count = 0; count < thisNumValues; count++)
     {
         DcmTagKey val;
         if (myThis->getTagVal(val, count).good())
@@ -144,6 +144,12 @@ OFCondition DcmAttributeTag::checkValue(const OFString &vm,
 
 
 unsigned long DcmAttributeTag::getVM()
+{
+    return getNumberOfValues();
+}
+
+
+unsigned long DcmAttributeTag::getNumberOfValues()
 {
     /* attribute tags store pairs of 16 bit values */
     return OFstatic_cast(unsigned long, getLengthField() / (2 * sizeof(Uint16)));
@@ -164,7 +170,7 @@ void DcmAttributeTag::print(STD_NAMESPACE ostream& out,
         /* get unsigned integer data */
         Uint16 *uintVals;
         errorFlag = getUint16Array(uintVals);
-        const unsigned long count = getVM();
+        const unsigned long count = getNumberOfValues();
         if ((uintVals != NULL) && (count > 0))
         {
             /* determine number of values to be printed */
index be4bc11869677bf2eff7ecc57902c3bda7bb8c01..e64443a2d9752df721474c9a58299c88123f85d1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -295,6 +295,27 @@ OFCondition DcmDate::getISOFormattedDateFromString(const OFString &dicomDate,
 
 // ********************************
 
+OFBool DcmDate::check(const char* dicomDate,
+                      const size_t dicomDateSize)
+{
+    return check(dicomDate, dicomDateSize, OFFalse);
+}
+
+OFBool DcmDate::check(const char* dicomDate,
+                      const size_t dicomDateSize,
+                      const OFBool supportOldFormat)
+{
+    switch (DcmElement::scanValue("da", dicomDate, dicomDateSize))
+    {
+    case  2 /* DA */:
+    case 17 /* dubious DA (pre 1850 or post 2049) */:
+        return OFTrue;
+    case  3 /* old style DA */:
+        return supportOldFormat;
+    default:
+        return OFFalse;
+    }
+}
 
 OFCondition DcmDate::checkStringValue(const OFString &value,
                                       const OFString &vm,
@@ -316,8 +337,7 @@ OFCondition DcmDate::checkStringValue(const OFString &value,
             if (dcmEnableVRCheckerForStringValues.get())
             {
                 /* check value representation */
-                const int vrID = DcmElement::scanValue(value, "da", posStart, length);
-                if ((vrID != 2) && (!oldFormat || (vrID != 3)) && (vrID != 17))
+                if (!check(value.data() + posStart, length, oldFormat))
                 {
                     result = EC_ValueRepresentationViolated;
                     break;
index 43c1e0ec1428e7fd1321e39ba76ef82ced2ff1a2..f0088c31238dccd020d980574c96efbba93b0e37 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -358,6 +358,13 @@ OFCondition DcmDateTime::getISOFormattedDateTimeFromString(const OFString &dicom
 // ********************************
 
 
+OFBool DcmDateTime::check(const char* dicomDateTime,
+                               const size_t dicomDateTimeSize)
+{
+    const int vrID = DcmElement::scanValue("dt", dicomDateTime, dicomDateTimeSize);
+    return vrID == 7 /* DT */ || vrID == 18 /* dubious DT (pre 1850 or post 2049) */;
+}
+
 OFCondition DcmDateTime::checkStringValue(const OFString &value,
                                           const OFString &vm)
 {
@@ -383,8 +390,7 @@ OFCondition DcmDateTime::checkStringValue(const OFString &value,
             else if (dcmEnableVRCheckerForStringValues.get())
             {
                 /* check value representation */
-                const int vrID = DcmElement::scanValue(value, "dt", posStart, length);
-                if ((vrID != 7) && (vrID != 18))
+                if (!check(value.data() + posStart, length))
                 {
                     result = EC_ValueRepresentationViolated;
                     break;
index 0cfc51d3e48f8e8b18c9bb9ec167cac56b623265..27f2a73762d1438af0c2f6577dbad796688a7972 100644 (file)
@@ -77,20 +77,20 @@ int DcmFloatingPointDouble::compare(const DcmElement& rhs) const
     myThis = OFconst_cast(DcmFloatingPointDouble*, this);
     myRhs = OFstatic_cast(DcmFloatingPointDouble*, OFconst_cast(DcmElement*, &rhs));
 
-    /* check whether VMs are equal */
-    unsigned long thisVM = myThis->getVM();
-    unsigned long rhsVM = myRhs->getVM();
-    if (thisVM < rhsVM)
+    /* compare number of values */
+    unsigned long thisNumValues = myThis->getNumberOfValues();
+    unsigned long rhsNumValues = myRhs->getNumberOfValues();
+    if (thisNumValues < rhsNumValues)
     {
         return -1;
     }
-    else if (thisVM > rhsVM)
+    else if (thisNumValues > rhsNumValues)
     {
         return 1;
     }
 
     /* iterate over all components and test equality */
-    for (unsigned long count = 0; count < thisVM; count++)
+    for (unsigned long count = 0; count < thisNumValues; count++)
     {
         Float64 val = 0;
         if (myThis->getFloat64(val, count).good())
@@ -145,7 +145,13 @@ OFCondition DcmFloatingPointDouble::checkValue(const OFString &vm,
 
 unsigned long DcmFloatingPointDouble::getVM()
 {
-    return getLengthField() / OFstatic_cast(unsigned long, sizeof(Float64));
+    return getNumberOfValues();
+}
+
+
+unsigned long DcmFloatingPointDouble::getNumberOfValues()
+{
+    return OFstatic_cast(unsigned long, getLengthField() / sizeof(Float64));
 }
 
 
@@ -165,8 +171,8 @@ void DcmFloatingPointDouble::print(STD_NAMESPACE ostream&out,
         errorFlag = getFloat64Array(doubleVals);
         if (doubleVals != NULL)
         {
-            /* do not simply use getVM() because derived classes might always return 1 */
-            const unsigned long count = getLengthField() / OFstatic_cast(unsigned long, sizeof(Float64));
+            /* do not use getVM() because derived classes might always return 1 */
+            const unsigned long count = getNumberOfValues();
             /* double-check length field for valid value */
             if (count > 0)
             {
@@ -231,8 +237,8 @@ OFCondition DcmFloatingPointDouble::getFloat64(Float64 &doubleVal,
     {
         if (doubleValues == NULL)
             errorFlag = EC_IllegalCall;
-        /* do not simply use getVM() because derived classes might always return 1 */
-        else if (pos >= getLengthField() / sizeof(Float64))
+        /* do not use getVM() because derived classes might always return 1 */
+        else if (pos >= getNumberOfValues())
             errorFlag = EC_IllegalParameter;
         else
             doubleVal = doubleValues[pos];
index c62086efd93d47c06deb1879fd032736f38bbaa5..473af41212466c4cd79296d77b68112cda27b8bd 100644 (file)
@@ -78,20 +78,20 @@ int DcmFloatingPointSingle::compare(const DcmElement& rhs) const
     myThis = OFconst_cast(DcmFloatingPointSingle*, this);
     myRhs = OFstatic_cast(DcmFloatingPointSingle*, OFconst_cast(DcmElement*, &rhs));
 
-    /* check whether VMs are equal */
-    unsigned long thisVM = myThis->getVM();
-    unsigned long rhsVM = myRhs->getVM();
-    if (thisVM < rhsVM)
+    /* compare number of values */
+    unsigned long thisNumValues = myThis->getNumberOfValues();
+    unsigned long rhsNumValues = myRhs->getNumberOfValues();
+    if (thisNumValues < rhsNumValues)
     {
         return -1;
     }
-    else if (thisVM > rhsVM)
+    else if (thisNumValues > rhsNumValues)
     {
         return 1;
     }
 
     // iterate over all components and test equality */
-    for (unsigned long count = 0; count < thisVM; count++)
+    for (unsigned long count = 0; count < thisNumValues; count++)
     {
         Float32 val = 0;
         if (myThis->getFloat32(val, count).good())
@@ -147,7 +147,13 @@ OFCondition DcmFloatingPointSingle::checkValue(const OFString &vm,
 
 unsigned long DcmFloatingPointSingle::getVM()
 {
-    return getLengthField() / OFstatic_cast(unsigned long, sizeof(Float32));
+    return getNumberOfValues();
+}
+
+
+unsigned long DcmFloatingPointSingle::getNumberOfValues()
+{
+    return OFstatic_cast(unsigned long, getLengthField() / sizeof(Float32));
 }
 
 
@@ -167,8 +173,8 @@ void DcmFloatingPointSingle::print(STD_NAMESPACE ostream&out,
         errorFlag = getFloat32Array(floatVals);
         if (floatVals != NULL)
         {
-            /* do not simply use getVM() because derived classes might always return 1 */
-            const unsigned long count = getLengthField() / OFstatic_cast(unsigned long, sizeof(Float32));
+            /* do not use getVM() because derived classes might always return 1 */
+            const unsigned long count = getNumberOfValues();
             /* double-check length field for valid value */
             if (count > 0)
             {
@@ -233,8 +239,8 @@ OFCondition DcmFloatingPointSingle::getFloat32(Float32 &floatVal,
     {
         if (floatValues == NULL)
             errorFlag = EC_IllegalCall;
-        /* do not simply use getVM() because derived classes might always return 1 */
-        else if (pos >= getLengthField() / sizeof(Float32))
+        /* do not use getVM() because derived classes might always return 1 */
+        else if (pos >= getNumberOfValues())
             errorFlag = EC_IllegalParameter;
         else
             floatVal = floatValues[pos];
index 8d72d21e2e20991dc527dab496eef6f74c20790f..876bbe3d7865ffaa65c63fbbfbf805d6e8565a4f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2016, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -26,6 +26,7 @@
 #include "dcmtk/ofstd/ofstring.h"
 
 #define INCLUDE_CSTDIO
+#define INCLUDE_CINTTYPES
 #include "dcmtk/ofstd/ofstdinc.h"
 
 
@@ -106,7 +107,9 @@ OFCondition DcmIntegerString::getSint32(Sint32 &sintVal,
     if (l_error.good())
     {
         /* convert string to integer value */
-#if SIZEOF_LONG == 8
+#ifdef SCNd32
+        if (sscanf(str.c_str(), "%" SCNd32, &sintVal) != 1)
+#elif SIZEOF_LONG == 8
         if (sscanf(str.c_str(), "%d", &sintVal) != 1)
 #else
         if (sscanf(str.c_str(), "%ld", &sintVal) != 1)
index da8f71d78ae23478aa3cf344a1584b382c5fe7f1..6ce7996bba4bbe345d64eeb92f058bb5247adf47 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -56,12 +56,46 @@ DcmLongText &DcmLongText::operator=(const DcmLongText &obj)
 
 OFCondition DcmLongText::copyFrom(const DcmObject& rhs)
 {
-  if (this != &rhs)
-  {
-    if (rhs.ident() != ident()) return EC_IllegalCall;
-    *this = OFstatic_cast(const DcmLongText &, rhs);
-  }
-  return EC_Normal;
+    if (this != &rhs)
+    {
+        if (rhs.ident() != ident()) return EC_IllegalCall;
+        *this = OFstatic_cast(const DcmLongText &, rhs);
+    }
+    return EC_Normal;
+}
+
+
+int DcmLongText::compare(const DcmElement& rhs) const
+{
+    int result = DcmElement::compare(rhs);
+    if (result != 0)
+    {
+        return result;
+    }
+
+    /* cast away constness (dcmdata is not const correct...) */
+    DcmLongText* myThis = NULL;
+    DcmLongText* myRhs = NULL;
+    myThis = OFconst_cast(DcmLongText*, this);
+    myRhs = OFstatic_cast(DcmLongText*, OFconst_cast(DcmElement*, &rhs));
+
+    /* compare length */
+    unsigned long thisLength = myThis->getLength();
+    unsigned long rhsLength = myRhs->getLength();
+    if (thisLength < rhsLength)
+    {
+        return -1;
+    }
+    else if (thisLength > rhsLength)
+    {
+        return 1;
+    }
+
+    /* check whether values are equal */
+    OFString thisValue, rhsValue;
+    myThis->getOFStringArray(thisValue);
+    myThis->getOFStringArray(rhsValue);
+    return thisValue.compare(rhsValue);
 }
 
 
index b9ed6b2b47e54541ea09c92ad40d45f8afff5231..c65764a8662e86ce9dd9902df41c61280f3e4b77 100644 (file)
@@ -90,7 +90,7 @@ int DcmOtherByteOtherWord::compare(const DcmElement& rhs) const
     myThis = OFconst_cast(DcmOtherByteOtherWord*, this);
     myRhs =  OFstatic_cast(DcmOtherByteOtherWord*, OFconst_cast(DcmElement*, &rhs));
 
-    /* check equality of length */
+    /* compare length */
     unsigned long thisLength = myThis->getLength();
     unsigned long rhsLength= myRhs->getLength();
     if (thisLength < rhsLength)
@@ -144,6 +144,17 @@ unsigned long DcmOtherByteOtherWord::getVM()
 }
 
 
+unsigned long DcmOtherByteOtherWord::getNumberOfValues()
+{
+    const DcmEVR evr = getTag().getEVR();
+    unsigned long result = OFstatic_cast(unsigned long, getLengthField());
+    /* check whether values are stored as 16 bit */
+    if ((evr == EVR_OW) || (evr == EVR_lt))
+        result /= 2;
+    return result;
+}
+
+
 OFCondition DcmOtherByteOtherWord::setVR(DcmEVR vr)
 {
     setTagVR(vr);
@@ -173,7 +184,7 @@ void DcmOtherByteOtherWord::print(STD_NAMESPACE ostream&out,
         /* check data */
         if ((wordValues != NULL) || (byteValues != NULL))
         {
-            const unsigned long count = (evr == EVR_OW || evr == EVR_lt) ? (getLengthField() / 2) : getLengthField();
+            const unsigned long count = getNumberOfValues();
             /* double-check length field for valid value */
             if (count > 0)
             {
@@ -224,7 +235,7 @@ void DcmOtherByteOtherWord::print(STD_NAMESPACE ostream&out,
 }
 
 
-void DcmOtherByteOtherWord::printPixel(STD_NAMESPACE ostream&out,
+void DcmOtherByteOtherWord::printPixel(STD_NAMESPACE ostream &out,
                                        const size_t flags,
                                        const int level,
                                        const char *pixelFileName,
@@ -262,13 +273,19 @@ void DcmOtherByteOtherWord::printPixel(STD_NAMESPACE ostream&out,
                     {
                         swapIfNecessary(EBO_LittleEndian, gLocalByteOrder, data, getLengthField(), sizeof(Uint16));
                         setByteOrder(EBO_LittleEndian);
-                        fwrite(data, sizeof(Uint16), OFstatic_cast(size_t, getLengthField() / sizeof(Uint16)), file);
+                        const size_t count = OFstatic_cast(size_t, getLengthField() / sizeof(Uint16));
+                        if (fwrite(data, sizeof(Uint16), count, file) != count)
+                            DCMDATA_WARN("DcmOtherByteOtherWord: Can't write pixel data to output file: " << fname);
                     }
                 } else {
                     Uint8 *data = NULL;
                     getUint8Array(data);
                     if (data != NULL)
-                        fwrite(data, sizeof(Uint8), OFstatic_cast(size_t, getLengthField()), file);
+                    {
+                        const size_t count = OFstatic_cast(size_t, getLengthField());
+                        if (fwrite(data, sizeof(Uint8), count, file) != count)
+                            DCMDATA_WARN("DcmOtherByteOtherWord: Can't write pixel data to output file: " << fname);
+                    }
                 }
                 fclose(file);
             } else {
index 94ed168b5f40a21f8ff60292343355e5caf723dc..6fe47b4fa8c2f51f013d651ffa51f2dabbcc77bf 100644 (file)
@@ -133,8 +133,7 @@ OFCondition DcmOtherDouble::writeXML(STD_NAMESPACE ostream &out,
             /* get and check 64 bit float data */
             if (getFloat64Array(floatValues).good() && (floatValues != NULL))
             {
-                /* we cannot use getVM() since it always returns 1 */
-                const size_t count = getLengthField() / sizeof(Float64);
+                const size_t count = getNumberOfValues();
                 /* count can be zero if we have an invalid element with less than eight bytes length */
                 if (count > 0)
                 {
index a9d128dbb8d38bb34f5ff2ab854fadc376df5d7a..b29ddb2a363321b5be1e4c9e5fe7eaf6af707274 100644 (file)
@@ -133,8 +133,7 @@ OFCondition DcmOtherFloat::writeXML(STD_NAMESPACE ostream &out,
             /* get and check 32 bit float data */
             if (getFloat32Array(floatValues).good() && (floatValues != NULL))
             {
-                /* we cannot use getVM() since it always returns 1 */
-                const size_t count = getLengthField() / sizeof(Float32);
+                const size_t count = getNumberOfValues();
                 /* count can be zero if we have an invalid element with less than four bytes length */
                 if (count > 0)
                 {
index f25b606020b763e07be961b852bda7e737c1e4ce..8d3b43ae2b75acc365c989465ab6ee5f1b2ea603 100644 (file)
@@ -139,8 +139,7 @@ OFCondition DcmOtherLong::writeXML(STD_NAMESPACE ostream &out,
             /* get and check 32 bit data */
             if (getUint32Array(uintVals).good() && (uintVals != NULL))
             {
-                /* we cannot use getVM() since it always returns 1 */
-                const size_t count = getLengthField() / sizeof(Uint32);
+                const size_t count = getNumberOfValues();
                 /* count can be zero if we have an invalid element with less than four bytes length */
                 if (count > 0)
                 {
index 1af885d04ef880326c0e67bd219ef70cacd88dea..9d99a90b8ae6e128f37d1beb7bf7b82e21d72018 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -60,40 +60,40 @@ DcmPolymorphOBOW &DcmPolymorphOBOW::operator=(const DcmPolymorphOBOW & obj)
 
 int DcmPolymorphOBOW::compare(const DcmElement& rhs) const
 {
-  /* check tag and VR */
-  int result = DcmElement::compare(rhs);
-  if (result != 0)
-  {
-    return result;
-  }
+    /* check tag and VR */
+    int result = DcmElement::compare(rhs);
+    if (result != 0)
+    {
+        return result;
+    }
 
-  /* cast away constness (dcmdata is not const correct...) */
-  DcmPolymorphOBOW* myThis = NULL;
-  DcmPolymorphOBOW* myRhs = NULL;
-  myThis = OFconst_cast(DcmPolymorphOBOW*, this);
-  myRhs =  OFstatic_cast(DcmPolymorphOBOW*, OFconst_cast(DcmElement*, &rhs));
-
-  /* check whether length is the same */
-  Uint32 myLength = myThis->getLength();
-  Uint32 rhsLength = myRhs->getLength();
-  if (myLength < rhsLength)
-    return -1;
-  else if (myLength > rhsLength)
-    return 1;
-  /* finally check whether values are the same */
-  else
-  {
-    // Get values, always compare in Little Endian byte order (only relevant for OW)
-    void* myValue = myThis->getValue(EBO_LittleEndian);
-    void* rhsValue = myRhs->getValue(EBO_LittleEndian);
-    int result = memcmp(myValue, rhsValue, myLength);
-    if (result < 0)
-      return -1;
-    else if (result > 0)
-      return 1;
+    /* cast away constness (dcmdata is not const correct...) */
+    DcmPolymorphOBOW* myThis = NULL;
+    DcmPolymorphOBOW* myRhs = NULL;
+    myThis = OFconst_cast(DcmPolymorphOBOW*, this);
+    myRhs =  OFstatic_cast(DcmPolymorphOBOW*, OFconst_cast(DcmElement*, &rhs));
+
+    /* compare length */
+    Uint32 myLength = myThis->getLength();
+    Uint32 rhsLength = myRhs->getLength();
+    if (myLength < rhsLength)
+        return -1;
+    else if (myLength > rhsLength)
+        return 1;
+      /* finally check whether values are the same */
     else
-      return 0;
-  }
+    {
+        // Get values, always compare in Little Endian byte order (only relevant for OW)
+        void* myValue = myThis->getValue(EBO_LittleEndian);
+        void* rhsValue = myRhs->getValue(EBO_LittleEndian);
+        result = memcmp(myValue, rhsValue, myLength);
+        if (result < 0)
+            return -1;
+        else if (result > 0)
+            return 1;
+        else
+            return 0;
+    }
   /* we never get here */
 }
 
@@ -180,6 +180,15 @@ DcmPolymorphOBOW::createUint16Array(
     const Uint32 numWords,
     Uint16 * & words)
 {
+    // Check whether input would lead to a buffer allocation of more than
+    // 4 GB for a value, which is not possible in DICOM. The biggest input
+    // parameter value permitted is 2147483647, since 2147483647*2 is still
+    // < 2^32-1 (4 GB).
+    if (numWords > 2147483647)
+    {
+        errorFlag = EC_TooManyBytesRequested;
+        return errorFlag;
+    }
     currentVR = EVR_OW;
     setTagVR(EVR_OW);
     errorFlag = createEmptyValue(OFstatic_cast(Uint32, sizeof(Uint16) * OFstatic_cast(size_t, numWords)));
@@ -203,6 +212,15 @@ DcmPolymorphOBOW::putUint8Array(
     {
         if (byteValue)
         {
+            // Check if more than 4 GB is requested, which is the maximum
+            // length DICOM can handle. Take into account that the alignValue()
+            // call adds a byte if an odd length is provided, thus, 4294967295
+            // would not work.
+            if (numBytes > 4294967294UL)
+            {
+                errorFlag = EC_TooManyBytesRequested;
+                return errorFlag;
+            }
             errorFlag = putValue(byteValue, OFstatic_cast(Uint32, sizeof(Uint8) * OFstatic_cast(size_t, numBytes)));
             if (errorFlag == EC_Normal)
             {
@@ -233,6 +251,15 @@ DcmPolymorphOBOW::putUint16Array(
     {
         if (wordValue)
         {
+            // Check whether input would lead to a buffer allocation of more than
+            // 4 GB for a value, which is not possible in DICOM. The biggest input
+            // parameter value permitted is 2147483647, since 2147483647*2 is still
+            // < 2^32-1 (4 GB).
+            if (numWords > 2147483647)
+            {
+                errorFlag = EC_TooManyBytesRequested;
+                return EC_TooManyBytesRequested;
+            }
             errorFlag = putValue(wordValue, OFstatic_cast(Uint32, sizeof(Uint16) * OFstatic_cast(size_t, numWords)));
             if (errorFlag == EC_Normal &&
                 getTag().getEVR() == EVR_OB && getByteOrder() == EBO_BigEndian)
index a1400b093c11f63f306b3bd0fe72ea9c11a17a7c..9da151a954173ca442c7f426a7fa0733b7d8dd36 100644 (file)
@@ -27,6 +27,7 @@
 
 #define INCLUDE_CSTDIO
 #define INCLUDE_CSTRING
+#define INCLUDE_CINTTYPES
 #include "dcmtk/ofstd/ofstdinc.h"
 
 
@@ -78,20 +79,20 @@ int DcmSignedLong::compare(const DcmElement& rhs) const
     myThis = OFconst_cast(DcmSignedLong*, this);
     myRhs =  OFstatic_cast(DcmSignedLong*, OFconst_cast(DcmElement*, &rhs));
 
-    /* check whether VMs are equal */
-    unsigned long thisVM = myThis->getVM();
-    unsigned long rhsVM = myRhs->getVM();
-    if (thisVM < rhsVM)
+    /* compare number of values */
+    unsigned long thisNumValues = myThis->getNumberOfValues();
+    unsigned long rhsNumValues = myRhs->getNumberOfValues();
+    if (thisNumValues < rhsNumValues)
     {
         return -1;
     }
-    else if (thisVM > rhsVM)
+    else if (thisNumValues > rhsNumValues)
     {
         return 1;
     }
 
     /* iterate over all components and test equality */
-    for (unsigned long count = 0; count < thisVM; count++)
+    for (unsigned long count = 0; count < thisNumValues; count++)
     {
         Sint32 val = 0;
         if (myThis->getSint32(val, count).good())
@@ -147,7 +148,13 @@ OFCondition DcmSignedLong::checkValue(const OFString &vm,
 
 unsigned long DcmSignedLong::getVM()
 {
-    return getLengthField() / OFstatic_cast(unsigned long, sizeof(Sint32));
+    return getNumberOfValues();
+}
+
+
+unsigned long DcmSignedLong::getNumberOfValues()
+{
+    return OFstatic_cast(unsigned long, getLengthField() / sizeof(Sint32));
 }
 
 
@@ -167,7 +174,7 @@ void DcmSignedLong::print(STD_NAMESPACE ostream&out,
         errorFlag = getSint32Array(sintVals);
         if (sintVals != NULL)
         {
-            const unsigned long count = getVM();
+            const unsigned long count = getNumberOfValues();
             /* double-check length field for valid value */
             if (count > 0)
             {
@@ -182,7 +189,12 @@ void DcmSignedLong::print(STD_NAMESPACE ostream&out,
                 for (unsigned int i = 0; i < count; i++, sintVals++)
                 {
                     /* check whether first value is printed (omit delimiter) */
-#if SIZEOF_LONG == 8
+#ifdef PRId32
+                    if (i == 0)
+                        sprintf(buffer, "%" PRId32, *sintVals);
+                    else
+                        sprintf(buffer, "\\%" PRId32, *sintVals);
+#elif SIZEOF_LONG == 8
                     if (i == 0)
                         sprintf(buffer, "%d", *sintVals);
                     else
@@ -335,7 +347,9 @@ OFCondition DcmSignedLong::putString(const char *stringVal,
             /* get specified value from multi-valued string */
             pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value);
             if (value.empty() ||
-#if SIZEOF_LONG == 8
+#ifdef SCNd32
+                (sscanf(value.c_str(), "%" SCNd32, &field[i]) != 1)
+#elif SIZEOF_LONG == 8
                 (sscanf(value.c_str(), "%d", &field[i]) != 1)
 #else
                 (sscanf(value.c_str(), "%ld", &field[i]) != 1)
@@ -377,7 +391,7 @@ OFCondition DcmSignedLong::verify(const OFBool autocorrect)
 
 
 OFBool DcmSignedLong::matches(const DcmElement& candidate,
-                             const OFBool enableWildCardMatching) const
+                              const OFBool enableWildCardMatching) const
 {
   OFstatic_cast(void,enableWildCardMatching);
   if (ident() == candidate.ident())
index 585dd6bf6b83fdea511bca41cf12cedd84bd2395..55c0fbf4bd63dc0aac2aea4dc34153947afe7499 100644 (file)
@@ -78,20 +78,20 @@ int DcmSignedShort::compare(const DcmElement& rhs) const
     myThis = OFconst_cast(DcmSignedShort*, this);
     myRhs =  OFstatic_cast(DcmSignedShort*, OFconst_cast(DcmElement*, &rhs));
 
-    /* check whether VMs are equal */
-    unsigned long thisVM = myThis->getVM();
-    unsigned long rhsVM = myRhs->getVM();
-    if (thisVM < rhsVM)
+    /* compare number of values */
+    unsigned long rhisNumValues = myThis->getNumberOfValues();
+    unsigned long rhsNumValues = myRhs->getNumberOfValues();
+    if (rhisNumValues < rhsNumValues)
     {
         return -1;
     }
-    else if (thisVM > rhsVM)
+    else if (rhisNumValues > rhsNumValues)
     {
         return 1;
     }
 
     /* iterate over all components and test equality */
-    for (unsigned long count = 0; count < thisVM; count++)
+    for (unsigned long count = 0; count < rhisNumValues; count++)
     {
         Sint16 val = 0;
         if (myThis->getSint16(val, count).good())
@@ -147,7 +147,13 @@ OFCondition DcmSignedShort::checkValue(const OFString &vm,
 
 unsigned long DcmSignedShort::getVM()
 {
-    return getLengthField() / OFstatic_cast(unsigned long, sizeof(Sint16));
+    return getNumberOfValues();
+}
+
+
+unsigned long DcmSignedShort::getNumberOfValues()
+{
+    return OFstatic_cast(unsigned long, getLengthField() / sizeof(Sint16));
 }
 
 
@@ -167,7 +173,7 @@ void DcmSignedShort::print(STD_NAMESPACE ostream&out,
         errorFlag = getSint16Array(sintVals);
         if (sintVals != NULL)
         {
-            const unsigned long count = getVM();
+            const unsigned long count = getNumberOfValues();
             /* double-check length field for valid value */
             if (count > 0)
             {
index 82acc515b7a42089bf05456ea43bf283ea05180c..bddf17e928f6a6c41343d0aab16c38d163a2e20e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -54,14 +54,48 @@ DcmShortText &DcmShortText::operator=(const DcmShortText &obj)
 }
 
 
+int DcmShortText::compare(const DcmElement& rhs) const
+{
+    int result = DcmElement::compare(rhs);
+    if (result != 0)
+    {
+        return result;
+    }
+
+    /* cast away constness (dcmdata is not const correct...) */
+    DcmShortText* myThis = NULL;
+    DcmShortText* myRhs = NULL;
+    myThis = OFconst_cast(DcmShortText*, this);
+    myRhs = OFstatic_cast(DcmShortText*, OFconst_cast(DcmElement*, &rhs));
+
+    /* compare length */
+    unsigned long thisLength = myThis->getLength();
+    unsigned long rhsLength = myRhs->getLength();
+    if (thisLength < rhsLength)
+    {
+        return -1;
+    }
+    else if (thisLength > rhsLength)
+    {
+        return 1;
+    }
+
+    /* check whether values are equal */
+    OFString thisValue, rhsValue;
+    myThis->getOFStringArray(thisValue);
+    myThis->getOFStringArray(rhsValue);
+    return thisValue.compare(rhsValue);
+}
+
+
 OFCondition DcmShortText::copyFrom(const DcmObject& rhs)
 {
-  if (this != &rhs)
-  {
-    if (rhs.ident() != ident()) return EC_IllegalCall;
-    *this = OFstatic_cast(const DcmShortText &, rhs);
-  }
-  return EC_Normal;
+    if (this != &rhs)
+    {
+        if (rhs.ident() != ident()) return EC_IllegalCall;
+        *this = OFstatic_cast(const DcmShortText &, rhs);
+    }
+    return EC_Normal;
 }
 
 
index c8dbff05943b4df2357770ba25be56355078160a..4ea654b44fa7695e66192e926896bc9079af481e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -428,6 +428,26 @@ OFCondition DcmTime::getTimeZoneFromString(const char *dicomTimeZone,
 
 // ********************************
 
+OFBool DcmTime::check(const char* dicomTime,
+                      const size_t dicomTimeSize)
+{
+    return check(dicomTime, dicomTimeSize, OFFalse);
+}
+
+OFBool DcmTime::check(const char* dicomTime,
+                      const size_t dicomTimeSize,
+                      const OFBool supportOldFormat)
+{
+    switch (DcmElement::scanValue("tm", dicomTime, dicomTimeSize))
+    {
+    case 4 /* TM */:
+        return OFTrue;
+    case 5 /* old style TM */:
+        return supportOldFormat;
+    default:
+        return OFFalse;
+    }
+}
 
 OFCondition DcmTime::checkStringValue(const OFString &value,
                                       const OFString &vm,
@@ -455,8 +475,7 @@ OFCondition DcmTime::checkStringValue(const OFString &value,
             else if (dcmEnableVRCheckerForStringValues.get())
             {
                 /* check value representation */
-                const int vrID = DcmElement::scanValue(value, "tm", posStart, length);
-                if ((vrID != 4) && (!oldFormat || (vrID != 5)))
+                if (!check(value.data() + posStart, length, oldFormat))
                 {
                     result = EC_ValueRepresentationViolated;
                     break;
index ae7480c2ac8c96e7c465924d28afaf26a140dc2e..bc92c533ced5e9bb035c75fb2a1508d76b81adf3 100644 (file)
  */
 
 
-#include "dcmtk/config/osconfig.h"
+#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
+
 #include "dcmtk/ofstd/ofstream.h"
 #include "dcmtk/dcmdata/dcvrul.h"
 
 #define INCLUDE_CSTDIO
 #define INCLUDE_CSTRING
+#define INCLUDE_CINTTYPES
 #include "dcmtk/ofstd/ofstdinc.h"
 
 
@@ -77,20 +79,20 @@ int DcmUnsignedLong::compare(const DcmElement& rhs) const
     myThis = OFconst_cast(DcmUnsignedLong*, this);
     myRhs =  OFstatic_cast(DcmUnsignedLong*, OFconst_cast(DcmElement*, &rhs));
 
-    /* check whether VMs are equal */
-    unsigned long thisVM = myThis->getVM();
-    unsigned long rhsVM = myRhs->getVM();
-    if (thisVM < rhsVM)
+    /* compare number of values */
+    unsigned long thisNumValues = myThis->getNumberOfValues();
+    unsigned long rhsNumValues = myRhs->getNumberOfValues();
+    if (thisNumValues < rhsNumValues)
     {
         return -1;
     }
-    else if (thisVM > rhsVM)
+    else if (thisNumValues > rhsNumValues)
     {
         return 1;
     }
 
     /* iterate over all components and test equality */
-    for (unsigned long count = 0; count < thisVM; count++)
+    for (unsigned long count = 0; count < thisNumValues; count++)
     {
         Uint32 val = 0;
         if (myThis->getUint32(val, count).good())
@@ -144,6 +146,12 @@ OFCondition DcmUnsignedLong::checkValue(const OFString &vm,
 
 
 unsigned long DcmUnsignedLong::getVM()
+{
+    return getNumberOfValues();
+}
+
+
+unsigned long DcmUnsignedLong::getNumberOfValues()
 {
     return OFstatic_cast(unsigned long, getLengthField() / sizeof(Uint32));
 }
@@ -165,8 +173,8 @@ void DcmUnsignedLong::print(STD_NAMESPACE ostream&out,
         errorFlag = getUint32Array(uintVals);
         if (uintVals != NULL)
         {
-            /* do not simply use getVM() because derived classes might always return 1 */
-            const unsigned long count = getLengthField() / OFstatic_cast(unsigned long, sizeof(Uint32));
+            /* do not use getVM() because derived classes might always return 1 */
+            const unsigned long count = getNumberOfValues();
             /* double-check length field for valid value */
             if (count > 0)
             {
@@ -182,7 +190,11 @@ void DcmUnsignedLong::print(STD_NAMESPACE ostream&out,
                 {
                     /* check whether first value is printed (omit delimiter) */
                     if (i == 0)
-#if SIZEOF_LONG == 8
+#ifdef PRIu32
+                        sprintf(buffer, "%" PRIu32, *uintVals);
+                    else
+                        sprintf(buffer, "\\%" PRIu32, *uintVals);
+#elif SIZEOF_LONG == 8
                         sprintf(buffer, "%u", *uintVals);
                     else
                         sprintf(buffer, "\\%u", *uintVals);
@@ -234,8 +246,8 @@ OFCondition DcmUnsignedLong::getUint32(Uint32 &uintVal,
     {
         if (uintValues == NULL)
             errorFlag = EC_IllegalCall;
-        /* do not simply use getVM() because derived classes might always return 1 */
-        else if (pos >= getLengthField() / sizeof(Uint32))
+        /* do not use getVM() because derived classes might always return 1 */
+        else if (pos >= getNumberOfValues())
             errorFlag = EC_IllegalParameter;
         else
             uintVal = uintValues[pos];
@@ -334,7 +346,9 @@ OFCondition DcmUnsignedLong::putString(const char *stringVal,
             /* get specified value from multi-valued string */
             pos = DcmElement::getValueFromString(stringVal, pos, stringLen, value);
             if (value.empty() ||
-#if SIZEOF_LONG == 8
+#ifdef SCNu32
+                (sscanf(value.c_str(), "%" SCNu32, &field[i]) != 1)
+#elif SIZEOF_LONG == 8
                 (sscanf(value.c_str(), "%u", &field[i]) != 1)
 #else
                 (sscanf(value.c_str(), "%lu", &field[i]) != 1)
index 0efbed253b7cd7c0e366fb635c159441c0e78d1c..258db4d68dfda81962746c40b75ccf508ecb4c03 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2014, OFFIS e.V.
+ *  Copyright (C) 2014-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -55,6 +55,40 @@ DcmUniversalResourceIdentifierOrLocator &DcmUniversalResourceIdentifierOrLocator
 }
 
 
+int DcmUniversalResourceIdentifierOrLocator::compare(const DcmElement& rhs) const
+{
+    int result = DcmElement::compare(rhs);
+    if (result != 0)
+    {
+        return result;
+    }
+
+    /* cast away constness (dcmdata is not const correct...) */
+    DcmUniversalResourceIdentifierOrLocator* myThis = NULL;
+    DcmUniversalResourceIdentifierOrLocator* myRhs = NULL;
+    myThis = OFconst_cast(DcmUniversalResourceIdentifierOrLocator*, this);
+    myRhs = OFstatic_cast(DcmUniversalResourceIdentifierOrLocator*, OFconst_cast(DcmElement*, &rhs));
+
+    /* compare length */
+    unsigned long thisLength = myThis->getLength();
+    unsigned long rhsLength = myRhs->getLength();
+    if (thisLength < rhsLength)
+    {
+        return -1;
+    }
+    else if (thisLength > rhsLength)
+    {
+        return 1;
+    }
+
+    /* check whether values are equal */
+    OFString thisValue, rhsValue;
+    myThis->getOFStringArray(thisValue);
+    myThis->getOFStringArray(rhsValue);
+    return thisValue.compare(rhsValue);
+}
+
+
 OFCondition DcmUniversalResourceIdentifierOrLocator::copyFrom(const DcmObject& rhs)
 {
   if (this != &rhs)
@@ -145,14 +179,10 @@ OFBool DcmUniversalResourceIdentifierOrLocator::isUniversalMatch(const OFBool no
     if(enableWildCardMatching)
     {
       OFString value;
-      if(!normalize && getVM() > 1)
+      /* by definition, the VM of a non-empty value of this VR is 1 */
+      getOFStringArray(value, normalize);
+      if(value.find_first_not_of( '*' ) != OFString_npos)
         return OFFalse;
-      for(unsigned long valNo = 0; valNo < getVM(); ++valNo)
-      {
-        getOFString(value, valNo, normalize);
-        if(value.find_first_not_of( '*' ) != OFString_npos)
-          return OFFalse;
-      }
     }
     else
       return OFFalse;
index cbc37ffb5812eae00c39064486959fc36379108d..81fa2ec0921bfad364adc3d59c67303b660b63f2 100644 (file)
@@ -76,20 +76,20 @@ int DcmUnsignedShort::compare(const DcmElement& rhs) const
     myThis = OFconst_cast(DcmUnsignedShort*, this);
     myRhs =  OFstatic_cast(DcmUnsignedShort*, OFconst_cast(DcmElement*, &rhs));
 
-    /* check whether VMs are equal */
-    unsigned long thisVM = myThis->getVM();
-    unsigned long rhsVM = myRhs->getVM();
-    if (thisVM < rhsVM)
+    /* compare number of values */
+    unsigned long thisNumValues = myThis->getNumberOfValues();
+    unsigned long rhsNumValues = myRhs->getNumberOfValues();
+    if (thisNumValues < rhsNumValues)
     {
         return -1;
     }
-    else if (thisVM > rhsVM)
+    else if (thisNumValues > rhsNumValues)
     {
         return 1;
     }
 
     /* iterate over all components and test equality */
-    for (unsigned long count = 0; count < thisVM; count++)
+    for (unsigned long count = 0; count < thisNumValues; count++)
     {
         Uint16 val = 0;
         if (myThis->getUint16(val, count).good())
@@ -143,6 +143,12 @@ OFCondition DcmUnsignedShort::checkValue(const OFString &vm,
 
 
 unsigned long DcmUnsignedShort::getVM()
+{
+    return getNumberOfValues();
+}
+
+
+unsigned long DcmUnsignedShort::getNumberOfValues()
 {
     return OFstatic_cast(unsigned long, getLengthField() / sizeof(Uint16));
 }
@@ -164,7 +170,7 @@ void DcmUnsignedShort::print(STD_NAMESPACE ostream&out,
         errorFlag = getUint16Array(uintVals);
         if (uintVals != NULL)
         {
-            const unsigned long count = getVM();
+            const unsigned long count = getNumberOfValues();
             /* double-check length field for valid value */
             if (count > 0)
             {
index e9eaa8401b86166578f871509404e45dd87eecfb..2690eb3828b168b798e936a043c3d1444c53ea7a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -54,6 +54,41 @@ DcmUnlimitedText &DcmUnlimitedText::operator=(const DcmUnlimitedText &obj)
 }
 
 
+int DcmUnlimitedText::compare(const DcmElement& rhs) const
+{
+    int result = DcmElement::compare(rhs);
+    if (result != 0)
+    {
+        return result;
+    }
+
+    /* cast away constness (dcmdata is not const correct...) */
+    DcmUnlimitedText* myThis = NULL;
+    DcmUnlimitedText* myRhs = NULL;
+    myThis = OFconst_cast(DcmUnlimitedText*, this);
+    myRhs = OFstatic_cast(DcmUnlimitedText*, OFconst_cast(DcmElement*, &rhs));
+
+    /* compare length */
+    unsigned long thisLength = myThis->getLength();
+    unsigned long rhsLength = myRhs->getLength();
+    if (thisLength < rhsLength)
+    {
+        return -1;
+    }
+    else if (thisLength > rhsLength)
+    {
+        return 1;
+    }
+
+    /* check whether values are equal */
+    OFString thisValue, rhsValue;
+    myThis->getOFStringArray(thisValue);
+    myThis->getOFStringArray(rhsValue);
+    return thisValue.compare(rhsValue);
+}
+
+
+
 OFCondition DcmUnlimitedText::copyFrom(const DcmObject& rhs)
 {
   if (this != &rhs)
index f138c10d13e8ad0e9a144425697c03ef75831c7f..236036c42cfcc8b35a9a7ac593620c3ef59c02d3 100644 (file)
@@ -41,6 +41,7 @@ typedef struct
     OFBool              lossy;
     OFBool              retired;
     E_StreamCompression streamCompression;
+    OFBool              referenced;
 } S_XferNames;
 
 
@@ -60,7 +61,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFFalse,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #1
     { "",  // illegal type
       "Virtual Big Endian Implicit",
@@ -72,7 +75,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFFalse,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #2
     { UID_LittleEndianExplicitTransferSyntax,
       "Little Endian Explicit",
@@ -84,7 +89,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFFalse,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #3
     { UID_BigEndianExplicitTransferSyntax,
       "Big Endian Explicit",
@@ -96,7 +103,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFFalse,
       OFTrue, // retired with Supplement 98
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #4
     { UID_JPEGProcess1TransferSyntax,
       "JPEG Baseline",
@@ -108,7 +117,9 @@ const S_XferNames XferNames[] =
       1L, 1L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #5
     { UID_JPEGProcess2_4TransferSyntax,
       "JPEG Extended, Process 2+4",
@@ -120,7 +131,9 @@ const S_XferNames XferNames[] =
       2L ,4L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #6
     { UID_JPEGProcess3_5TransferSyntax,
       "JPEG Extended, Process 3+5",
@@ -132,7 +145,9 @@ const S_XferNames XferNames[] =
       3L ,5L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #7
     { UID_JPEGProcess6_8TransferSyntax,
       "JPEG Spectral Selection, Non-hierarchical, Process 6+8",
@@ -144,7 +159,9 @@ const S_XferNames XferNames[] =
       6L ,8L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #8
     { UID_JPEGProcess7_9TransferSyntax,
       "JPEG Spectral Selection, Non-hierarchical, Process 7+9",
@@ -156,7 +173,9 @@ const S_XferNames XferNames[] =
       7L ,9L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #9
     { UID_JPEGProcess10_12TransferSyntax,
       "JPEG Full Progression, Non-hierarchical, Process 10+12",
@@ -168,7 +187,9 @@ const S_XferNames XferNames[] =
       10L ,12L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #10
     { UID_JPEGProcess11_13TransferSyntax,
       "JPEG Full Progression, Non-hierarchical, Process 11+13",
@@ -180,7 +201,9 @@ const S_XferNames XferNames[] =
       11L ,13L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #11
     { UID_JPEGProcess14TransferSyntax,
       "JPEG Lossless, Non-hierarchical, Process 14",
@@ -192,7 +215,9 @@ const S_XferNames XferNames[] =
       14L ,14L,
       OFFalse,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #12
     { UID_JPEGProcess15TransferSyntax,
       "JPEG Lossless, Non-hierarchical, Process 15",
@@ -204,7 +229,9 @@ const S_XferNames XferNames[] =
       15L ,15L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #13
     { UID_JPEGProcess16_18TransferSyntax,
       "JPEG Extended, Hierarchical, Process 16+18",
@@ -216,7 +243,9 @@ const S_XferNames XferNames[] =
       16L ,18L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #14
     { UID_JPEGProcess17_19TransferSyntax,
       "JPEG Extended, Hierarchical, Process 17+19",
@@ -228,7 +257,9 @@ const S_XferNames XferNames[] =
       17L ,19L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #15
     { UID_JPEGProcess20_22TransferSyntax,
       "JPEG Spectral Selection, Hierarchical, Process 20+22",
@@ -240,7 +271,9 @@ const S_XferNames XferNames[] =
       20L ,22L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #16
     { UID_JPEGProcess21_23TransferSyntax,
       "JPEG Spectral Selection, Hierarchical, Process 21+23",
@@ -252,7 +285,9 @@ const S_XferNames XferNames[] =
       21L ,23L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #17
     { UID_JPEGProcess24_26TransferSyntax,
       "JPEG Full Progression, Hierarchical, Process 24+26",
@@ -264,7 +299,9 @@ const S_XferNames XferNames[] =
       24L ,26L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #18
     { UID_JPEGProcess25_27TransferSyntax,
       "JPEG Full Progression, Hierarchical, Process 25+27",
@@ -276,7 +313,9 @@ const S_XferNames XferNames[] =
       25L ,27L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #19
     { UID_JPEGProcess28TransferSyntax,
       "JPEG Lossless, Hierarchical, Process 28",
@@ -288,7 +327,9 @@ const S_XferNames XferNames[] =
       28L ,28L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #20
     { UID_JPEGProcess29TransferSyntax,
       "JPEG Lossless, Hierarchical, Process 29",
@@ -300,7 +341,9 @@ const S_XferNames XferNames[] =
       29L ,29L,
       OFTrue,
       OFTrue,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #21
     { UID_JPEGProcess14SV1TransferSyntax,
       "JPEG Lossless, Non-hierarchical, 1st Order Prediction",
@@ -312,7 +355,9 @@ const S_XferNames XferNames[] =
       14L ,14L,
       OFFalse,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #22
     { UID_RLELosslessTransferSyntax,
       "RLE Lossless",
@@ -324,7 +369,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFFalse,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #23
     { UID_DeflatedExplicitVRLittleEndianTransferSyntax,
       "Deflated Explicit VR Little Endian",
@@ -337,10 +384,11 @@ const S_XferNames XferNames[] =
       OFFalse,
       OFFalse,
 #ifdef WITH_ZLIB
-      ESC_zlib
+      ESC_zlib,
 #else
-      ESC_unsupported
+      ESC_unsupported,
 #endif
+      OFFalse 
     },
     // entry #24
     { UID_JPEGLSLosslessTransferSyntax,
@@ -353,7 +401,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFFalse,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #25
     { UID_JPEGLSLossyTransferSyntax,
       "JPEG-LS Lossy (Near-lossless)",
@@ -365,7 +415,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #26
     { UID_JPEG2000LosslessOnlyTransferSyntax,
       "JPEG 2000 (Lossless only)",
@@ -377,7 +429,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFFalse,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #27
     { UID_JPEG2000TransferSyntax,
       "JPEG 2000 (Lossless or Lossy)",
@@ -389,7 +443,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #28
    { UID_JPEG2000Part2MulticomponentImageCompressionLosslessOnlyTransferSyntax,
       "JPEG 2000 Part 2 Multicomponent Image Compression (Lossless only)",
@@ -401,7 +457,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFFalse,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #29
    { UID_JPEG2000Part2MulticomponentImageCompressionTransferSyntax,
       "JPEG 2000 Part 2 Multicomponent Image Compression (Lossless or Lossy)",
@@ -413,7 +471,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #30
    { UID_JPIPReferencedTransferSyntax,
       "JPIP Referenced",
@@ -425,7 +485,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,               // really lossy?
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFTrue 
+    },
     // entry #31
    { UID_JPIPReferencedDeflateTransferSyntax,
       "JPIP Referenced Deflate",
@@ -438,10 +500,11 @@ const S_XferNames XferNames[] =
       OFTrue,               // really lossy?
       OFFalse,
 #ifdef WITH_ZLIB
-      ESC_zlib
+      ESC_zlib,
 #else
-      ESC_unsupported
+      ESC_unsupported,
 #endif
+      OFTrue
     },
     // entry #32
     { UID_MPEG2MainProfileAtMainLevelTransferSyntax,
@@ -454,7 +517,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #33
     { UID_MPEG2MainProfileAtHighLevelTransferSyntax,
       "MPEG2 Main Profile @ High Level",  // changed with DICOM 2016e to: MPEG2 Main Profile / High Level
@@ -466,7 +531,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #34
     { UID_MPEG4HighProfileLevel4_1TransferSyntax,
       "MPEG-4 AVC/H.264 High Profile / Level 4.1",
@@ -478,7 +545,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #35
     { UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax,
       "MPEG-4 AVC/H.264 BD-compatible High Profile / Level 4.1",
@@ -490,7 +559,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #36
     { UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax,
       "MPEG-4 AVC/H.264 High Profile / Level 4.2 For 2D Video",
@@ -502,7 +573,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #37
     { UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax,
       "MPEG-4 AVC/H.264 High Profile / Level 4.2 For 3D Video",
@@ -514,7 +587,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #38
     { UID_MPEG4StereoHighProfileLevel4_2TransferSyntax,
       "MPEG-4 AVC/H.264 Stereo High Profile / Level 4.2",
@@ -526,7 +601,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #39
     { UID_HEVCMainProfileLevel5_1TransferSyntax,
       "HEVC/H.265 Main Profile / Level 5.1",
@@ -538,7 +615,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #40
     { UID_HEVCMain10ProfileLevel5_1TransferSyntax,
       "HEVC/H.265 Main 10 Profile / Level 5.1",
@@ -550,7 +629,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFTrue,
       OFFalse,
-      ESC_none },
+      ESC_none,
+      OFFalse 
+    },
     // entry #41
     { UID_PrivateGE_LEI_WithBigEndianPixelDataTransferSyntax,
       "Private GE Little Endian Implicit with big endian pixel data",
@@ -562,7 +643,9 @@ const S_XferNames XferNames[] =
       0L, 0L,
       OFFalse,
       OFFalse,
-      ESC_none }
+      ESC_none,
+      OFFalse 
+    }
 };
 
 const int DIM_OF_XferNames = OFstatic_cast(int, sizeof(XferNames) / sizeof(S_XferNames));
@@ -583,7 +666,8 @@ DcmXfer::DcmXfer(E_TransferSyntax xfer)
     JPEGProcess12(0L),
     lossy(OFFalse),
     retired(OFFalse),
-    streamCompression(ESC_none)
+    streamCompression(ESC_none),
+    referenced(OFFalse)
 {
     int i = 0;
     while ((i < DIM_OF_XferNames) && XferNames[i].xfer != xfer)
@@ -602,6 +686,7 @@ DcmXfer::DcmXfer(E_TransferSyntax xfer)
         lossy              = XferNames[i].lossy;
         retired            = XferNames[i].retired;
         streamCompression  = XferNames[i].streamCompression;
+        referenced         = XferNames[i].referenced;
     }
 }
 
@@ -621,7 +706,8 @@ DcmXfer::DcmXfer(const char* xferName_xferID)
     JPEGProcess12(0L),
     lossy(OFFalse),
     retired(OFFalse),
-    streamCompression(ESC_none)
+    streamCompression(ESC_none),
+    referenced(OFFalse)
 {
     const char* xname = xferName_xferID;
     if (xname != NULL)
@@ -643,6 +729,7 @@ DcmXfer::DcmXfer(const char* xferName_xferID)
             lossy              = XferNames[i].lossy;
             retired            = XferNames[i].retired;
             streamCompression  = XferNames[i].streamCompression;
+            referenced         = XferNames[i].referenced;
         }
         else
         {
@@ -663,6 +750,7 @@ DcmXfer::DcmXfer(const char* xferName_xferID)
                 lossy              = XferNames[i].lossy;
                 retired            = XferNames[i].retired;
                 streamCompression  = XferNames[i].streamCompression;
+                referenced         = XferNames[i].referenced;
             }
         }
     }
@@ -684,7 +772,8 @@ DcmXfer::DcmXfer(const DcmXfer &newXfer)
     JPEGProcess12(newXfer.JPEGProcess12),
     lossy(newXfer.lossy),
     retired(newXfer.retired),
-    streamCompression(newXfer.streamCompression)
+    streamCompression(newXfer.streamCompression),
+    referenced(newXfer.referenced)
 {
 }
 
@@ -721,6 +810,7 @@ DcmXfer &DcmXfer::operator=(const E_TransferSyntax xfer)
         lossy              = XferNames[i].lossy;
         retired            = XferNames[i].retired;
         streamCompression  = XferNames[i].streamCompression;
+        referenced         = XferNames[i].referenced;
     } else {
         xferSyn            = EXS_Unknown;
         xferID             = "";
@@ -734,6 +824,7 @@ DcmXfer &DcmXfer::operator=(const E_TransferSyntax xfer)
         lossy              = OFFalse;
         retired            = OFFalse;
         streamCompression  = ESC_none;
+        referenced         = OFFalse;
     }
     return *this;
 }
@@ -758,6 +849,7 @@ DcmXfer &DcmXfer::operator=(const DcmXfer &newXfer)
         lossy              = newXfer.lossy;
         retired            = newXfer.retired;
         streamCompression  = newXfer.streamCompression;
+        referenced         = newXfer.referenced;
     }
     return *this;
 }
index 78dc18042e3b08ca29983565c74d66357c70c9ee..e519fc372ace950843c101ec2029838bd0c3af68 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -70,7 +70,7 @@ printDefined(FILE* fout, const DcmDictEntry* e)
     if (e == NULL || e->getTagName() == NULL)
         return;
 
-    strcpy(buf, e->getTagName());
+    OFStandard::strlcpy(buf, e->getTagName(), DCM_MAXDICTLINESIZE+1);
 
     convertToIdentifier(buf);
 
@@ -154,8 +154,8 @@ int main(int argc, char* argv[])
     fputs("** It was generated automatically by:\n", fout);
 #ifndef SUPPRESS_CREATE_STAMP
     /*
-     * Putting the date in the file will confuse CVS/RCS
-     * if nothing has changed except the generation date.
+     * Putting the date in the file will confuse version control
+     * systems if nothing has changed except the generation date.
      * This is only an issue if the header file is continually
      * generated new.
      */
@@ -238,7 +238,7 @@ int main(int argc, char* argv[])
     }
     fputs("\n#endif /* !DCDEFTAG_H */\n", fout);
 
-    dcmDataDict.unlock();
+    dcmDataDict.wrunlock();
     return 0;
 }
 
index e05e64c10d046f98200be8a67a8fa2047716021f..97b1464c94da6a72cd1a35965d59755791b02548 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -266,7 +266,7 @@ main(int argc, char* argv[])
     fprintf(fout, "\n");
     fprintf(fout, "#endif // WITH_BUILTIN_DICTIONARY\n");
     fprintf(fout, "\n");
-    dcmDataDict.unlock();
+    dcmDataDict.wrunlock();
     if (filename)
     {
         fclose(fout);
index 8482568b6e80ef1755b573a4d69249df2a52d7e6..d246391c760be90787b8bf9d1fa819f412d758f3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2010-2017, OFFIS e.V.
+ *  Copyright (C) 2010-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -32,59 +32,49 @@ BEGIN_EXTERN_C
 #include "vrscanl.h"
 END_EXTERN_C
 
-char* vrscan::makeBuffer(const OFString& vr, const OFString& value, size_t& size)
+int vrscan::scan(const OFString& vr, const char* const value, const size_t size)
 {
-    char *buffer, *pos;
-
-    // Allocate the needed buffer
-    size = vr.length() + value.length() + 2;
-    pos = buffer = new char[size];
-
-    // Fill it with the input
-    OFBitmanipTemplate<char>::copyMem(vr.data(), pos, vr.size());
-    pos += vr.size();
-
-    OFBitmanipTemplate<char>::copyMem(value.data(), pos, value.size());
-    pos += value.size();
-
-    // yy_scan_buffer() requires this
-    pos[0] = pos[1] = '\0';
-
-    return buffer;
-}
-
-int vrscan::scan(const OFString& vr, const OFString& value)
-{
-    struct vrscan_error error;
     yyscan_t scanner;
-    int result;
-
     if (yylex_init(&scanner))
     {
         DCMDATA_WARN("Error while setting up lexer: "
                 << OFStandard::getLastSystemErrorCode().message());
-        return 16;
+        return 16 /* UNKNOWN */;
     }
 
-    size_t bufSize;
-    char *buf = makeBuffer(vr, value, bufSize);
+    struct cleanup_t
+    {
+        cleanup_t(yyscan_t& y) : t(y) {}
+        ~cleanup_t() { yylex_destroy(t); }
+        yyscan_t& t;
+    }
+    cleanup(scanner);
+
+    OFString buffer;
+    buffer.reserve(vr.size() + size + 2);
+    buffer.append(vr);
+    buffer.append(value, size);
+    buffer.append("\0\0", 2); // yy_scan_buffer() requires this
+
+    struct vrscan_error error;
     error.error_msg = "(Unknown error)";
     yyset_extra(&error, scanner);
 
-    if (setjmp(error.setjmp_buffer))
+    if (setjmp(error.setjmp_buffer)) // poor man's catch()
     {
         DCMDATA_WARN("Fatal error in lexer: " << error.error_msg);
-        result = 16 /* UNKNOWN */;
-    } else {
-        yy_scan_buffer(buf, bufSize, scanner);
-
-        result = yylex(scanner);
-        if (yylex(scanner))
-            result = 16 /* UNKNOWN */;
+        return 16 /* UNKNOWN */;
     }
 
-    yylex_destroy(scanner);
-    delete[] buf;
+    yy_scan_buffer(OFconst_cast(char*, buffer.data()), buffer.size(), scanner);
+    const int result = yylex(scanner);
+    if (yylex(scanner))
+        return 16 /* UNKNOWN */;
 
     return result;
 }
+
+int vrscan::scan(const OFString& vr, const OFString& value)
+{
+    return scan(vr, value.data(), value.size());
+}
index ec4f2a0a196e47bb0ec5f85924baedb2f2b7b3b4..031f27ca7d5e04bcee1390fe262ec0d27e996aa0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2010, OFFIS e.V.
+ *  Copyright (C) 2010-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -38,7 +38,14 @@ struct vrscan_error {
     longjmp(yyget_extra(yyscanner)->setjmp_buffer, 1); \
 } while (0);
 
+#ifndef HAVE_UNISTD_H
+
 /* Don't try to include unistd.h which doesn't exist on windows */
 #define YY_NO_UNISTD_H
 
+/* Declare isatty() to avoid a warning when compiling vrscanl.l */
+int isatty(int fd);
+
+#endif
+
 #endif /* VRSCANI_H */
index 9642f578c263070860486c59ddac1e2e74235577..b221522a1df036c987aa49ab1151c5ed78efbee2 100644 (file)
@@ -1,6 +1,6 @@
-#line 2 "vrscanl.c"
+#line 1 "vrscanl.c"
 
-#line 4 "vrscanl.c"
+#line 3 "vrscanl.c"
 
 #define  YY_INT_ALIGNED short int
 
@@ -8,8 +8,8 @@
 
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 4
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -84,40 +84,32 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#ifndef SIZE_MAX
+#define SIZE_MAX               (~(size_t)0)
+#endif
+
 #endif /* ! C99 */
 
 #endif /* ! FLEXINT_H */
 
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else  /* ! __cplusplus */
+/* begin standard C++ headers. */
 
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
+/* TODO: this is always defined, so inline it */
 #define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
 #else
-#define yyconst
+#define yynoreturn
 #endif
 
 /* Returned upon end-of-file. */
 #define YY_NULL 0
 
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
+/* Promotes a possibly negative, possibly signed char to an
+ *   integer in range [0..255] for use as an array index.
  */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
 
 /* An opaque pointer. */
 #ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -141,20 +133,16 @@ typedef void* yyscan_t;
  * definition of BEGIN.
  */
 #define BEGIN yyg->yy_start = 1 + 2 *
-
 /* Translate the current start state into a value that can be later handed
  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  * compatibility.
  */
 #define YY_START ((yyg->yy_start - 1) / 2)
 #define YYSTATE YY_START
-
 /* Action number for EOF rule of a given start state. */
 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
 /* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin ,yyscanner )
-
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
 #define YY_END_OF_BUFFER_CHAR 0
 
 /* Size of default input buffer. */
@@ -179,11 +167,17 @@ typedef void* yyscan_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
-
+    
     #define YY_LESS_LINENO(n)
+    #define YY_LINENO_REWIND_TO(ptr)
     
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -198,14 +192,8 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
                } \
        while ( 0 )
-
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -218,7 +206,7 @@ struct yy_buffer_state
        /* Size of input buffer in bytes, not including room for EOB
         * characters.
         */
-       yy_size_t yy_buf_size;
+       int yy_buf_size;
 
        /* Number of characters read into yy_ch_buf, not including EOB
         * characters.
@@ -246,7 +234,7 @@ struct yy_buffer_state
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
        /* Whether to try to fill the input buffer when we reach the
         * end of it.
         */
@@ -280,84 +268,77 @@ struct yy_buffer_state
 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
                           : NULL)
-
 /* Same as previous macro, but useful when we know that the buffer stack is not
  * NULL or when we need an lvalue. For internal use only.
  */
 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
 
-void yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void yypop_buffer_state (yyscan_t yyscanner );
-
-static void yyensure_buffer_stack (yyscan_t yyscanner );
-static void yy_load_buffer_state (yyscan_t yyscanner );
-static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
 
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
 
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
 
-void *yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void yyfree (void * ,yyscan_t yyscanner );
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
 
 #define yy_new_buffer yy_create_buffer
-
 #define yy_set_interactive(is_interactive) \
        { \
        if ( ! YY_CURRENT_BUFFER ){ \
         yyensure_buffer_stack (yyscanner); \
                YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
        } \
        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
        }
-
 #define yy_set_bol(at_bol) \
        { \
        if ( ! YY_CURRENT_BUFFER ){\
         yyensure_buffer_stack (yyscanner); \
                YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
        } \
        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
        }
-
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
 /* Begin user sect3 */
 
-#define yywrap(n) 1
+#define yywrap(yyscanner) (/*CONSTCOND*/1)
 #define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
+typedef flex_uint8_t YY_CHAR;
 
 typedef int yy_state_type;
 
 #define yytext_ptr yytext_r
 
-static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
-static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
 
 /* Done after the current pattern has been matched and before the
  * corresponding action - sets up yytext.
  */
 #define YY_DO_BEFORE_ACTION \
        yyg->yytext_ptr = yy_bp; \
-       yyleng = (size_t) (yy_cp - yy_bp); \
+       yyleng = (int) (yy_cp - yy_bp); \
        yyg->yy_hold_char = *yy_cp; \
        *yy_cp = '\0'; \
        yyg->yy_c_buf_p = yy_cp;
-
 #define YY_NUM_RULES 22
 #define YY_END_OF_BUFFER 23
 /* This struct is not used in this scanner,
@@ -367,7 +348,7 @@ struct yy_trans_info
        flex_int32_t yy_verify;
        flex_int32_t yy_nxt;
        };
-static yyconst flex_int16_t yy_accept[1613] =
+static const flex_int16_t yy_accept[1613] =
     {   0,
         0,    0,   23,   21,   20,   21,   21,   21,   21,   21,
        21,   21,   21,   21,   16,    1,   12,    2,    7,    8,
@@ -549,7 +530,7 @@ static yyconst flex_int16_t yy_accept[1613] =
         8,    0
     } ;
 
-static yyconst flex_int32_t yy_ec[256] =
+static const YY_CHAR yy_ec[256] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
         1,    2,    2,    1,    1,    1,    1,    1,    1,    1,
@@ -581,7 +562,7 @@ static yyconst flex_int32_t yy_ec[256] =
         4,    4,    4,    4,    4
     } ;
 
-static yyconst flex_int32_t yy_meta[41] =
+static const YY_CHAR yy_meta[41] =
     {   0,
         1,    2,    2,    3,    4,    5,    6,    6,    7,    8,
         9,    9,    9,    9,    9,   10,   10,   10,   10,   11,
@@ -589,7 +570,7 @@ static yyconst flex_int32_t yy_meta[41] =
         5,    5,    5,    5,    5,    5,    5,    5,    5,    5
     } ;
 
-static yyconst flex_int16_t yy_base[2637] =
+static const flex_int16_t yy_base[2637] =
     {   0,
         0,   38, 1164,16659,16659,    0, 1122,    6, 1088,    7,
      1092, 1060, 1059,    6,    0, 1065,    1,   36,   46,   38,
@@ -883,7 +864,7 @@ static yyconst flex_int16_t yy_base[2637] =
     16583,16595,16607,16619,16631,16643
     } ;
 
-static yyconst flex_int16_t yy_def[2637] =
+static const flex_int16_t yy_def[2637] =
     {   0,
      1613, 1613, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612,
      1612, 1612, 1612, 1612, 1614, 1615, 1616, 1617, 1618, 1619,
@@ -1177,7 +1158,7 @@ static yyconst flex_int16_t yy_def[2637] =
      1612, 1612, 1612, 1612, 1612, 1612
     } ;
 
-static yyconst flex_int16_t yy_nxt[16700] =
+static const flex_int16_t yy_nxt[16700] =
     {   0,
      1612, 1612,    5, 1612,   30,   35, 1612, 1612, 1612, 1612,
       110,  111,  112,  147,  147,  147,  147,   88,   89,  104,
@@ -3018,7 +2999,7 @@ static yyconst flex_int16_t yy_nxt[16700] =
 
     } ;
 
-static yyconst flex_int16_t yy_chk[16700] =
+static const flex_int16_t yy_chk[16700] =
     {   0,
         0,    0,    1,    0,   15,   17,   43,    0,   43,   43,
        53,   53,   53,   70,   70,   70,   70,   39,   39,   48,
@@ -4894,6 +4875,7 @@ static yyconst flex_int16_t yy_chk[16700] =
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 
 #include "vrscani.h"
+#line 4878 "vrscanl.c"
 /* Make this work on windows (we don't need interactivity anyway) */
 /* This seems to be a bug: The .c file won't include it, but .h will
  * nevertheless.
@@ -4901,7 +4883,7 @@ static yyconst flex_int16_t yy_chk[16700] =
  * Our workaround: Define YY_NO_UNISTD_H in vrscani.h and make
  * sure that header is included before vrscanl.h.
  */
-#line 4905 "vrscanl.c"
+#line 4886 "vrscanl.c"
 
 #define INITIAL 0
 
@@ -4951,40 +4933,44 @@ struct yyguts_t
 
     }; /* end struct yyguts_t */
 
-static int yy_init_globals (yyscan_t yyscanner );
+static int yy_init_globals ( yyscan_t yyscanner );
 
 int yylex_init (yyscan_t* scanner);
 
-int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
 
 /* Accessor methods to globals.
    These are made visible to non-reentrant scanners for convenience. */
 
-int yylex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
 
-int yyget_debug (yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
 
-void yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
 
-YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
 
-void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
 
-FILE *yyget_in (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
 
-void yyset_in  (FILE * in_str ,yyscan_t yyscanner );
+void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
 
-FILE *yyget_out (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
 
-void yyset_out  (FILE * out_str ,yyscan_t yyscanner );
+void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
 
-int yyget_leng (yyscan_t yyscanner );
+                       int yyget_leng ( yyscan_t yyscanner );
 
-char *yyget_text (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
 
-int yyget_lineno (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
 
-void yyset_lineno (int line_number ,yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
+
+int yyget_column  ( yyscan_t yyscanner );
+
+void yyset_column ( int _column_no , yyscan_t yyscanner );
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -4992,26 +4978,29 @@ void yyset_lineno (int line_number ,yyscan_t yyscanner );
 
 #ifndef YY_SKIP_YYWRAP
 #ifdef __cplusplus
-extern "C" int yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
 #else
-extern int yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
 #endif
 #endif
 
+#ifndef YY_NO_UNPUT
+    
+#endif
+
 #ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
 #endif
 
 #ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
 #endif
 
 #ifndef YY_NO_INPUT
-
 #ifdef __cplusplus
-static int yyinput (yyscan_t yyscanner );
+static int yyinput ( yyscan_t yyscanner );
 #else
-static int input (yyscan_t yyscanner );
+static int input ( yyscan_t yyscanner );
 #endif
 
 #endif
@@ -5031,7 +5020,7 @@ static int input (yyscan_t yyscanner );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -5042,7 +5031,7 @@ static int input (yyscan_t yyscanner );
        if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
                { \
                int c = '*'; \
-               size_t n; \
+               int n; \
                for ( n = 0; n < max_size && \
                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
                        buf[n] = (char) c; \
@@ -5055,7 +5044,7 @@ static int input (yyscan_t yyscanner );
        else \
                { \
                errno=0; \
-               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+               while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
                        { \
                        if( errno != EINTR) \
                                { \
@@ -5110,7 +5099,7 @@ extern int yylex (yyscan_t yyscanner);
 
 /* Code executed at the end of each rule. */
 #ifndef YY_BREAK
-#define YY_BREAK break;
+#define YY_BREAK /*LINTED*/break;
 #endif
 
 #define YY_RULE_SETUP \
@@ -5120,16 +5109,11 @@ extern int yylex (yyscan_t yyscanner);
  */
 YY_DECL
 {
-       register yy_state_type yy_current_state;
-       register char *yy_cp, *yy_bp;
-       register int yy_act;
+       yy_state_type yy_current_state;
+       char *yy_cp, *yy_bp;
+       int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 100 "vrscanl.l"
-
-
-#line 5132 "vrscanl.c"
-
        if ( !yyg->yy_init )
                {
                yyg->yy_init = 1;
@@ -5150,13 +5134,19 @@ YY_DECL
                if ( ! YY_CURRENT_BUFFER ) {
                        yyensure_buffer_stack (yyscanner);
                        YY_CURRENT_BUFFER_LVALUE =
-                               yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+                               yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
                }
 
-               yy_load_buffer_state(yyscanner );
+               yy_load_buffer_state( yyscanner );
                }
 
-       while ( 1 )             /* loops until end-of-file is reached */
+       {
+#line 100 "vrscanl.l"
+
+
+#line 5147 "vrscanl.c"
+
+       while ( /*CONSTCOND*/1 )                /* loops until end-of-file is reached */
                {
                yy_cp = yyg->yy_c_buf_p;
 
@@ -5172,7 +5162,7 @@ YY_DECL
 yy_match:
                do
                        {
-                       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+                       YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
                        if ( yy_accept[yy_current_state] )
                                {
                                yyg->yy_last_accepting_state = yy_current_state;
@@ -5182,9 +5172,9 @@ yy_match:
                                {
                                yy_current_state = (int) yy_def[yy_current_state];
                                if ( yy_current_state >= 1613 )
-                                       yy_c = yy_meta[(unsigned int) yy_c];
+                                       yy_c = yy_meta[yy_c];
                                }
-                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+                       yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
                        ++yy_cp;
                        }
                while ( yy_current_state != 1612 );
@@ -5318,7 +5308,7 @@ YY_RULE_SETUP
 #line 125 "vrscanl.l"
 ECHO;
        YY_BREAK
-#line 5322 "vrscanl.c"
+#line 5311 "vrscanl.c"
 case YY_STATE_EOF(INITIAL):
        yyterminate();
 
@@ -5397,7 +5387,7 @@ case YY_STATE_EOF(INITIAL):
                                {
                                yyg->yy_did_buffer_switch_on_eof = 0;
 
-                               if ( yywrap(yyscanner ) )
+                               if ( yywrap( yyscanner ) )
                                        {
                                        /* Note: because we've taken care in
                                         * yy_get_next_buffer() to have set up
@@ -5450,6 +5440,7 @@ case YY_STATE_EOF(INITIAL):
                        "fatal flex scanner internal error--no action found" );
        } /* end of action switch */
                } /* end of scanning one token */
+       } /* end of user's declarations */
 } /* end of yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -5462,9 +5453,9 @@ case YY_STATE_EOF(INITIAL):
 static int yy_get_next_buffer (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-       register char *source = yyg->yytext_ptr;
-       register int number_to_move, i;
+       char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+       char *source = yyg->yytext_ptr;
+       int number_to_move, i;
        int ret_val;
 
        if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
@@ -5493,7 +5484,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
        /* Try to read more data. */
 
        /* First move last chars to start of buffer. */
-       number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+       number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
 
        for ( i = 0; i < number_to_move; ++i )
                *(dest++) = *(source++);
@@ -5513,7 +5504,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
                        { /* Not enough room in the buffer - grow it. */
 
                        /* just a shorter name for the current buffer */
-                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
                        int yy_c_buf_p_offset =
                                (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
@@ -5529,11 +5520,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
                                b->yy_ch_buf = (char *)
                                        /* Include room in for 2 EOB chars. */
-                                       yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+                                       yyrealloc( (void *) b->yy_ch_buf,
+                                                        (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
                                }
                        else
                                /* Can't grow it, we don't own it. */
-                               b->yy_ch_buf = 0;
+                               b->yy_ch_buf = NULL;
 
                        if ( ! b->yy_ch_buf )
                                YY_FATAL_ERROR(
@@ -5551,7 +5543,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
                /* Read in more data. */
                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-                       yyg->yy_n_chars, (size_t) num_to_read );
+                       yyg->yy_n_chars, num_to_read );
 
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
                }
@@ -5561,7 +5553,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
                if ( number_to_move == YY_MORE_ADJ )
                        {
                        ret_val = EOB_ACT_END_OF_FILE;
-                       yyrestart(yyin  ,yyscanner);
+                       yyrestart( yyin  , yyscanner);
                        }
 
                else
@@ -5575,12 +5567,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
        else
                ret_val = EOB_ACT_CONTINUE_SCAN;
 
-       if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+       if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
                /* Extend the array by 50%, plus the number we really need. */
-               yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
-               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+               int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+                       (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
                if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
                        YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+               /* "- 2" to take care of EOB's */
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
        }
 
        yyg->yy_n_chars += number_to_move;
@@ -5596,15 +5591,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
 {
-       register yy_state_type yy_current_state;
-       register char *yy_cp;
+       yy_state_type yy_current_state;
+       char *yy_cp;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
        yy_current_state = yyg->yy_start;
 
        for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
                {
-               register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+               YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
                if ( yy_accept[yy_current_state] )
                        {
                        yyg->yy_last_accepting_state = yy_current_state;
@@ -5614,9 +5609,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
                        {
                        yy_current_state = (int) yy_def[yy_current_state];
                        if ( yy_current_state >= 1613 )
-                               yy_c = yy_meta[(unsigned int) yy_c];
+                               yy_c = yy_meta[yy_c];
                        }
-               yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+               yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
                }
 
        return yy_current_state;
@@ -5629,11 +5624,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
  */
     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
 {
-       register int yy_is_jam;
+       int yy_is_jam;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
-       register char *yy_cp = yyg->yy_c_buf_p;
+       char *yy_cp = yyg->yy_c_buf_p;
 
-       register YY_CHAR yy_c = 1;
+       YY_CHAR yy_c = 1;
        if ( yy_accept[yy_current_state] )
                {
                yyg->yy_last_accepting_state = yy_current_state;
@@ -5643,14 +5638,19 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
                {
                yy_current_state = (int) yy_def[yy_current_state];
                if ( yy_current_state >= 1613 )
-                       yy_c = yy_meta[(unsigned int) yy_c];
+                       yy_c = yy_meta[yy_c];
                }
-       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+       yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
        yy_is_jam = (yy_current_state == 1612);
 
+       (void)yyg;
        return yy_is_jam ? 0 : yy_current_state;
 }
 
+#ifndef YY_NO_UNPUT
+
+#endif
+
 #ifndef YY_NO_INPUT
 #ifdef __cplusplus
     static int yyinput (yyscan_t yyscanner)
@@ -5676,7 +5676,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
                else
                        { /* need more input */
-                       int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+                       int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
                        ++yyg->yy_c_buf_p;
 
                        switch ( yy_get_next_buffer( yyscanner ) )
@@ -5693,14 +5693,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
                                         */
 
                                        /* Reset buffer status. */
-                                       yyrestart(yyin ,yyscanner);
+                                       yyrestart( yyin , yyscanner);
 
                                        /*FALLTHROUGH*/
 
                                case EOB_ACT_END_OF_FILE:
                                        {
-                                       if ( yywrap(yyscanner ) )
-                                               return EOF;
+                                       if ( yywrap( yyscanner ) )
+                                               return 0;
 
                                        if ( ! yyg->yy_did_buffer_switch_on_eof )
                                                YY_NEW_FILE;
@@ -5738,11 +5738,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
        if ( ! YY_CURRENT_BUFFER ){
         yyensure_buffer_stack (yyscanner);
                YY_CURRENT_BUFFER_LVALUE =
-            yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
        }
 
-       yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
-       yy_load_buffer_state(yyscanner );
+       yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
+       yy_load_buffer_state( yyscanner );
 }
 
 /** Switch to a different input buffer.
@@ -5771,7 +5771,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
                }
 
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
-       yy_load_buffer_state(yyscanner );
+       yy_load_buffer_state( yyscanner );
 
        /* We don't actually know whether we did this switch during
         * EOF (yywrap()) processing, but the only time this flag
@@ -5800,7 +5800,7 @@ static void yy_load_buffer_state  (yyscan_t yyscanner)
 {
        YY_BUFFER_STATE b;
     
-       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+       b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
        if ( ! b )
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
@@ -5809,13 +5809,13 @@ static void yy_load_buffer_state  (yyscan_t yyscanner)
        /* yy_ch_buf has to be 2 characters longer than the size given because
         * we need to put in 2 end-of-buffer characters.
         */
-       b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner );
+       b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
        if ( ! b->yy_ch_buf )
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
        b->yy_is_our_buffer = 1;
 
-       yy_init_buffer(b,file ,yyscanner);
+       yy_init_buffer( b, file , yyscanner);
 
        return b;
 }
@@ -5835,15 +5835,11 @@ static void yy_load_buffer_state  (yyscan_t yyscanner)
                YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
        if ( b->yy_is_our_buffer )
-               yyfree((void *) b->yy_ch_buf ,yyscanner );
+               yyfree( (void *) b->yy_ch_buf , yyscanner );
 
-       yyfree((void *) b ,yyscanner );
+       yyfree( (void *) b , yyscanner );
 }
 
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a yyrestart() or at EOF.
@@ -5854,7 +5850,7 @@ extern int isatty (int );
        int oerrno = errno;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-       yy_flush_buffer(b ,yyscanner);
+       yy_flush_buffer( b , yyscanner);
 
        b->yy_input_file = file;
        b->yy_fill_buffer = 1;
@@ -5898,7 +5894,7 @@ extern int isatty (int );
        b->yy_buffer_status = YY_BUFFER_NEW;
 
        if ( b == YY_CURRENT_BUFFER )
-               yy_load_buffer_state(yyscanner );
+               yy_load_buffer_state( yyscanner );
 }
 
 /** Pushes the new state onto the stack. The new state becomes
@@ -5930,7 +5926,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
        /* copied from yy_switch_to_buffer. */
-       yy_load_buffer_state(yyscanner );
+       yy_load_buffer_state( yyscanner );
        yyg->yy_did_buffer_switch_on_eof = 1;
 }
 
@@ -5944,13 +5940,13 @@ void yypop_buffer_state (yyscan_t yyscanner)
        if (!YY_CURRENT_BUFFER)
                return;
 
-       yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+       yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
        YY_CURRENT_BUFFER_LVALUE = NULL;
        if (yyg->yy_buffer_stack_top > 0)
                --yyg->yy_buffer_stack_top;
 
        if (YY_CURRENT_BUFFER) {
-               yy_load_buffer_state(yyscanner );
+               yy_load_buffer_state( yyscanner );
                yyg->yy_did_buffer_switch_on_eof = 1;
        }
 }
@@ -5960,7 +5956,7 @@ void yypop_buffer_state (yyscan_t yyscanner)
  */
 static void yyensure_buffer_stack (yyscan_t yyscanner)
 {
-       int num_to_alloc;
+       yy_size_t num_to_alloc;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
        if (!yyg->yy_buffer_stack) {
@@ -5969,15 +5965,15 @@ static void yyensure_buffer_stack (yyscan_t yyscanner)
                 * scanner will even need a stack. We use 2 instead of 1 to avoid an
                 * immediate realloc on the next call.
          */
-               num_to_alloc = 1;
+      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
                yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
                                                                , yyscanner);
                if ( ! yyg->yy_buffer_stack )
                        YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-                                                                 
+
                memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-                               
+
                yyg->yy_buffer_stack_max = num_to_alloc;
                yyg->yy_buffer_stack_top = 0;
                return;
@@ -5986,7 +5982,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner)
        if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
 
                /* Increase the buffer to prepare for a possible push. */
-               int grow_size = 8 /* arbitrary grow size */;
+               yy_size_t grow_size = 8 /* arbitrary grow size */;
 
                num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
                yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
@@ -6006,7 +6002,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner)
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
  * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object. 
+ * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
 {
@@ -6016,23 +6012,23 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscann
             base[size-2] != YY_END_OF_BUFFER_CHAR ||
             base[size-1] != YY_END_OF_BUFFER_CHAR )
                /* They forgot to leave room for the EOB's. */
-               return 0;
+               return NULL;
 
-       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+       b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
        if ( ! b )
                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
 
-       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
+       b->yy_buf_size = (int) (size - 2);      /* "- 2" to take care of EOB's */
        b->yy_buf_pos = b->yy_ch_buf = base;
        b->yy_is_our_buffer = 0;
-       b->yy_input_file = 0;
+       b->yy_input_file = NULL;
        b->yy_n_chars = b->yy_buf_size;
        b->yy_is_interactive = 0;
        b->yy_at_bol = 1;
        b->yy_fill_buffer = 0;
        b->yy_buffer_status = YY_BUFFER_NEW;
 
-       yy_switch_to_buffer(b ,yyscanner );
+       yy_switch_to_buffer( b , yyscanner );
 
        return b;
 }
@@ -6045,10 +6041,10 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscann
  * @note If you want to scan bytes that may contain NUL values, then use
  *       yy_scan_bytes() instead.
  */
-YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
 {
     
-       return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
+       return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
 }
 
 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
@@ -6058,7 +6054,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
 {
        YY_BUFFER_STATE b;
        char *buf;
@@ -6066,8 +6062,8 @@ YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yysc
        int i;
     
        /* Get memory for full buffer, including space for trailing EOB's. */
-       n = _yybytes_len + 2;
-       buf = (char *) yyalloc(n ,yyscanner );
+       n = (yy_size_t) (_yybytes_len + 2);
+       buf = (char *) yyalloc( n , yyscanner );
        if ( ! buf )
                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
 
@@ -6076,7 +6072,7 @@ YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yysc
 
        buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
-       b = yy_scan_buffer(buf,n ,yyscanner);
+       b = yy_scan_buffer( buf, n , yyscanner);
        if ( ! b )
                YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
 
@@ -6092,9 +6088,11 @@ YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yysc
 #define YY_EXIT_FAILURE 2
 #endif
 
-static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
 {
-       (void) fprintf( stderr, "%s\n", msg );
+       struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+       (void)yyg;
+       fprintf( stderr, "%s\n", msg );
        exit( YY_EXIT_FAILURE );
 }
 
@@ -6132,7 +6130,7 @@ YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
 int yyget_lineno  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    
+
         if (! YY_CURRENT_BUFFER)
             return 0;
     
@@ -6145,7 +6143,7 @@ int yyget_lineno  (yyscan_t yyscanner)
 int yyget_column  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    
+
         if (! YY_CURRENT_BUFFER)
             return 0;
     
@@ -6200,51 +6198,51 @@ void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
 }
 
 /** Set the current line number.
- * @param line_number
+ * @param _line_number line number
  * @param yyscanner The scanner object.
  */
-void yyset_lineno (int  line_number , yyscan_t yyscanner)
+void yyset_lineno (int  _line_number , yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
         /* lineno is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); 
+           YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
     
-    yylineno = line_number;
+    yylineno = _line_number;
 }
 
 /** Set the current column.
- * @param line_number
+ * @param _column_no column number
  * @param yyscanner The scanner object.
  */
-void yyset_column (int  column_no , yyscan_t yyscanner)
+void yyset_column (int  _column_no , yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
         /* column is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "yyset_column called with no buffer" , yyscanner); 
+           YY_FATAL_ERROR( "yyset_column called with no buffer" );
     
-    yycolumn = column_no;
+    yycolumn = _column_no;
 }
 
 /** Set the input stream. This does not discard the current
  * input buffer.
- * @param in_str A readable stream.
+ * @param _in_str A readable stream.
  * @param yyscanner The scanner object.
  * @see yy_switch_to_buffer
  */
-void yyset_in (FILE *  in_str , yyscan_t yyscanner)
+void yyset_in (FILE *  _in_str , yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yyin = in_str ;
+    yyin = _in_str ;
 }
 
-void yyset_out (FILE *  out_str , yyscan_t yyscanner)
+void yyset_out (FILE *  _out_str , yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yyout = out_str ;
+    yyout = _out_str ;
 }
 
 int yyget_debug  (yyscan_t yyscanner)
@@ -6253,10 +6251,10 @@ int yyget_debug  (yyscan_t yyscanner)
     return yy_flex_debug;
 }
 
-void yyset_debug (int  bdebug , yyscan_t yyscanner)
+void yyset_debug (int  _bdebug , yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yy_flex_debug = bdebug ;
+    yy_flex_debug = _bdebug ;
 }
 
 /* Accessor methods for yylval and yylloc */
@@ -6267,9 +6265,7 @@ void yyset_debug (int  bdebug , yyscan_t yyscanner)
  * the ONLY reentrant function that doesn't take the scanner as the last argument.
  * That's why we explicitly handle the declaration, instead of using our macros.
  */
-
 int yylex_init(yyscan_t* ptr_yy_globals)
-
 {
     if (ptr_yy_globals == NULL){
         errno = EINVAL;
@@ -6296,9 +6292,7 @@ int yylex_init(yyscan_t* ptr_yy_globals)
  * The user defined value in the first argument will be available to yyalloc in
  * the yyextra field.
  */
-
-int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
+int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
 {
     struct yyguts_t dummy_yyguts;
 
@@ -6308,20 +6302,20 @@ int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
         errno = EINVAL;
         return 1;
     }
-       
+
     *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-       
+
     if (*ptr_yy_globals == NULL){
         errno = ENOMEM;
         return 1;
     }
-    
+
     /* By setting to 0xAA, we expose bugs in
     yy_init_globals. Leave at 0x00 for releases. */
     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-    
+
     yyset_extra (yy_user_defined, *ptr_yy_globals);
-    
+
     return yy_init_globals ( *ptr_yy_globals );
 }
 
@@ -6332,10 +6326,10 @@ static int yy_init_globals (yyscan_t yyscanner)
      * This function is called from yylex_destroy(), so don't allocate here.
      */
 
-    yyg->yy_buffer_stack = 0;
+    yyg->yy_buffer_stack = NULL;
     yyg->yy_buffer_stack_top = 0;
     yyg->yy_buffer_stack_max = 0;
-    yyg->yy_c_buf_p = (char *) 0;
+    yyg->yy_c_buf_p = NULL;
     yyg->yy_init = 0;
     yyg->yy_start = 0;
 
@@ -6348,8 +6342,8 @@ static int yy_init_globals (yyscan_t yyscanner)
     yyin = stdin;
     yyout = stdout;
 #else
-    yyin = (FILE *) 0;
-    yyout = (FILE *) 0;
+    yyin = NULL;
+    yyout = NULL;
 #endif
 
     /* For future reference: Set errno on error, since we are called by
@@ -6365,17 +6359,17 @@ int yylex_destroy  (yyscan_t yyscanner)
 
     /* Pop the buffer stack, destroying each element. */
        while(YY_CURRENT_BUFFER){
-               yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+               yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
                YY_CURRENT_BUFFER_LVALUE = NULL;
                yypop_buffer_state(yyscanner);
        }
 
        /* Destroy the stack itself. */
-       yyfree(yyg->yy_buffer_stack ,yyscanner);
+       yyfree(yyg->yy_buffer_stack , yyscanner);
        yyg->yy_buffer_stack = NULL;
 
     /* Destroy the start condition stack. */
-        yyfree(yyg->yy_start_stack ,yyscanner );
+        yyfree( yyg->yy_start_stack , yyscanner );
         yyg->yy_start_stack = NULL;
 
     /* Reset the globals. This is important in a non-reentrant scanner so the next time
@@ -6393,18 +6387,21 @@ int yylex_destroy  (yyscan_t yyscanner)
  */
 
 #ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
 {
-       register int i;
+       struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+       (void)yyg;
+
+       int i;
        for ( i = 0; i < n; ++i )
                s1[i] = s2[i];
 }
 #endif
 
 #ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
 {
-       register int n;
+       int n;
        for ( n = 0; s[n]; ++n )
                ;
 
@@ -6414,11 +6411,16 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
 
 void *yyalloc (yy_size_t  size , yyscan_t yyscanner)
 {
-       return (void *) malloc( size );
+       struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+       (void)yyg;
+       return malloc(size);
 }
 
 void *yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
 {
+       struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+       (void)yyg;
+
        /* The cast to (char *) in the following accommodates both
         * implementations that use char* generic pointers, and those
         * that use void* generic pointers.  It works with the latter
@@ -6426,11 +6428,13 @@ void *yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
         * any pointer type to void*, and deal with argument conversions
         * as though doing an assignment.
         */
-       return (void *) realloc( (char *) ptr, size );
+       return realloc(ptr, size);
 }
 
 void yyfree (void * ptr , yyscan_t yyscanner)
 {
+       struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+       (void)yyg;
        free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
 }
 
@@ -6439,4 +6443,3 @@ void yyfree (void * ptr , yyscan_t yyscanner)
 #line 125 "vrscanl.l"
 
 
-
index 6b05068ca01e2bdf72347a20319c7c79b76f0a50..69d833aa6f660e0e97081f2449160f14c947e9a2 100644 (file)
@@ -2,9 +2,9 @@
 #define yyHEADER_H 1
 #define yyIN_HEADER 1
 
-#line 6 "vrscanl.h"
+#line 5 "vrscanl.h"
 
-#line 8 "vrscanl.h"
+#line 7 "vrscanl.h"
 
 #define  YY_INT_ALIGNED short int
 
@@ -12,8 +12,8 @@
 
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 4
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -88,29 +88,23 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#ifndef SIZE_MAX
+#define SIZE_MAX               (~(size_t)0)
+#endif
+
 #endif /* ! C99 */
 
 #endif /* ! FLEXINT_H */
 
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else  /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
+/* begin standard C++ headers. */
 
-#ifdef YY_USE_CONST
+/* TODO: this is always defined, so inline it */
 #define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
 #else
-#define yyconst
+#define yynoreturn
 #endif
 
 /* An opaque pointer. */
@@ -165,7 +159,7 @@ struct yy_buffer_state
        /* Size of input buffer in bytes, not including room for EOB
         * characters.
         */
-       yy_size_t yy_buf_size;
+       int yy_buf_size;
 
        /* Number of characters read into yy_ch_buf, not including EOB
         * characters.
@@ -193,7 +187,7 @@ struct yy_buffer_state
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
        /* Whether to try to fill the input buffer when we reach the
         * end of it.
         */
@@ -204,25 +198,25 @@ struct yy_buffer_state
        };
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
-void yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void yypop_buffer_state (yyscan_t yyscanner );
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
 
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
 
-void *yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void yyfree (void * ,yyscan_t yyscanner );
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
 
 /* Begin user sect3 */
 
-#define yywrap(n) 1
+#define yywrap(yyscanner) (/*CONSTCOND*/1)
 #define YY_SKIP_YYWRAP
 
 #define yytext_ptr yytext_r
@@ -246,36 +240,40 @@ void yyfree (void * ,yyscan_t yyscanner );
 
 int yylex_init (yyscan_t* scanner);
 
-int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
 
 /* Accessor methods to globals.
    These are made visible to non-reentrant scanners for convenience. */
 
-int yylex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
+
+int yyget_debug ( yyscan_t yyscanner );
+
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
 
-int yyget_debug (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
 
-void yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
 
-YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
 
-void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
 
-FILE *yyget_in (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
 
-void yyset_in  (FILE * in_str ,yyscan_t yyscanner );
+void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
 
-FILE *yyget_out (yyscan_t yyscanner );
+                       int yyget_leng ( yyscan_t yyscanner );
 
-void yyset_out  (FILE * out_str ,yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
 
-int yyget_leng (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
 
-char *yyget_text (yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
 
-int yyget_lineno (yyscan_t yyscanner );
+int yyget_column  ( yyscan_t yyscanner );
 
-void yyset_lineno (int line_number ,yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -283,18 +281,18 @@ void yyset_lineno (int line_number ,yyscan_t yyscanner );
 
 #ifndef YY_SKIP_YYWRAP
 #ifdef __cplusplus
-extern "C" int yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
 #else
-extern int yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
 #endif
 #endif
 
 #ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
 #endif
 
 #ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
 #endif
 
 #ifndef YY_NO_INPUT
@@ -341,9 +339,154 @@ extern int yylex (yyscan_t yyscanner);
 #undef YY_DECL
 #endif
 
+#ifndef yy_create_buffer_ALREADY_DEFINED
+#undef yy_create_buffer
+#endif
+#ifndef yy_delete_buffer_ALREADY_DEFINED
+#undef yy_delete_buffer
+#endif
+#ifndef yy_scan_buffer_ALREADY_DEFINED
+#undef yy_scan_buffer
+#endif
+#ifndef yy_scan_string_ALREADY_DEFINED
+#undef yy_scan_string
+#endif
+#ifndef yy_scan_bytes_ALREADY_DEFINED
+#undef yy_scan_bytes
+#endif
+#ifndef yy_init_buffer_ALREADY_DEFINED
+#undef yy_init_buffer
+#endif
+#ifndef yy_flush_buffer_ALREADY_DEFINED
+#undef yy_flush_buffer
+#endif
+#ifndef yy_load_buffer_state_ALREADY_DEFINED
+#undef yy_load_buffer_state
+#endif
+#ifndef yy_switch_to_buffer_ALREADY_DEFINED
+#undef yy_switch_to_buffer
+#endif
+#ifndef yypush_buffer_state_ALREADY_DEFINED
+#undef yypush_buffer_state
+#endif
+#ifndef yypop_buffer_state_ALREADY_DEFINED
+#undef yypop_buffer_state
+#endif
+#ifndef yyensure_buffer_stack_ALREADY_DEFINED
+#undef yyensure_buffer_stack
+#endif
+#ifndef yylex_ALREADY_DEFINED
+#undef yylex
+#endif
+#ifndef yyrestart_ALREADY_DEFINED
+#undef yyrestart
+#endif
+#ifndef yylex_init_ALREADY_DEFINED
+#undef yylex_init
+#endif
+#ifndef yylex_init_extra_ALREADY_DEFINED
+#undef yylex_init_extra
+#endif
+#ifndef yylex_destroy_ALREADY_DEFINED
+#undef yylex_destroy
+#endif
+#ifndef yyget_debug_ALREADY_DEFINED
+#undef yyget_debug
+#endif
+#ifndef yyset_debug_ALREADY_DEFINED
+#undef yyset_debug
+#endif
+#ifndef yyget_extra_ALREADY_DEFINED
+#undef yyget_extra
+#endif
+#ifndef yyset_extra_ALREADY_DEFINED
+#undef yyset_extra
+#endif
+#ifndef yyget_in_ALREADY_DEFINED
+#undef yyget_in
+#endif
+#ifndef yyset_in_ALREADY_DEFINED
+#undef yyset_in
+#endif
+#ifndef yyget_out_ALREADY_DEFINED
+#undef yyget_out
+#endif
+#ifndef yyset_out_ALREADY_DEFINED
+#undef yyset_out
+#endif
+#ifndef yyget_leng_ALREADY_DEFINED
+#undef yyget_leng
+#endif
+#ifndef yyget_text_ALREADY_DEFINED
+#undef yyget_text
+#endif
+#ifndef yyget_lineno_ALREADY_DEFINED
+#undef yyget_lineno
+#endif
+#ifndef yyset_lineno_ALREADY_DEFINED
+#undef yyset_lineno
+#endif
+#ifndef yyget_column_ALREADY_DEFINED
+#undef yyget_column
+#endif
+#ifndef yyset_column_ALREADY_DEFINED
+#undef yyset_column
+#endif
+#ifndef yywrap_ALREADY_DEFINED
+#undef yywrap
+#endif
+#ifndef yyget_lval_ALREADY_DEFINED
+#undef yyget_lval
+#endif
+#ifndef yyset_lval_ALREADY_DEFINED
+#undef yyset_lval
+#endif
+#ifndef yyget_lloc_ALREADY_DEFINED
+#undef yyget_lloc
+#endif
+#ifndef yyset_lloc_ALREADY_DEFINED
+#undef yyset_lloc
+#endif
+#ifndef yyalloc_ALREADY_DEFINED
+#undef yyalloc
+#endif
+#ifndef yyrealloc_ALREADY_DEFINED
+#undef yyrealloc
+#endif
+#ifndef yyfree_ALREADY_DEFINED
+#undef yyfree
+#endif
+#ifndef yytext_ALREADY_DEFINED
+#undef yytext
+#endif
+#ifndef yyleng_ALREADY_DEFINED
+#undef yyleng
+#endif
+#ifndef yyin_ALREADY_DEFINED
+#undef yyin
+#endif
+#ifndef yyout_ALREADY_DEFINED
+#undef yyout
+#endif
+#ifndef yy_flex_debug_ALREADY_DEFINED
+#undef yy_flex_debug
+#endif
+#ifndef yylineno_ALREADY_DEFINED
+#undef yylineno
+#endif
+#ifndef yytables_fload_ALREADY_DEFINED
+#undef yytables_fload
+#endif
+#ifndef yytables_destroy_ALREADY_DEFINED
+#undef yytables_destroy
+#endif
+#ifndef yyTABLES_NAME_ALREADY_DEFINED
+#undef yyTABLES_NAME
+#endif
+
 #line 125 "vrscanl.l"
 
 
-#line 348 "vrscanl.h"
+#line 490 "vrscanl.h"
 #undef yyIN_HEADER
 #endif /* yyHEADER_H */
index 267774f10804b63933912ca7c04fbb93df05fc85..e48aeb8b6c7ad78b668a75e37ee8f90767aa2cbe 100644 (file)
@@ -8,17 +8,19 @@ tchval.o: tchval.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -93,17 +95,19 @@ tdict.o: tdict.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -143,17 +147,19 @@ telemlen.o: telemlen.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -227,17 +233,19 @@ tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -273,17 +281,19 @@ tfilter.o: tfilter.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -330,17 +340,19 @@ tgenuid.o: tgenuid.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -376,17 +388,19 @@ ti2dbmp.o: ti2dbmp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -428,17 +442,19 @@ tmatch.o: tmatch.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -477,17 +493,19 @@ tnewdcme.o: tnewdcme.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -532,17 +550,19 @@ tparent.o: tparent.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -617,17 +637,19 @@ tparser.o: tparser.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -703,17 +725,19 @@ tpath.o: tpath.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -787,17 +811,19 @@ tpread.o: tpread.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -823,9 +849,10 @@ tpread.o: tpread.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/logmacro.h \
  ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
- ../include/dcmtk/dcmdata/dctk.h ../include/dcmtk/dcmdata/dctypes.h \
- ../include/dcmtk/dcmdata/dcswap.h ../include/dcmtk/dcmdata/dcerror.h \
- ../include/dcmtk/dcmdata/dcxfer.h ../include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofrand.h ../include/dcmtk/dcmdata/dctk.h \
+ ../include/dcmtk/dcmdata/dctypes.h ../include/dcmtk/dcmdata/dcswap.h \
+ ../include/dcmtk/dcmdata/dcerror.h ../include/dcmtk/dcmdata/dcxfer.h \
+ ../include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../include/dcmtk/dcmdata/dcistrma.h ../include/dcmtk/dcmdata/dcostrma.h \
  ../include/dcmtk/dcmdata/dctagkey.h ../include/dcmtk/dcmdata/dctag.h \
@@ -872,17 +899,19 @@ tspchrs.o: tspchrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -922,17 +951,19 @@ tstrval.o: tstrval.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -974,17 +1005,19 @@ tvrcomp.o: tvrcomp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcvras.h ../include/dcmtk/dcmdata/dcbytstr.h \
  ../include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -1027,17 +1060,19 @@ tvrcomp.o: tvrcomp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/oftime.h \
  ../include/dcmtk/dcmdata/dcvrds.h ../include/dcmtk/dcmdata/dcvris.h \
+ ../include/dcmtk/dcmdata/dcvrod.h ../include/dcmtk/dcmdata/dcvrfd.h \
+ ../include/dcmtk/dcmdata/dcvrof.h ../include/dcmtk/dcmdata/dcvrfl.h \
  ../include/dcmtk/dcmdata/dcvrtm.h ../include/dcmtk/dcmdata/dcvrui.h \
  ../include/dcmtk/dcmdata/dcitem.h ../include/dcmtk/dcmdata/dclist.h \
  ../include/dcmtk/dcmdata/dcpcache.h ../include/dcmtk/dcmdata/dcsequen.h \
- ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrfd.h \
- ../include/dcmtk/dcmdata/dcvrfl.h ../include/dcmtk/dcmdata/dcvrobow.h \
- ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcvrsl.h \
- ../include/dcmtk/dcmdata/dcvrss.h ../include/dcmtk/dcmdata/dcvrul.h \
- ../include/dcmtk/dcmdata/dcvrus.h ../include/dcmtk/dcmdata/dcdeftag.h \
- ../include/dcmtk/dcmdata/dcpxitem.h ../include/dcmtk/dcmdata/dcofsetl.h \
- ../include/dcmtk/dcmdata/dcpixel.h ../include/dcmtk/dcmdata/dcovlay.h \
- ../include/dcmtk/dcmdata/dcpixseq.h
+ ../include/dcmtk/dcmdata/dcvrat.h ../include/dcmtk/dcmdata/dcvrobow.h \
+ ../include/dcmtk/dcmdata/dcvrol.h ../include/dcmtk/dcmdata/dcvrul.h \
+ ../include/dcmtk/dcmdata/dcvrpobw.h ../include/dcmtk/dcmdata/dcvrsh.h \
+ ../include/dcmtk/dcmdata/dcvrsl.h ../include/dcmtk/dcmdata/dcvrss.h \
+ ../include/dcmtk/dcmdata/dcvruc.h ../include/dcmtk/dcmdata/dcvrus.h \
+ ../include/dcmtk/dcmdata/dcdeftag.h ../include/dcmtk/dcmdata/dcpxitem.h \
+ ../include/dcmtk/dcmdata/dcofsetl.h ../include/dcmtk/dcmdata/dcpixel.h \
+ ../include/dcmtk/dcmdata/dcovlay.h ../include/dcmtk/dcmdata/dcpixseq.h
 tvrdatim.o: tvrdatim.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oftest.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
@@ -1048,17 +1083,19 @@ tvrdatim.o: tvrdatim.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -1107,17 +1144,19 @@ tvrds.o: tvrds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -1161,17 +1200,19 @@ tvrfd.o: tvrfd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -1214,17 +1255,19 @@ tvrol.o: tvrol.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -1269,17 +1312,19 @@ tvrpn.o: tvrpn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -1322,17 +1367,19 @@ tvrui.o: tvrui.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmdata/dcuid.h ../include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
index dd5d74a9c441118c15912da91c6f8558f8304ac4..13e690d0b211ace92797849d7a2071bf6d3f50c5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2011, OFFIS e.V.
+ *  Copyright (C) 2011-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -36,6 +36,15 @@ OFTEST(dcmdata_readingDataDictionary)
 
 OFTEST(dcmdata_usingDataDictionary)
 {
+    // All tests run with an DCMDICTPATH external dictionary defined. This test
+    // expects an empty dictionary though, so we disable the DCMDICTPATH
+    // dictionary in this test by unsetting the environment variable.
+#ifdef _WIN32
+    _putenv_s("DCMDICTPATH", "");
+#else
+    setenv("DCMDICTPATH","", 1 /* overwrite */);
+#endif
+
     // This dictionary will only contain the skeleton entries
     DcmDataDictionary localDict(OFFalse, OFFalse);
     DcmDictEntry *entry1;
index 35662dcbf74737bd16f0a0e344dea6d920ca7332..643a9e483521c558e29bff02562c4e649f86895e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, OFFIS e.V.
+ *  Copyright (C) 2017-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -36,16 +36,31 @@ static OFBool test_wildcards( const char* const query, const char* const candida
     return DcmAttributeMatching::wildCardMatching( query, strlen( query ), candidate, strlen( candidate ) );
 }
 
+static OFBool test_date( const char* const query )
+{
+    return DcmAttributeMatching::isDateQuery( query, strlen( query ) );
+}
+
 static OFBool test_date( const char* const query, const char* const candidate )
 {
     return DcmAttributeMatching::rangeMatchingDate( query, strlen( query ), candidate, strlen( candidate ) );
 }
 
+static OFBool test_time( const char* const query )
+{
+    return DcmAttributeMatching::isTimeQuery( query, strlen( query ) );
+}
+
 static OFBool test_time( const char* const query, const char* const candidate )
 {
     return DcmAttributeMatching::rangeMatchingTime( query, strlen( query ), candidate, strlen( candidate ) );
 }
 
+static OFBool test_datetime( const char* const query )
+{
+    return DcmAttributeMatching::isDateTimeQuery( query, strlen( query ) );
+}
+
 static OFBool test_datetime( const char* const query, const char* const candidate )
 {
     return DcmAttributeMatching::rangeMatchingDateTime( query, strlen( query ), candidate, strlen( candidate ) );
@@ -67,6 +82,15 @@ OFTEST(dcmdata_attribute_matching)
     OFCHECK(!test_wildcards( "?ell***?*?l??", "hello world" ));
     OFCHECK(test_wildcards( "?ell*?**?l?*", "hello world" ));
     // date
+    OFCHECK(test_date( "17000101" ));
+    OFCHECK(test_date( "30001010" ));
+    OFCHECK(test_date( "-12000101" ));
+    OFCHECK(test_date( "12451210-" ));
+    OFCHECK(test_date( "20451210-29110114" ));
+    OFCHECK(!test_date( "204512101-29110114" ));
+    OFCHECK(!test_date( "20451210-29110134" ));
+    OFCHECK(!test_date( "3124" ));
+    OFCHECK(!test_date( "2017.05.12" ));
     OFCHECK(test_date( "", "20170224" ));
     OFCHECK(test_date( "1987.08.02", "19870802" ));
     OFCHECK(test_date( "-20000101", "20000101" ));
@@ -79,6 +103,14 @@ OFTEST(dcmdata_attribute_matching)
     OFCHECK(!test_date( "19990101-20000305", "20000306"));
     OFCHECK(!test_date( "19990101-20000305", "122713.114122"));
     // time
+    OFCHECK(test_time( "12" ));
+    OFCHECK(!test_time( "49" ));
+    OFCHECK(!test_time( "12:00:00" ));
+    OFCHECK(test_time( "122413.123456-13" ));
+    OFCHECK(!test_time( "29-13" ));
+    OFCHECK(!test_time( "04-25" ));
+    OFCHECK(test_time( "-231211" ));
+    OFCHECK(test_time( "124222-" ));
     OFCHECK(test_time( "", "120224" ));
     OFCHECK(test_time( "11:23:17.123456", "112317.123456" ));
     OFCHECK(test_time( "-12", "120000" ));
@@ -91,6 +123,15 @@ OFTEST(dcmdata_attribute_matching)
     OFCHECK(!test_time( "11-121428.234763", "121428.234764"));
     OFCHECK(!test_time( "11-121428.234763", "20140909"));
     // datetime
+    OFCHECK(test_datetime( "20170224120224+0100" ));
+    OFCHECK(!test_datetime( "2017224120224+0100" ));
+    OFCHECK(test_datetime( "2017-2018" ));
+    OFCHECK(!test_datetime( "201713-2018" ));
+    OFCHECK(!test_datetime( "2017-201813" ));
+    OFCHECK(test_datetime( "2017-201812" ));
+    OFCHECK(test_datetime( "191712-19991231235959.999999" ));
+    OFCHECK(test_datetime( "19991231235959.999999-" ));
+    OFCHECK(test_datetime( "-20000305173259.123456" ));
     OFCHECK(test_datetime( "", "20170224120224+0100" ));
     OFCHECK(test_datetime( "20170224113224.000000+0030", "20170224120224+0100" ));
     OFCHECK(test_datetime( "-2000", "20000101000000.000000" ));
index a5aad1d9cf02ec99e8ba41ae5e3364bc728b7df6..d995d2a705fdc3426891c594c5496e0401742422 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, Open Connections GmbH
+ *  Copyright (C) 2017-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -43,7 +43,7 @@ void registerPrivateTag()
 {
   DcmDataDictionary &dict = dcmDataDict.wrlock();
   dict.addEntry(new DcmDictEntry(PRIVATE_ELEMENT_STRINGELEM, EVR_LO, "StringAttributeForTesting", 1, 1, "private", OFTrue, PRIVATE_CREATOR_NAME));
-  dcmDataDict.unlock();
+  dcmDataDict.wrunlock();
 
 }
 
index 3ece65776887ace23978432fc8477d67161581ed..52c4270a14c6d889d4474382cb3f98c9885b2dc4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -27,6 +27,7 @@
 #include "dcmtk/ofstd/ofstdinc.h"
 
 #include "dcmtk/ofstd/oftest.h"
+#include "dcmtk/ofstd/ofrand.h"
 #include "dcmtk/dcmdata/dctk.h"
 #include "dcmtk/dcmdata/dcuid.h"       /* for dcmtk version name */
 #include "dcmtk/dcmdata/dcostrmz.h"    /* for dcmZlibCompressionLevel */
@@ -62,7 +63,7 @@ static void createTestDataset(DcmDataset *dset, unsigned char *buffer)
   dset->insert(elem);
 }
 
-static OFCondition sequentialNonOverlappingRead(DcmElement *delem, DcmFileCache *dcache, unsigned char *buffer)
+static OFCondition sequentialNonOverlappingRead(OFRandom& rnd, DcmElement *delem, DcmFileCache *dcache, unsigned char *buffer)
 {
     unsigned char *target = new unsigned char[BUFSIZE];
     Uint32 offset = 0;
@@ -71,7 +72,7 @@ static OFCondition sequentialNonOverlappingRead(DcmElement *delem, DcmFileCache
 
     while (offset < BUFSIZE)
     {
-      bytes_to_read = (rand() % 20)+1;  // read 1 to 20 bytes
+      bytes_to_read = (rnd.getRND32() % 20)+1;  // read 1 to 20 bytes
 
       // make sure we don't attempt to read beyond the end of the attribute value
       if (offset + bytes_to_read > BUFSIZE) bytes_to_read = BUFSIZE - offset;
@@ -113,7 +114,7 @@ static OFCondition sequentialNonOverlappingRead(DcmElement *delem, DcmFileCache
     return EC_Normal;
 }
 
-static OFCondition sequentialOverlappingRead(DcmElement *delem, DcmFileCache *dcache, unsigned char *buffer)
+static OFCondition sequentialOverlappingRead(OFRandom& rnd, DcmElement *delem, DcmFileCache *dcache, unsigned char *buffer)
 {
     unsigned char *target = new unsigned char[BUFSIZE];
     Uint32 offset = 0;
@@ -122,7 +123,7 @@ static OFCondition sequentialOverlappingRead(DcmElement *delem, DcmFileCache *dc
 
     while (offset < BUFSIZE)
     {
-      bytes_to_read = (rand() % 20)+1;  // read 1 to 20 bytes
+      bytes_to_read = (rnd.getRND32() % 20)+1;  // read 1 to 20 bytes
 
       // make sure we don't attempt to read beyond the end of the attribute value
       if (offset + bytes_to_read > BUFSIZE) bytes_to_read = BUFSIZE - offset;
@@ -157,13 +158,13 @@ static OFCondition sequentialOverlappingRead(DcmElement *delem, DcmFileCache *dc
       }
 
       offset += bytes_to_read;
-      if ((offset > 4) && (offset < BUFSIZE)) offset -= (rand() % 4); // let the read operations overlap by 0-3 bytes
+      if ((offset > 4) && (offset < BUFSIZE)) offset -= (rnd.getRND32() % 4); // let the read operations overlap by 0-3 bytes
     }
     delete[] target;
     return EC_Normal;
 }
 
-static OFCondition randomRead(DcmElement *delem, DcmFileCache *dcache, unsigned char *buffer)
+static OFCondition randomRead(OFRandom& rnd, DcmElement *delem, DcmFileCache *dcache, unsigned char *buffer)
 {
     unsigned char *target = new unsigned char[BUFSIZE];
     Uint32 offset = 0;
@@ -172,8 +173,8 @@ static OFCondition randomRead(DcmElement *delem, DcmFileCache *dcache, unsigned
 
     for (int i=1000; i; --i)
     {
-      bytes_to_read = (rand() % 20)+1;  // read 1 to 20 bytes
-      offset = rand() % BUFSIZE;
+      bytes_to_read = (rnd.getRND32() % 20)+1;  // read 1 to 20 bytes
+      offset = rnd.getRND32() % BUFSIZE;
 
       // make sure we don't attempt to read beyond the end of the attribute value
       if (offset + bytes_to_read > BUFSIZE) bytes_to_read = BUFSIZE - offset;
@@ -213,7 +214,7 @@ static OFCondition randomRead(DcmElement *delem, DcmFileCache *dcache, unsigned
     return EC_Normal;
 }
 
-static OFCondition sequentialNonOverlappingRead(DcmDataset *dset, unsigned char *buffer)
+static OFCondition sequentialNonOverlappingRead(OFRandom& rnd, DcmDataset *dset, unsigned char *buffer)
 {
   DcmFileCache cache;
   DcmElement *delem = NULL;
@@ -222,30 +223,30 @@ static OFCondition sequentialNonOverlappingRead(DcmDataset *dset, unsigned char
   cond = dset->findAndGetElement(DCM_EncapsulatedDocument, delem);
   if (cond.bad()) return cond;
 
-  cond = sequentialNonOverlappingRead(delem, &cache, buffer);
+  cond = sequentialNonOverlappingRead(rnd, delem, &cache, buffer);
   if (cond.bad()) return cond;
 
   cond = dset->findAndGetElement(DCM_RWavePointer, delem);
   if (cond.bad()) return cond;
 
-  cond = sequentialNonOverlappingRead(delem, &cache, buffer);
+  cond = sequentialNonOverlappingRead(rnd, delem, &cache, buffer);
   if (cond.bad()) return cond;
 
   cond = dset->findAndGetElement(DCM_TableOfPixelValues, delem);
   if (cond.bad()) return cond;
 
-  cond = sequentialNonOverlappingRead(delem, &cache, buffer);
+  cond = sequentialNonOverlappingRead(rnd, delem, &cache, buffer);
   if (cond.bad()) return cond;
 
   cond = dset->findAndGetElement(DCM_TableOfYBreakPoints, delem);
   if (cond.bad()) return cond;
 
-  cond = sequentialNonOverlappingRead(delem, &cache, buffer);
+  cond = sequentialNonOverlappingRead(rnd, delem, &cache, buffer);
 
   return cond;
 }
 
-static OFCondition sequentialOverlappingRead(DcmDataset *dset, unsigned char *buffer)
+static OFCondition sequentialOverlappingRead(OFRandom& rnd, DcmDataset *dset, unsigned char *buffer)
 {
   DcmFileCache cache;
   DcmElement *delem = NULL;
@@ -254,30 +255,30 @@ static OFCondition sequentialOverlappingRead(DcmDataset *dset, unsigned char *bu
   cond = dset->findAndGetElement(DCM_EncapsulatedDocument, delem);
   if (cond.bad()) return cond;
 
-  cond = sequentialOverlappingRead(delem, &cache, buffer);
+  cond = sequentialOverlappingRead(rnd, delem, &cache, buffer);
   if (cond.bad()) return cond;
 
   cond = dset->findAndGetElement(DCM_RWavePointer, delem);
   if (cond.bad()) return cond;
 
-  cond = sequentialOverlappingRead(delem, &cache, buffer);
+  cond = sequentialOverlappingRead(rnd, delem, &cache, buffer);
   if (cond.bad()) return cond;
 
   cond = dset->findAndGetElement(DCM_TableOfPixelValues, delem);
   if (cond.bad()) return cond;
 
-  cond = sequentialOverlappingRead(delem, &cache, buffer);
+  cond = sequentialOverlappingRead(rnd, delem, &cache, buffer);
   if (cond.bad()) return cond;
 
   cond = dset->findAndGetElement(DCM_TableOfYBreakPoints, delem);
   if (cond.bad()) return cond;
 
-  cond = sequentialOverlappingRead(delem, &cache, buffer);
+  cond = sequentialOverlappingRead(rnd, delem, &cache, buffer);
 
   return cond;
 }
 
-static OFCondition randomRead(DcmDataset *dset, unsigned char *buffer)
+static OFCondition randomRead(OFRandom& rnd, DcmDataset *dset, unsigned char *buffer)
 {
   DcmFileCache cache;
   DcmElement *delem = NULL;
@@ -286,25 +287,25 @@ static OFCondition randomRead(DcmDataset *dset, unsigned char *buffer)
   cond = dset->findAndGetElement(DCM_EncapsulatedDocument, delem);
   if (cond.bad()) return cond;
 
-  cond = randomRead(delem, &cache, buffer);
+  cond = randomRead(rnd, delem, &cache, buffer);
   if (cond.bad()) return cond;
 
   cond = dset->findAndGetElement(DCM_RWavePointer, delem);
   if (cond.bad()) return cond;
 
-  cond = randomRead(delem, &cache, buffer);
+  cond = randomRead(rnd, delem, &cache, buffer);
   if (cond.bad()) return cond;
 
   cond = dset->findAndGetElement(DCM_TableOfPixelValues, delem);
   if (cond.bad()) return cond;
 
-  cond = randomRead(delem, &cache, buffer);
+  cond = randomRead(rnd, delem, &cache, buffer);
   if (cond.bad()) return cond;
 
   cond = dset->findAndGetElement(DCM_TableOfYBreakPoints, delem);
   if (cond.bad()) return cond;
 
-  cond = randomRead(delem, &cache, buffer);
+  cond = randomRead(rnd, delem, &cache, buffer);
 
   return cond;
 }
@@ -321,14 +322,14 @@ OFTEST(dcmdata_partialElementAccess)
 
     OFLOG_DEBUG(tstpreadLogger, "Creating test dataset");
 
+    OFRandom rnd;
     DcmFileFormat dfile;
 
     unsigned char *buffer = new unsigned char[BUFSIZE];
     unsigned char *bufptr = buffer;
-    srand(OFstatic_cast(unsigned int, time(NULL)));
     for (int i = BUFSIZE; i; --i)
     {
-      *bufptr++ = OFstatic_cast(unsigned char, rand());
+      *bufptr++ = OFstatic_cast(unsigned char, rnd.getRND32());
     }
 
     createTestDataset(dfile.getDataset(), buffer);
@@ -365,42 +366,42 @@ OFTEST(dcmdata_partialElementAccess)
     // testing sequential, non overlapping reads of partial element values
     OFLOG_DEBUG(tstpreadLogger, "Testing sequential, non overlapping reads of partial element values");
 
-    cond = sequentialNonOverlappingRead(dfile_be.getDataset(), buffer);
+    cond = sequentialNonOverlappingRead(rnd, dfile_be.getDataset(), buffer);
     if (cond.bad()) { OFCHECK_FAIL(cond.text()); }
 
-    cond = sequentialNonOverlappingRead(dfile_le.getDataset(), buffer);
+    cond = sequentialNonOverlappingRead(rnd, dfile_le.getDataset(), buffer);
     if (cond.bad()) { OFCHECK_FAIL(cond.text()); }
 
 #ifdef WITH_ZLIB
-    cond = sequentialNonOverlappingRead(dfile_df.getDataset(), buffer);
+    cond = sequentialNonOverlappingRead(rnd, dfile_df.getDataset(), buffer);
     if (cond.bad()) { OFCHECK_FAIL(cond.text()); }
 #endif
 
     // testing random reads of partial element values
     OFLOG_DEBUG(tstpreadLogger, "Testing random reads of partial element values");
 
-    cond = randomRead(dfile_be.getDataset(), buffer);
+    cond = randomRead(rnd, dfile_be.getDataset(), buffer);
     if (cond.bad()) { OFCHECK_FAIL(cond.text()); }
 
-    cond = randomRead(dfile_le.getDataset(), buffer);
+    cond = randomRead(rnd, dfile_le.getDataset(), buffer);
     if (cond.bad()) { OFCHECK_FAIL(cond.text()); }
 
 #ifdef WITH_ZLIB
-    cond = randomRead(dfile_df.getDataset(), buffer);
+    cond = randomRead(rnd, dfile_df.getDataset(), buffer);
     if (cond.bad()) { OFCHECK_FAIL(cond.text()); }
 #endif
 
     // testing overlapping reads of partial element values
     OFLOG_DEBUG(tstpreadLogger, "Testing overlapping reads of partial element values");
 
-    cond = sequentialOverlappingRead(dfile_be.getDataset(), buffer);
+    cond = sequentialOverlappingRead(rnd, dfile_be.getDataset(), buffer);
     if (cond.bad()) { OFCHECK_FAIL(cond.text()); }
 
-    cond = sequentialOverlappingRead(dfile_le.getDataset(), buffer);
+    cond = sequentialOverlappingRead(rnd, dfile_le.getDataset(), buffer);
     if (cond.bad()) { OFCHECK_FAIL(cond.text()); }
 
 #ifdef WITH_ZLIB
-    cond = sequentialOverlappingRead(dfile_df.getDataset(), buffer);
+    cond = sequentialOverlappingRead(rnd, dfile_df.getDataset(), buffer);
     if (cond.bad()) { OFCHECK_FAIL(cond.text()); }
 #endif
 
index a430c1e0092dd8ab1336a6d13a2b96bb3cc8561f..00164d75a85af789ce502c0c2a07693c22bbe07c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, OFFIS e.V.
+ *  Copyright (C) 2015-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -38,6 +38,8 @@
 #include "dcmtk/dcmdata/dcvrdt.h"
 #include "dcmtk/dcmdata/dcvrds.h"
 #include "dcmtk/dcmdata/dcvris.h"
+#include "dcmtk/dcmdata/dcvrod.h"
+#include "dcmtk/dcmdata/dcvrof.h"
 #include "dcmtk/dcmdata/dcvrtm.h"
 #include "dcmtk/dcmdata/dcvrui.h"
 #include "dcmtk/dcmdata/dcelem.h"
 #include "dcmtk/dcmdata/dcvrfd.h"
 #include "dcmtk/dcmdata/dcvrfl.h"
 #include "dcmtk/dcmdata/dcvrobow.h"
+#include "dcmtk/dcmdata/dcvrol.h"
 #include "dcmtk/dcmdata/dcvrpobw.h"
+#include "dcmtk/dcmdata/dcvrsh.h"
 #include "dcmtk/dcmdata/dcvrsl.h"
 #include "dcmtk/dcmdata/dcvrss.h"
+#include "dcmtk/dcmdata/dcvrtm.h"
+#include "dcmtk/dcmdata/dcvruc.h"
 #include "dcmtk/dcmdata/dcvrul.h"
 #include "dcmtk/dcmdata/dcvrus.h"
 #include "dcmtk/dcmdata/dcdeftag.h"
 #include "dcmtk/dcmdata/dcpixseq.h"
 
 
-template <typename ByteStringType>
-static void checkByteString(const DcmTagKey& key)
+template <typename StringType>
+static void checkStringBased(
+    const DcmTagKey& key,
+    const OFString& vrName,
+    const OFString shortVal,
+    const OFString longVal)
 {
-  // Start with equal values
-  OFString val1 = "TEST";
-  OFString val2 = "TEST";
-  ByteStringType obj1(key);
-  ByteStringType obj2(key);
-  ByteStringType objOtherTag(DCM_UndefinedTagKey);
-
-  // Check equality
-  obj1.putOFStringArray("TEST");
-  obj2.putOFStringArray("TEST");
-  OFCHECK_EQUAL(obj1.compare(obj2), 0);
-  OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) );
-  // Reverse test should yield same result
-  OFCHECK_EQUAL(obj2.compare(obj1), 0);
-  OFCHECK( (obj2 >= obj1) && (obj1 >= obj2) );
-
-  // Check differing tags (DCM_UndefinedTagKey always smaller than any other key)
-  objOtherTag.putOFStringArray("TEST" /* same value*/);
-  OFCHECK(obj1.compare(objOtherTag) < 0);
-  OFCHECK(obj1 < objOtherTag);
-  OFCHECK(obj1 <= objOtherTag);
-  // Reverse test should yield opposite result
-  OFCHECK(objOtherTag.compare(obj1) > 0);
-  OFCHECK(objOtherTag > obj1);
-  OFCHECK(objOtherTag >= obj1);
-
-  // Check second string longer
-  obj2.putOFStringArray("TEST_LONG");
-  OFCHECK(obj1.compare(obj2) < 0);
-  OFCHECK(obj1 < obj2);
-  OFCHECK(obj1 <= obj2);
-  // Reverse test should yield opposite result
-  OFCHECK(obj2.compare(obj1) > 0);
-  OFCHECK(obj2 > obj1);
-  OFCHECK(obj2 >= obj1);
-
-  // Test different VM
-  obj1.putOFStringArray("TEST\\TEST");
-  obj2.putOFStringArray("TEST\\TEST\\TEST");
-  OFCHECK(obj1.compare(obj2) < 0);
-  OFCHECK(obj1 < obj2);
-  OFCHECK(obj1 <= obj2);
-  // Reverse test should yield opposite result
-  OFCHECK(obj2.compare(obj1) > 0);
-  OFCHECK(obj2 > obj1);
-  OFCHECK(obj2 >= obj1);
+    // Start with equal values
+    OFString val1 = shortVal;
+    OFString val2 = shortVal;
+    StringType obj1(key);
+    StringType obj2(key);
+    StringType objOtherTag(DCM_UndefinedTagKey);
+
+    // Check equality
+    obj1.putOFStringArray(shortVal);
+    obj2.putOFStringArray(shortVal);
+    OFCHECK_EQUAL(obj1.compare(obj2), 0);
+    OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) );
+    // Reverse test should yield same result
+    OFCHECK_EQUAL(obj2.compare(obj1), 0);
+    OFCHECK( (obj2 >= obj1) && (obj1 >= obj2) );
+
+    // Check differing tags (DCM_UndefinedTagKey always smaller than any other key)
+    objOtherTag.putOFStringArray(shortVal /* same value*/);
+    OFCHECK(obj1.compare(objOtherTag) < 0);
+    OFCHECK(obj1 < objOtherTag);
+    OFCHECK(obj1 <= objOtherTag);
+    // Reverse test should yield opposite result
+    OFCHECK(objOtherTag.compare(obj1) > 0);
+    OFCHECK(objOtherTag > obj1);
+    OFCHECK(objOtherTag >= obj1);
+
+    // Check second string longer
+    obj2.putOFStringArray(longVal);
+    OFCHECK(obj1.compare(obj2) < 0);
+    OFCHECK(obj1 < obj2);
+    OFCHECK(obj1 <= obj2);
+    // Reverse test should yield opposite result
+    OFCHECK(obj2.compare(obj1) > 0);
+    OFCHECK(obj2 > obj1);
+    OFCHECK(obj2 >= obj1);
+
+    // Test different number of values
+    OFString twoValues, threeValues;
+    twoValues = shortVal + "\\"; twoValues += shortVal;
+    threeValues = twoValues + "\\"; threeValues += shortVal;
+    obj1.putOFStringArray(twoValues);
+    obj2.putOFStringArray(threeValues);
+    OFCHECK(obj1.compare(obj2) < 0);
+    OFCHECK(obj1 < obj2);
+    OFCHECK(obj1 <= obj2);
+    // Reverse test should yield opposite result
+    OFCHECK(obj2.compare(obj1) > 0);
+    OFCHECK(obj2 > obj1);
+    OFCHECK(obj2 >= obj1);
 }
 
 
 static void checkAttributeTags()
 {
-  // Start with equal values
-  DcmAttributeTag obj1(DCM_FrameIncrementPointer);
-  DcmAttributeTag obj2(DCM_FrameIncrementPointer);
-  DcmAttributeTag objOtherTag(DCM_UndefinedTagKey);
-
-  // Check equality
-  obj1.putTagVal(DCM_PatientName);
-  obj2.putTagVal(DCM_PatientName);
-  OFCHECK_EQUAL(obj1.compare(obj2), 0);
-  OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) );
-  // Reverse test should yield same result
-  OFCHECK_EQUAL(obj2.compare(obj1), 0);
-  OFCHECK( (obj2 >= obj1) && (obj1 >= obj2) );
-
-  // Check differing tags (DCM_UndefinedTagKey always smaller than any other key)
-  objOtherTag.putTagVal(DCM_PatientName);
-  OFCHECK(obj1.compare(objOtherTag) < 0);
-  OFCHECK(obj1 < objOtherTag);
-  OFCHECK(obj1 <= objOtherTag);
-  // Reverse test should yield opposite result
-  OFCHECK(objOtherTag.compare(obj1) > 0);
-  OFCHECK(objOtherTag > obj1);
-  OFCHECK(objOtherTag >= obj1);
-
-  // Check second attribute larger
-  obj2.putTagVal(DCM_PatientID);
-  OFCHECK(obj1.compare(obj2) < 0);
-  OFCHECK(obj1 < obj2);
-  OFCHECK(obj1 <= obj2);
-  // Reverse test should yield opposite result
-  OFCHECK(obj2.compare(obj1) > 0);
-  OFCHECK(obj2 > obj1);
-  OFCHECK(obj2 >= obj1);
-
-  // Test different VM
-  obj1.putTagVal(DCM_PatientName, 1); // VM = 2
-  obj2.putTagVal(DCM_PatientName, 0);
-  obj2.putTagVal(DCM_PatientName, 1);
-  obj2.putTagVal(DCM_PatientName, 2); // VM = 3
-
-  OFCHECK(obj1.compare(obj2) < 0);
-  OFCHECK(obj1 < obj2);
-  OFCHECK(obj1 <= obj2);
-  // Reverse test should yield opposite result
-  OFCHECK(obj2.compare(obj1) > 0);
-  OFCHECK(obj2 > obj1);
-  OFCHECK(obj2 >= obj1);
-}
-
-
-static void checkFloatingPointDouble()
-{
-  // Start with equal values
-  DcmFloatingPointDouble obj1(DCM_RealWorldValueLUTData);
-  DcmFloatingPointDouble obj2(DCM_RealWorldValueLUTData);
-  DcmFloatingPointDouble objOtherTag(DCM_UndefinedTagKey);
-
-  // Check equality
-  obj1.putFloat64(10.0);
-  obj2.putFloat64(10.0);
-  OFCHECK_EQUAL(obj1.compare(obj2), 0);
-  OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) );
-  // Reverse test should yield same result
-  OFCHECK_EQUAL(obj2.compare(obj1), 0);
-  OFCHECK( (obj2 >= obj2) && (obj1 >= obj1) );
-
-  // Check differing tags (DCM_UndefinedTagKey always smaller than any other key)
-  objOtherTag.putFloat64(10.0);
-  OFCHECK(obj1.compare(objOtherTag) < 0);
-  OFCHECK(obj1 < objOtherTag);
-  OFCHECK(obj1 <= objOtherTag);
-  // Reverse test should yield opposite result
-  OFCHECK(objOtherTag.compare(obj1) > 0);
-  OFCHECK(objOtherTag > obj1);
-  OFCHECK(objOtherTag >= obj1);
-
-  // Check second attribute larger
-  obj2.putFloat64(100.50);
-  OFCHECK(obj1.compare(obj2) < 0);
-  OFCHECK(obj1 < obj2);
-  OFCHECK(obj1 <= obj2);
-  // Reverse test should yield opposite result
-  OFCHECK(obj2.compare(obj1) > 0);
-  OFCHECK(obj2 > obj1);
-  OFCHECK(obj2 >= obj1);
-
-  // Test different VM
-  obj1.putFloat64(10.0);     // VM = 2
-  obj2.putFloat64(10.0, 0);
-  obj2.putFloat64(10.0, 1);
-  obj2.putFloat64(10.0, 2); // VM = 3
-
-  OFCHECK(obj1.compare(obj2) < 0);
-  OFCHECK(obj1 < obj2);
-  OFCHECK(obj1 <= obj2);
-  // Reverse test should yield opposite result
-  OFCHECK(obj2.compare(obj1) > 0);
-  OFCHECK(obj2 > obj1);
-  OFCHECK(obj2 >= obj1);
+    // Start with equal values
+    DcmAttributeTag obj1(DCM_FrameIncrementPointer);
+    DcmAttributeTag obj2(DCM_FrameIncrementPointer);
+    DcmAttributeTag objOtherTag(DCM_UndefinedTagKey);
+
+    // Check equality
+    obj1.putTagVal(DCM_PatientName);
+    obj2.putTagVal(DCM_PatientName);
+    OFCHECK_EQUAL(obj1.compare(obj2), 0);
+    OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) );
+    // Reverse test should yield same result
+    OFCHECK_EQUAL(obj2.compare(obj1), 0);
+    OFCHECK( (obj2 >= obj1) && (obj1 >= obj2) );
+
+    // Check differing tags (DCM_UndefinedTagKey always smaller than any other key)
+    objOtherTag.putTagVal(DCM_PatientName);
+    OFCHECK(obj1.compare(objOtherTag) < 0);
+    OFCHECK(obj1 < objOtherTag);
+    OFCHECK(obj1 <= objOtherTag);
+    // Reverse test should yield opposite result
+    OFCHECK(objOtherTag.compare(obj1) > 0);
+    OFCHECK(objOtherTag > obj1);
+    OFCHECK(objOtherTag >= obj1);
+
+    // Check second attribute larger
+    obj2.putTagVal(DCM_PatientID);
+    OFCHECK(obj1.compare(obj2) < 0);
+    OFCHECK(obj1 < obj2);
+    OFCHECK(obj1 <= obj2);
+    // Reverse test should yield opposite result
+    OFCHECK(obj2.compare(obj1) > 0);
+    OFCHECK(obj2 > obj1);
+    OFCHECK(obj2 >= obj1);
+
+    // Test different VM
+    obj1.putTagVal(DCM_PatientName, 1); // VM = 2
+    obj2.putTagVal(DCM_PatientName, 0);
+    obj2.putTagVal(DCM_PatientName, 1);
+    obj2.putTagVal(DCM_PatientName, 2); // VM = 3
+
+    OFCHECK(obj1.compare(obj2) < 0);
+    OFCHECK(obj1 < obj2);
+    OFCHECK(obj1 <= obj2);
+    // Reverse test should yield opposite result
+    OFCHECK(obj2.compare(obj1) > 0);
+    OFCHECK(obj2 > obj1);
+    OFCHECK(obj2 >= obj1);
 }
 
 
-static void checkFloatingPointSingle()
-{
-  // Start with equal values
-  DcmFloatingPointSingle obj1(DCM_CornealPointLocation);
-  DcmFloatingPointSingle obj2(DCM_CornealPointLocation);
-  DcmFloatingPointSingle objOtherTag(DCM_UndefinedTagKey);
-
-  // Check equality
-  obj1.putFloat32(10.0);
-  obj2.putFloat32(10.0);
-  OFCHECK_EQUAL(obj1.compare(obj2), 0);
-  OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) );
-  // Reverse test should yield same result
-  OFCHECK_EQUAL(obj2.compare(obj1), 0);
-  OFCHECK( (obj2 >= obj1) && (obj1 >= obj2) );
-
-  // Check differing tags (DCM_UndefinedTagKey always smaller than any other key)
-  objOtherTag.putFloat32(10.0);
-  OFCHECK(obj1.compare(objOtherTag) < 0);
-  OFCHECK(obj1 < objOtherTag);
-  OFCHECK(obj1 <= objOtherTag);
-  // Reverse test should yield opposite result
-  OFCHECK(objOtherTag.compare(obj1) > 0);
-  OFCHECK(objOtherTag > obj1);
-  OFCHECK(objOtherTag >= obj1);
-
-  // Check second attribute larger
-  obj2.putFloat32(100.50);
-  OFCHECK(obj1.compare(obj2) < 0);
-  OFCHECK(obj1 < obj2);
-  OFCHECK(obj1 <= obj2);
-  // Reverse test should yield opposite result
-  OFCHECK(obj2.compare(obj1) > 0);
-  OFCHECK(obj2 > obj1);
-  OFCHECK(obj2 >= obj1);
-
-  // Test different VM
-  obj1.putFloat32(10.0);     // VM = 2
-  obj2.putFloat32(10.0, 0);
-  obj2.putFloat32(10.0, 1);
-  obj2.putFloat32(10.0, 2); // VM = 3
-
-  OFCHECK(obj1.compare(obj2) < 0);
-  OFCHECK(obj1 < obj2);
-  OFCHECK(obj1 <= obj2);
-  // Reverse test should yield opposite result
-  OFCHECK(obj2.compare(obj1) > 0);
-  OFCHECK(obj2 > obj1);
-  OFCHECK(obj2 >= obj1);
-}
-
 static void checkOtherByteOtherWord()
 {
   // Start with equal values
@@ -808,6 +718,60 @@ static void checkUnsignedShort()
 }
 
 
+
+static void checkOtherLong()
+{
+  // Start with equal values
+  DcmOtherLong obj1(DCM_LongTrianglePointIndexList);
+  DcmOtherLong obj2(DCM_LongTrianglePointIndexList);
+  DcmOtherLong objOtherTag(DCM_UndefinedTagKey);
+
+  // Check equality
+  obj1.putUint32(100000);
+  obj2.putUint32(100000);
+  OFCHECK_EQUAL(obj1.compare(obj2), 0);
+  OFCHECK( (obj1 <= obj2) && (obj2 <= obj1) );
+  // Reverse test should yield same result
+  OFCHECK_EQUAL(obj2.compare(obj1), 0);
+  OFCHECK( (obj2 >= obj2) && (obj1 >= obj2) );
+
+  // Check differing tags (DCM_UndefinedTagKey always smaller than any other key)
+  objOtherTag.putUint32(100000);
+  OFCHECK(obj1.compare(objOtherTag) < 0);
+  OFCHECK(obj1 < objOtherTag);
+  OFCHECK(obj1 <= objOtherTag);
+  // Reverse test should yield opposite result
+  OFCHECK(objOtherTag.compare(obj1) > 0);
+  OFCHECK(objOtherTag > obj1);
+  OFCHECK(objOtherTag >= obj1);
+
+  // Check second attribute larger
+  obj2.putUint32(200000);
+  OFCHECK(obj1.compare(obj2) < 0);
+  OFCHECK(obj1 < obj2);
+  OFCHECK(obj1 <= obj2);
+  // Reverse test should yield opposite result
+  OFCHECK(obj2.compare(obj1) > 0);
+  OFCHECK(obj2 > obj1);
+  OFCHECK(obj2 >= obj1);
+
+  // Test different VM
+  obj1.putUint32(100000);     // VM = 2
+  obj2.putUint32(100000, 0);
+  obj2.putUint32(100000, 1);
+  obj2.putUint32(100000, 2); // VM = 3
+
+  OFCHECK(obj1.compare(obj2) < 0);
+  OFCHECK(obj1 < obj2);
+  OFCHECK(obj1 <= obj2);
+  // Reverse test should yield opposite result
+  OFCHECK(obj2.compare(obj1) > 0);
+  OFCHECK(obj2 > obj1);
+  OFCHECK(obj2 >= obj1);
+}
+
+
+
 static void checkDcmItemAndSequences()
 {
   // Start with equal values
@@ -883,28 +847,48 @@ static void checkDcmItemAndSequences()
 
 OFTEST(dcmdata_VRCompare)
 {
-  // Check the different VRs implemented by DcmByteString.
-  // We gracefully ignore the maximum VM here since there is not
-  // even an attribute (e.g.) at the moment which is of VR
-  // AS and has a VM >1.
-  checkByteString<DcmAgeString>(DCM_PatientAge);
-  checkByteString<DcmApplicationEntity>(DCM_RetrieveAETitle);
-  checkByteString<DcmLongString>(DCM_SeriesDescription);
-  checkByteString<DcmLongText>(DCM_AdditionalPatientHistory);
-  checkByteString<DcmPersonName>(DCM_OtherPatientNames);
-  checkByteString<DcmShortText>(DCM_RTPlanDescription);
-  checkByteString<DcmUnlimitedText>(DCM_RetrieveURL);
-  // Check the rest
-  checkAttributeTags();
-  checkFloatingPointDouble();
-  checkFloatingPointSingle();
-  checkOtherByteOtherWord();
-  checkPolymorphOtherByteOtherWord();
-  checkDcmPixelDataNative();
-  checkDcmPixelDataEncapsulatedOB();
-  checkSignedLong();
-  checkSignedShort();
-  checkUnsignedLong();
-  checkUnsignedShort();
-  checkDcmItemAndSequences();
+    // Check the different String-based VRs (in the sense that the method
+    // putAndInsertOFStringArray() can be used by the test method for initializing
+    // the test values.
+    // This applies to: AE, AS, CS, DA, DS, DT, FD, FL, IS, LO, LT, OD, OF,PN, SH, ST,
+    // TM, UC, UI, UT,
+    // Sometimes the maximum length of the VR is exceed deliberately to perform the test,
+    // which is even useful since on that level DCMTK allows invalid values
+    // in order to handle incorrect datasets.
+    checkStringBased<DcmApplicationEntity>(DCM_RetrieveAETitle, "AE", "AE1", "AE1_CT");
+    checkStringBased<DcmAgeString>(DCM_PatientAge, "AS", "008Y", "008YY");
+    checkStringBased<DcmCodeString>(DCM_BlendingMode, "CS", "SOME", "SOME_LONGER");
+    checkStringBased<DcmDate>(DCM_StudyDate, "DA", "19771212", "1977121200");
+    checkStringBased<DcmDecimalString>(DCM_ProcedureStepProgress, "DS", "0.0", "0.01");
+    checkStringBased<DcmDateTime>(DCM_SOPAuthorizationDateTime, "DT", "19771212235900", "19771212235900.123456");
+    checkStringBased<DcmFloatingPointDouble>(DCM_BeamDeliveryDurationLimit, "FD", "10", "10.5");
+    checkStringBased<DcmFloatingPointSingle>(DCM_IsocenterToWedgeTrayDistance, "FL", "10", "10.5");
+    checkStringBased<DcmIntegerString>(DCM_NumberOfWedges, "IS", "100", "1000");
+    checkStringBased<DcmLongString>(DCM_SeriesDescription, "LO", "Description", "Description Long");
+    checkStringBased<DcmLongText>(DCM_AdditionalPatientHistory, "LT", "Text", "Text Long");
+    checkStringBased<DcmOtherDouble>(DCM_DoubleFloatPixelData, "OD", "10", "10.5");
+    checkStringBased<DcmOtherFloat>(DCM_FloatPixelData, "OF", "10", "10.5");
+    checkStringBased<DcmPersonName>(DCM_OtherPatientNames, "PN", "Bond^James", "Bond^James^Jürgen");
+    checkStringBased<DcmShortString>(DCM_WedgeID, "SH", "WEDGE1", "WEDGE1_LONG");
+    checkStringBased<DcmShortText>(DCM_RTPlanDescription, "ST", "Text", "Text Long");
+    checkStringBased<DcmTime>(DCM_StudyTime, "TM", "235959", "235959.123456");
+    checkStringBased<DcmUnlimitedCharacters>(DCM_LongCodeValue, "UC", "Code_0815", "Code_0815_4711");
+    checkStringBased<DcmUniqueIdentifier>(DCM_SOPInstanceUID, "UI", "1.2.3.4", "1.2.3.4.5");
+    checkStringBased<DcmUnlimitedText>(DCM_RetrieveURL, "UR", "http://wwww.dcmtk.org", "http://www.dcmtk.org/dcmtk.php.en");
+
+    // Check the rest
+    checkAttributeTags();
+    checkOtherByteOtherWord();
+    checkPolymorphOtherByteOtherWord();
+    checkOtherLong();
+    checkSignedLong();
+    checkSignedShort();
+    checkDcmItemAndSequences();
+    checkUnsignedLong();
+    checkUnsignedShort();
+    // Special VR helper classes:
+    checkDcmPixelDataNative();
+    checkDcmPixelDataEncapsulatedOB();
+    // UN is not represented by its own class but is handled by OB/OW VR
+    // code
 }
index 96d2bfdb5f7bd123054ada36b9bda6f2a2fd43d3..d08ca6c145fe4318b626a1f9f6b0c8131f508692 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, OFFIS e.V.
+ *  Copyright (C) 2016-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -43,9 +43,6 @@ OFTEST(dcmdata_otherLong)
     OFCHECK(otherLong.putUint32(999999999, 8).good());
     /* value multiplicity should always be 1 */
     OFCHECK_EQUAL(otherLong.getVM(), 1);
-    /* get value as an array and check number of entries */
-    Uint32 *uintVals = NULL;
-    OFCHECK(otherLong.getUint32Array(uintVals).good());
-    OFCHECK(uintVals != NULL);
-    OFCHECK_EQUAL(otherLong.getLengthField() / sizeof(Uint32), 9);
+    /* number of values should be higher */
+    OFCHECK_EQUAL(otherLong.getNumberOfValues(), 9);
 }
index 4e83bcfd6f16985b9a5d313cb2dfd095d850ceb0..e131a0c0bb724570400c0ba570747f02b6891cd1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2011, OFFIS e.V.
+ *  Copyright (C) 2011-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -34,12 +34,14 @@ OFTEST(dcmdata_uniqueIdentifier_1)
   DcmUniqueIdentifier sopInstanceUID(DCM_SOPInstanceUID);
   dcmEnableAutomaticInputDataCorrection.set(OFTrue);
   OFCHECK(sopInstanceUID.putString("1.2.3.4\0", 8).good());
+  OFCHECK_EQUAL(sopInstanceUID.getNumberOfValues(), 1);
   OFCHECK(sopInstanceUID.checkValue("1").good());
   OFCHECK(sopInstanceUID.getOFString(value, 0).good());
   OFCHECK_EQUAL(value, "1.2.3.4");
   // switch automatic data correct off
   dcmEnableAutomaticInputDataCorrection.set(OFFalse);
   OFCHECK(sopInstanceUID.putString("1.2.3.4\\5.6.7.8").good());
+  OFCHECK_EQUAL(sopInstanceUID.getNumberOfValues(), 2);
   OFCHECK(sopInstanceUID.checkValue("2").good());
   OFCHECK(sopInstanceUID.putString("1.2.3.4\\5.6.7.8\0", 16).good());
   // the trailing 0-byte is still there, which leads to an error
index 725d7916dc63f840ed8abf0a703985b68a8f9fd8..bbd221b6038a605e8342db793acbe302fcf2ba95 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmfg)
+project(dcmfg)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmfg_SOURCE_DIR}/include"  "${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
+include_directories("${dcmfg_SOURCE_DIR}/include"  "${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc include)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc include)
+  add_subdirectory(${SUBDIR})
+endforeach()
index a8480bd5be354ca603069307e44c80b6c3ac90cd..26c255ee4b15f704eb06fc8da361b72d7873a137 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmfg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmfg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 7207159571bec013f935a2f930a3758c171a3386..4d1645d9bfd0cf3fee43403b0424ac3dcf3e88ab 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -172,6 +172,17 @@ public:
   FGUnknown(const DcmTagKey& seqStartTag,
             const DcmFGTypes::E_FGSharedType sharedType = DcmFGTypes::EFGS_UNKNOWN);
 
+  /** Copy constructor, performs a deep copy of the given object.
+   *  @param rhs The functional group to initialize from
+   */
+  FGUnknown(const FGUnknown& rhs);
+
+  /** Assignment operator, performs a deep copy for assigning given object.
+   *  @param  rhs The functional group to assign from
+   *  @return Reference to this object
+   */
+  FGUnknown& operator=(const FGUnknown& rhs);
+
   /** Returns type of this functional group (always "EFG_UNKNOWN")
    *  @return Always returns DcmFGTypes::EFG_UNKNOWN
    */
index ba2c3da77c9144847316ac74eaa4f54b78a3eddf..294e93fb8f4e99e284074d59c4d9abfa799907e3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -68,7 +68,12 @@ public:
    */
   virtual void clear();
 
-  /** Checks the functional groups for consistency
+  /** Checks the functional groups for consistency. The following checks are
+   *  performed:
+   *    -# Check that every frame has a FrameContent functional group.
+   *    -# Check that any per-frame group is not shared at the same time.
+   *    -# Check for each per-frame group, that it is allowed to be per-frame.
+   *    -# Check for each shared group, that it is allowed to be shared.
    *  @return OFTrue, if check consistency is ok, error otherwise
    */
   virtual OFBool check();
index c75a4acb444486d322ac47d9c68686683bd11e13..f790cb7a773b1eaf38a6d4a314614e4ce58a9892 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -44,6 +44,13 @@ extern DCMTK_DCMFG_EXPORT OFLogger DCM_dcmfgLogger;
 #define DCMFG_FATAL(msg) OFLOG_FATAL(DCM_dcmfgLogger, msg)
 
 
+// include this file in doxygen documentation
+
+/** @file fgtypes.h
+ *  @brief type definitions, constants and helper functions for the dcmfg module
+ */
+
+
 /*-----------------------*
  *  constant definitions  *
  *-----------------------*/
index 0b560b3c5946a51c0afc0e827d2d02d51b3a2c54..9c929c70649f79035c3f6a3e37b30076d4af6ff9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -70,4 +70,4 @@ private:
   OFMap<OFString, FGStack*> m_Stacks;
 };
 
-#endif // STACKINTERFACE_H
\ No newline at end of file
+#endif // STACKINTERFACE_H
index 4dbc1ecf3a8a3aa85b26bf5082a8cfca8ac9d4b3..d4984adfdc89b05284605228b6a24f0991320d4f 100644 (file)
@@ -1,22 +1,16 @@
-fgbase.o: fgbase.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmfg/fgbase.h ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oflist.h \
+fg.o: fg.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmfg/fg.h ../../ofstd/include/dcmtk/ofstd/ofmap.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
- ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../../ofstd/include/dcmtk/ofstd/oflimits.h \
- ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
- ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/dcmfg/fgtypes.h ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
  ../../oflog/include/dcmtk/oflog/config/defines.h \
@@ -24,12 +18,11 @@ fgbase.o: fgbase.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/loglevel.h \
  ../../ofstd/include/dcmtk/ofstd/ofvector.h \
  ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../oflog/include/dcmtk/oflog/tchar.h \
  ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
- ../../ofstd/include/dcmtk/ofstd/ofutil.h \
- ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../../oflog/include/dcmtk/oflog/layout.h \
  ../../oflog/include/dcmtk/oflog/streams.h \
  ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
@@ -42,36 +35,44 @@ fgbase.o: fgbase.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
- ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
- ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
- ../include/dcmtk/dcmfg/fgtypes.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \
  ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \
- ../../ofstd/include/dcmtk/ofstd/ofmap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \
@@ -113,38 +114,26 @@ fgbase.o: fgbase.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
- ../include/dcmtk/dcmfg/fgdefine.h \
- ../../dcmiod/include/dcmtk/dcmiod/iodcommn.h \
- ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \
- ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \
- ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \
- ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \
- ../../dcmiod/include/dcmtk/dcmiod/modpatient.h \
- ../../dcmiod/include/dcmtk/dcmiod/modbase.h \
- ../../dcmiod/include/dcmtk/dcmiod/modpatientstudy.h \
- ../../ofstd/include/dcmtk/ofstd/ofoption.h \
- ../../ofstd/include/dcmtk/ofstd/ofalign.h \
- ../../dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h \
- ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \
- ../../dcmiod/include/dcmtk/dcmiod/modequipment.h \
- ../../dcmiod/include/dcmtk/dcmiod/modgeneralseries.h \
- ../../dcmiod/include/dcmtk/dcmiod/modfor.h \
- ../../dcmiod/include/dcmtk/dcmiod/modsopcommon.h \
- ../../dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h \
- ../../dcmiod/include/dcmtk/dcmiod/iodreferences.h
-fg.o: fg.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmfg/fg.h ../../ofstd/include/dcmtk/ofstd/ofmap.h \
- ../../ofstd/include/dcmtk/ofstd/ofutil.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../include/dcmtk/dcmfg/fgdefine.h ../include/dcmtk/dcmfg/fgbase.h
+fgbase.o: fgbase.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmfg/fgbase.h ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
- ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
- ../../ofstd/include/dcmtk/ofstd/oflist.h \
- ../include/dcmtk/dcmfg/fgtypes.h ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
  ../../oflog/include/dcmtk/oflog/config/defines.h \
@@ -152,11 +141,12 @@ fg.o: fg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/loglevel.h \
  ../../ofstd/include/dcmtk/ofstd/ofvector.h \
  ../../oflog/include/dcmtk/oflog/tstring.h \
- ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../oflog/include/dcmtk/oflog/tchar.h \
  ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../../oflog/include/dcmtk/oflog/layout.h \
  ../../oflog/include/dcmtk/oflog/streams.h \
  ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
@@ -169,42 +159,38 @@ fg.o: fg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h \
- ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../../ofstd/include/dcmtk/ofstd/oflimits.h \
- ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
- ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
+ ../include/dcmtk/dcmfg/fgtypes.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \
  ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
- ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \
@@ -246,7 +232,25 @@ fg.o: fg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
- ../include/dcmtk/dcmfg/fgdefine.h ../include/dcmtk/dcmfg/fgbase.h
+ ../include/dcmtk/dcmfg/fgdefine.h \
+ ../../dcmiod/include/dcmtk/dcmiod/iodcommn.h \
+ ../../dcmiod/include/dcmtk/dcmiod/iodrules.h \
+ ../../dcmiod/include/dcmtk/dcmiod/iodtypes.h \
+ ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \
+ ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \
+ ../../dcmiod/include/dcmtk/dcmiod/modpatient.h \
+ ../../dcmiod/include/dcmtk/dcmiod/modbase.h \
+ ../../dcmiod/include/dcmtk/dcmiod/modpatientstudy.h \
+ ../../ofstd/include/dcmtk/ofstd/ofoption.h \
+ ../../ofstd/include/dcmtk/ofstd/ofalign.h \
+ ../../dcmiod/include/dcmtk/dcmiod/modgeneralstudy.h \
+ ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \
+ ../../dcmiod/include/dcmtk/dcmiod/modequipment.h \
+ ../../dcmiod/include/dcmtk/dcmiod/modgeneralseries.h \
+ ../../dcmiod/include/dcmtk/dcmiod/modfor.h \
+ ../../dcmiod/include/dcmtk/dcmiod/modsopcommon.h \
+ ../../dcmiod/include/dcmtk/dcmiod/modcommoninstanceref.h \
+ ../../dcmiod/include/dcmtk/dcmiod/iodreferences.h
 fgderimg.o: fgderimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -291,8 +295,10 @@ fgderimg.o: fgderimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -417,6 +423,7 @@ fgfact.o: fgfact.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -424,6 +431,7 @@ fgfact.o: fgfact.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -555,6 +563,7 @@ fgfracon.o: fgfracon.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -562,6 +571,7 @@ fgfracon.o: fgfracon.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -677,8 +687,10 @@ fgframeanatomy.o: fgframeanatomy.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -805,6 +817,7 @@ fgframevoilut.o: fgframevoilut.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -812,6 +825,7 @@ fgframevoilut.o: fgframevoilut.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -929,6 +943,7 @@ fgimagedatatype.o: fgimagedatatype.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -936,6 +951,7 @@ fgimagedatatype.o: fgimagedatatype.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -1053,12 +1069,14 @@ fginterface.o: fginterface.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1178,6 +1196,7 @@ fgparametricmapframetype.o: fgparametricmapframetype.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1185,6 +1204,7 @@ fgparametricmapframetype.o: fgparametricmapframetype.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -1302,6 +1322,7 @@ fgpixeltransform.o: fgpixeltransform.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1309,6 +1330,7 @@ fgpixeltransform.o: fgpixeltransform.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -1423,8 +1445,10 @@ fgpixmsr.o: fgpixmsr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1546,8 +1570,10 @@ fgplanor.o: fgplanor.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1670,6 +1696,7 @@ fgplanorvol.o: fgplanorvol.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1677,6 +1704,7 @@ fgplanorvol.o: fgplanorvol.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1793,8 +1821,10 @@ fgplanpo.o: fgplanpo.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1919,6 +1949,7 @@ fgplanposvol.o: fgplanposvol.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1926,6 +1957,7 @@ fgplanposvol.o: fgplanposvol.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -2041,8 +2073,10 @@ fgrealworldvaluemapping.o: fgrealworldvaluemapping.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2167,8 +2201,10 @@ fgseg.o: fgseg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2280,6 +2316,7 @@ fgtypes.o: fgtypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2289,6 +2326,7 @@ fgtypes.o: fgtypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2426,6 +2464,7 @@ fgusimagedescription.o: fgusimagedescription.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2433,6 +2472,7 @@ fgusimagedescription.o: fgusimagedescription.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -2563,6 +2603,7 @@ stackinterface.o: stackinterface.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2570,6 +2611,7 @@ stackinterface.o: stackinterface.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
index 3cb43c364e958eac6614dd6aebd174cb15a38eb1..d382e054b5642256bab398dd5a5217978f3137df 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -25,9 +25,9 @@
 #include "dcmtk/dcmiod/iodcommn.h" // for static element helpers
 
 
-FGBase::FGBase(const DcmFGTypes::E_FGType fgType)
+FGBase::FGBase(const DcmFGTypes::E_FGType fgType) :
+  m_fgType(fgType)
 {
-  m_fgType = fgType;
 }
 
 
@@ -118,6 +118,8 @@ OFCondition FGBase::createNewFGSequence(DcmItem& destination,
 }
 
 
+// ------------------ class FGUnknown ------------------------------------
+
 
 FGUnknown::FGUnknown(const DcmTagKey& seqStartTag,
                      const DcmFGTypes::E_FGSharedType sharedType) :
@@ -128,6 +130,23 @@ FGUnknown::FGUnknown(const DcmTagKey& seqStartTag,
 {
 }
 
+FGUnknown::FGUnknown(const FGUnknown& rhs) :
+    FGBase(DcmFGTypes::EFG_UNKNOWN),
+    m_seqStartTag(rhs.m_seqStartTag),
+    m_fgSequence(OFstatic_cast(DcmSequenceOfItems*, rhs.m_fgSequence->clone())),
+    m_sharedType(rhs.m_sharedType)
+{
+}
+
+
+FGUnknown & FGUnknown::operator=(const FGUnknown& rhs)
+{
+    m_seqStartTag = rhs.m_seqStartTag;
+    m_fgSequence = OFstatic_cast(DcmSequenceOfItems*, rhs.m_fgSequence->clone());
+    m_sharedType = rhs.m_sharedType;
+    return *this;
+}
+
 
 void FGUnknown::clearData()
 {
@@ -186,11 +205,11 @@ int FGUnknown::compare(const FGBase& rhs) const
       }
       else if (m_fgSequence)
       {
-        return 1; // this object is bigger (more information)
+        result = 1; // this object is bigger (more information)
       }
       else if (myRhs->m_fgSequence)
       {
-        return -1; // rhs object is bigger (more information)
+        result = -1; // rhs object is bigger (more information)
       }
     }
     else
index c517ea6f7e677881975d9d719da2146f449c2dfb..5ee6fa655d565d8823b482b6ae4393530b183c70 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -122,6 +122,10 @@ int FGDerivationImage::compare(const FGBase& rhs) const
     return result;
 
   const FGDerivationImage* myRhs = OFstatic_cast(const FGDerivationImage*, &rhs);
+  if (!myRhs)
+  {
+     return -1;
+  }
 
   size_t thisSize = m_DerivationImageItems.size();
   size_t rhsSize = myRhs->m_DerivationImageItems.size();
index e60124f633cddb0c83bc5f1035a45524f19ac49c..e24a4c354ea22629894b722e6071263a21731a29 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -155,6 +155,8 @@ int FGFrameContent::compare(const FGBase& rhs) const
     return result;
 
   const FGFrameContent* myRhs = OFstatic_cast(const FGFrameContent*, &rhs);
+  if (!myRhs)
+    return -1;
 
   // Compare all elements
   result = m_FrameAcquisitonNumber.compare(myRhs->m_FrameAcquisitonNumber);
index 1a4cae020132d6d1970230c454be08356b39a052..22a9ea413260c21296c91ea01ca45a261eaa8756 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -77,6 +77,8 @@ int FGFrameAnatomy::compare(const FGBase& rhs) const
     return result;
 
   const FGFrameAnatomy* myRhs = OFstatic_cast(const FGFrameAnatomy*, &rhs);
+  if (!myRhs)
+    return -1;
 
   // Compare all elements
   if (m_FrameLaterality != myRhs->m_FrameLaterality)
index 2b04ac09c3f349f029d19c30889feba2f4115094..9a85ba5431976314d148f580c22390a4ca7fca1f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -209,6 +209,8 @@ int FGFrameVOILUT::compare(const FGBase& rhs) const
     return result;
 
   const FGFrameVOILUT* myRhs = OFstatic_cast(const FGFrameVOILUT*, &rhs);
+  if (!myRhs)
+    return -1;
 
   // Compare all elements
   result = m_WindowCenter.compare(myRhs->m_WindowCenter);
index af6ea1420172185307d0981c310b6816292b3c54..782ee4435a82bd918f86bee42f513444f9570174 100644 (file)
@@ -253,6 +253,8 @@ int FGImageDataType::compare(const FGBase& rhs) const
     return result;
 
   const FGImageDataType* myRhs = OFstatic_cast(const FGImageDataType*, &rhs);
+  if (!myRhs)
+    return -1;
 
   // Compare all elements
   result = m_DataType.compare(myRhs->m_DataType);
index a5db78637baa46a61e38d2febcad4f4e3e806fca..be144cf54fb8200026f8f44f42f5ef8d46cdaf4f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -653,7 +653,7 @@ OFBool FGInterface::check()
       FunctionalGroups::iterator groupEnd = (*frameFG).second->end();
       while (group != groupEnd)
       {
-        // Check that per-frame group is not shared group at the same time
+        // Check that per-frame group is not shared group at the same time
         DcmFGTypes::E_FGType groupType = group->second->getType();
         if ( (groupType != DcmFGTypes::EFG_UNDEFINED) &&
           (groupType != DcmFGTypes::EFG_UNKNOWN) )
index b60a57e4060a2f337f84b3f4d382bf9005e95fee..d3956057c37438e9ff797f35398629e781b98c65 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -91,6 +91,8 @@ int FGParametricMapFrameType::compare(const FGBase& rhs) const
   if(result == 0)
   {
     const FGParametricMapFrameType* myRhs = OFstatic_cast(const FGParametricMapFrameType*, &rhs);
+    if (!myRhs)
+        return -1;
 
     // Compare all elements
     result = m_FrameType.compare(myRhs->m_FrameType);
index 0e7581b13bdbb31f192bb08ee2d4e377c82d7a92..de4b7225ec971f16bd3461a915a13147f2217d55 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016-2017, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -11,7 +11,7 @@
  *    D-26121 Oldenburg, Germany
  *
  *
- *  Module: dcmpmap
+ *  Module: dcmfg
  *
  *  Author: Jan Schlamelcher
  *
@@ -174,11 +174,13 @@ int FGPixelValueTransformation::compare(const FGBase& rhs) const
   if(result == 0)
   {
     const FGPixelValueTransformation* myRhs = OFstatic_cast(const FGPixelValueTransformation*, &rhs);
+    if (!myRhs)
+      return -1;
 
     // Compare all elements
     result = m_RescaleIntercept.compare(myRhs->m_RescaleIntercept);
-    result = m_RescaleSlope.compare(myRhs->m_RescaleSlope);
-    result = m_RescaleType.compare(myRhs->m_RescaleType);
+    if (result == 0) result = m_RescaleSlope.compare(myRhs->m_RescaleSlope);
+    if (result == 0) result = m_RescaleType.compare(myRhs->m_RescaleType);
   }
 
   return result;
index 24bb4ddf722beb52cf8366c8b010c3923d93063e..76bb4bb97e4432196b8fbad545b0c4229abcc652 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -76,6 +76,8 @@ int FGPixelMeasures::compare(const FGBase& rhs) const
     return result;
 
   const FGPixelMeasures* myRhs = OFstatic_cast(const FGPixelMeasures*, &rhs);
+  if (!myRhs)
+    return -1;
 
   // Compare all elements
   result = m_PixelSpacing.compare(myRhs->m_PixelSpacing);
index 49265b572461d723e0c51ae49c9fc59dae7419f5..36a00dca31de5ca1f3dba4f8d167a0e538dd8d7a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -123,6 +123,8 @@ int FGPlaneOrientationPatient::compare(const FGBase& rhs) const
   if (result == 0)
   {
     const FGPlaneOrientationPatient* myRhs = OFstatic_cast(const FGPlaneOrientationPatient*, &rhs);
+    if (!myRhs)
+      return -1;
 
     // Compare all elements
     result = m_ImageOrientationPatient.compare(myRhs->m_ImageOrientationPatient);
index eccea15b760abd04e44012824385948e9f08be2f..c7d411712476c348fbe10d416023c020a8026fc9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -150,6 +150,8 @@ int FGPlaneOrientationVolume::compare(const FGBase& rhs) const
     return result;
 
   const FGPlaneOrientationVolume* myRhs = OFstatic_cast(const FGPlaneOrientationVolume*, &rhs);
+  if (!myRhs)
+    return -1;
 
   // Compare all elements
   result = m_ImageOrientationVolume.compare(myRhs->m_ImageOrientationVolume);
index 44fe2080b691b0f0ab9817ceb69b9321acf66140..b1c461097cfe84f3480d3fba1c8ffedc5246be4d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -112,6 +112,8 @@ int FGPlanePosPatient::compare(const FGBase& rhs) const
   if (result == 0)
   {
     const FGPlanePosPatient* myRhs = OFstatic_cast(const FGPlanePosPatient*, &rhs);
+    if (!myRhs)
+      return -1;
 
     // Compare all elements
     result = m_ImagePositionPatient.compare(myRhs->m_ImagePositionPatient);
index 4a88836a27d07a4c71f384302163291ebd4250d1..70e650a41764800b149e65e3c1473a33d5d0abd0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -146,6 +146,8 @@ int FGPlanePositionVolume::compare(const FGBase& rhs) const
     return result;
 
   const FGPlanePositionVolume* myRhs = OFstatic_cast(const FGPlanePositionVolume*, &rhs);
+  if (!myRhs)
+    return -1;
 
   // Compare all elements
   result = m_ImagePositionVolume.compare(myRhs->m_ImagePositionVolume);
index ef53ab3e2899cfe200acc0e1731ec9bf2c4bf2df..b876b39bcd730787912b5d583c97e72d6979856b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -76,6 +76,8 @@ int FGRealWorldValueMapping::compare(const FGBase& rhs) const
     return result;
 
   const FGRealWorldValueMapping* myRhs = OFstatic_cast(const FGRealWorldValueMapping*, &rhs);
+  if (!myRhs)
+    return -1;
 
   // Compare all items, start with VM
   if (m_Items.size() < myRhs->m_Items.size())
@@ -141,9 +143,10 @@ FGRealWorldValueMapping::RWVMItem::RWVMItem(OFshared_ptr< DcmItem > item,
 
 
 FGRealWorldValueMapping::RWVMItem::RWVMItem(const FGRealWorldValueMapping::RWVMItem& rhs)
-: IODComponent(rhs)
+: IODComponent(rhs),
+  m_MeasurementUnitsCode(rhs.m_MeasurementUnitsCode),
+  m_QuantityDefinitionSequence()
 {
-  m_MeasurementUnitsCode = rhs.m_MeasurementUnitsCode;
   OFVector<ContentItemMacro*>::const_iterator it = rhs.m_QuantityDefinitionSequence.begin();
   while (it != rhs.m_QuantityDefinitionSequence.end())
   {
@@ -181,7 +184,31 @@ OFString FGRealWorldValueMapping::RWVMItem::getName() const
 
 int FGRealWorldValueMapping::RWVMItem::compare(const IODComponent& rhs) const
 {
-  return IODComponent::compare(rhs);
+  int result = IODComponent::compare(rhs);
+  const FGRealWorldValueMapping::RWVMItem* myRhs = OFstatic_cast(const FGRealWorldValueMapping::RWVMItem*, &rhs);
+  if (!myRhs)
+    return -1;
+
+  if (result == 0) result = m_MeasurementUnitsCode.compare(*myRhs);
+  if (result == 0)
+  {
+    size_t rhsSize = myRhs->m_QuantityDefinitionSequence.size();
+    size_t thisSize = m_QuantityDefinitionSequence.size();
+    if (thisSize < rhsSize)
+      return -1;
+    else if (thisSize > rhsSize)
+      return 1;
+
+    OFVector<ContentItemMacro*>::const_iterator it = m_QuantityDefinitionSequence.begin();
+    OFVector<ContentItemMacro*>::const_iterator rhsIt = myRhs->m_QuantityDefinitionSequence.begin();
+    while (it != m_QuantityDefinitionSequence.end() && (result == 0))
+    {
+        result = (*it)->compare( *(*rhsIt) );
+        it++;
+    }
+  }
+  return result;
+
 }
 
 
@@ -255,7 +282,7 @@ OFCondition FGRealWorldValueMapping::RWVMItem::getRealWorldValueLUTData(OFVector
   OFCondition result = m_Item->findAndGetElement(DCM_RealWorldValueLUTData, elem);
   if (result.good())
   {
-    size_t numValues = elem->getVM();
+    size_t numValues = elem->getNumberOfValues();
     for (size_t n = 0; n < numValues; n++)
     {
       Float64 value;
index 72cfa404f29677d2d651c47eb86ab4edff52ca10..998501072b5b42f83201fc163255f2440c6d5ee8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -129,6 +129,8 @@ int FGSegmentation::compare(const FGBase& rhs) const
   if (result == 0)
   {
     const FGSegmentation* myRhs = OFstatic_cast(const FGSegmentation*, &rhs);
+    if (!myRhs)
+      return -1;
 
     // Compare all elements
     result = m_ReferencedSegmentNumber.compare(myRhs->m_ReferencedSegmentNumber);
index 439e33957e87a41a320a7a771c40a3f70f9517d0..53a3339cc88385855b0a52492eead3dcdc5a24dc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -197,6 +197,8 @@ int FGUSImageDescription::compare(const FGBase& rhs) const
     return result;
 
   const FGUSImageDescription* myRhs = OFstatic_cast(const FGUSImageDescription*, &rhs);
+  if (!myRhs)
+    return -1;
 
   // Compare all elements
   result = m_FrameType.compare(myRhs->m_FrameType);
index 50a90ccff602719fc39a27437233a012ef9629ed..c9e0c32a073804cbf45f688ab68ee2d16b4cc291 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -272,3 +272,4 @@ size_t FGStackInterface::checkContext(FGStack* stack,
   }
   return errors;
 }
+
index 43640518b7929918e80c361ed78bbed11fe23e04..7a90faff99876fadbf6e55a3ab2ec9c6a1a5b724 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmimage)
+project(dcmimage)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmimage_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${LIBTIFF_INCDIR} ${LIBPNG_INCDIR})
+include_directories("${dcmimage_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${LIBTIFF_INCDIR} ${LIBPNG_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc apps include)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc apps include)
+  add_subdirectory(${SUBDIR})
+endforeach()
index ff27c849f42b3689f24c3517eedaca68c61d86aa..77b88b777b1f504fb5d8e3caaed71538d6cd2952 100644 (file)
@@ -1,9 +1,9 @@
 # declare executables
-FOREACH(PROGRAM dcm2pnm dcmquant dcmscale)
+foreach(PROGRAM dcm2pnm dcmquant dcmscale dcmicmp)
   DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
-ENDFOREACH(PROGRAM)
+endforeach()
 
 # make sure executables are linked to the corresponding libraries
-FOREACH(PROGRAM dcm2pnm dcmquant dcmscale)
+foreach(PROGRAM dcm2pnm dcmquant dcmscale dcmicmp)
   DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmimage dcmimgle dcmdata oflog ofstd)
-ENDFOREACH(PROGRAM)
+endforeach()
index b60482bcb9b378c561292f30a4a86a63116c8383..3b05c53fc593164661427a87f3ab9e75a5a91a8e 100644 (file)
@@ -35,6 +35,7 @@ dcm2pnm.o: dcm2pnm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -44,6 +45,7 @@ dcm2pnm.o: dcm2pnm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -140,6 +142,128 @@ dcm2pnm.o: dcm2pnm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimage/dipitiff.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diplugin.h \
  ../include/dcmtk/dcmimage/dipipng.h
+dcmicmp.o: dcmicmp.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmimage/dcmicmph.h \
+ ../include/dcmtk/dcmimage/dicdefin.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmap.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdate.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
+ ../../ofstd/include/dcmtk/ofstd/oftime.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
+ ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
+ ../include/dcmtk/dcmimage/diregist.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h
 dcmquant.o: dcmquant.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
@@ -177,6 +301,7 @@ dcmquant.o: dcmquant.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -186,6 +311,7 @@ dcmquant.o: dcmquant.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -313,6 +439,7 @@ dcmscale.o: dcmscale.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -322,6 +449,7 @@ dcmscale.o: dcmscale.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
index c04baeb70453c9ab2c520ff5336e1b80debb2b21..759b8a26c20bc7eac7a31030c486f6233901b33b 100644 (file)
@@ -24,8 +24,8 @@ LIBDIRS = -L$(top_srcdir)/libsrc -L$(ofstddir)/libsrc -L$(oflogdir)/libsrc \
 LOCALLIBS = -ldcmimage -ldcmimgle -ldcmdata -loflog -lofstd $(TIFFLIBS) $(PNGLIBS) \
        $(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS)
 
-objs = dcm2pnm.o dcmquant.o dcmscale.o
-progs = dcm2pnm dcmquant dcmscale
+objs = dcm2pnm.o dcmquant.o dcmscale.o dcmicmp.o
+progs = dcm2pnm dcmquant dcmscale dcmicmp
 
 
 all: $(progs)
@@ -39,6 +39,9 @@ dcmquant: dcmquant.o
 dcmscale: dcmscale.o
        $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS)
 
+dcmicmp: dcmicmp.o
+       $(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $@.o $(LOCALLIBS) $(LIBS)
+
 
 install: all
        $(configdir)/mkinstalldirs $(DESTDIR)$(bindir)
index a849297e10da9de07b89af31374b5eaaabadf483..b800a3f126f8193b9eb960c322170386aff829dc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2017, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -184,6 +184,9 @@ int main(int argc, char *argv[])
     OFCmdUnsignedInt    opt_quality = 90;                 /* default: 90% JPEG quality */
     E_SubSampling       opt_sampling = ESS_422;           /* default: 4:2:2 sub-sampling */
     E_DecompressionColorSpaceConversion opt_decompCSconversion = EDC_photometricInterpretation;
+    OFBool              opt_predictor6WorkaroundEnable = OFFalse;
+    OFBool              opt_cornellWorkaroundEnable = OFFalse;
+    OFBool              opt_forceSingleFragmentPerFrame = OFFalse;
 #endif
 
     int                 opt_Overlay[16];
@@ -265,13 +268,18 @@ int main(int argc, char *argv[])
       cmd.addOption("--scale-y-size",       "+Syv", 1, "[n]umber: integer",
                                                        "scale y axis to n pixels, auto-compute x axis");
 #ifdef BUILD_DCM2PNM_AS_DCMJ2PNM
-     cmd.addSubGroup("color space conversion (compressed images only):");
+     cmd.addSubGroup("color space conversion (JPEG compressed images only):");
       cmd.addOption("--conv-photometric",   "+cp",     "convert if YCbCr photometric interpr. (default)");
       cmd.addOption("--conv-lossy",         "+cl",     "convert YCbCr to RGB if lossy JPEG");
       cmd.addOption("--conv-guess",         "+cg",     "convert to RGB if YCbCr is guessed by library");
       cmd.addOption("--conv-guess-lossy",   "+cgl",    "convert to RGB if lossy JPEG and YCbCr is\nguessed by the underlying JPEG library");
       cmd.addOption("--conv-always",        "+ca",     "always convert YCbCr to RGB");
       cmd.addOption("--conv-never",         "+cn",     "never convert color space");
+
+     cmd.addSubGroup("workaround options for incorrect encodings (JPEG compressed images only):");
+      cmd.addOption("--workaround-pred6",    "+w6",    "enable workaround for JPEG lossless images\nwith overflow in predictor 6");
+      cmd.addOption("--workaround-incpl",    "+wi",    "enable workaround for incomplete JPEG data");
+      cmd.addOption("--workaround-cornell",  "+wc",    "enable workaround for 16-bit JPEG lossless\nCornell images with Huffman table overflow");
 #endif
 
      cmd.addSubGroup("modality LUT transformation:");
@@ -614,6 +622,10 @@ int main(int argc, char *argv[])
         if (cmd.findOption("--conv-never"))
             opt_decompCSconversion = EDC_never;
         cmd.endOptionBlock();
+
+        if (cmd.findOption("--workaround-pred6")) opt_predictor6WorkaroundEnable = OFTrue;
+        if (cmd.findOption("--workaround-incpl")) opt_forceSingleFragmentPerFrame = OFTrue;
+        if (cmd.findOption("--workaround-cornell")) opt_cornellWorkaroundEnable = OFTrue;
 #endif
 
         /* image processing options: modality LUT transformation */
@@ -902,7 +914,9 @@ int main(int argc, char *argv[])
     DcmRLEDecoderRegistration::registerCodecs();
 #ifdef BUILD_DCM2PNM_AS_DCMJ2PNM
     // register JPEG decompression codecs
-    DJDecoderRegistration::registerCodecs(opt_decompCSconversion);
+    DJDecoderRegistration::registerCodecs(opt_decompCSconversion, EUC_default,
+        EPC_default, opt_predictor6WorkaroundEnable, opt_cornellWorkaroundEnable,
+        opt_forceSingleFragmentPerFrame);
 #endif
 #ifdef BUILD_DCM2PNM_AS_DCML2PNM
     // register JPEG-LS decompression codecs
diff --git a/dcmimage/apps/dcmicmp.cc b/dcmimage/apps/dcmicmp.cc
new file mode 100644 (file)
index 0000000..cb7db19
--- /dev/null
@@ -0,0 +1,441 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  dcmimage
+ *
+ *  Authors: Marco Eichelberg
+ *
+ *  Purpose: Compare DICOM images and compute difference metrics
+ *
+ */
+
+
+#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
+
+#include "dcmtk/dcmimage/dcmicmph.h"     /* for DicomImageComparison */
+#include "dcmtk/dcmdata/dctk.h"          /* for various dcmdata headers */
+#include "dcmtk/dcmdata/cmdlnarg.h"      /* for prepareCmdLineArgs */
+#include "dcmtk/dcmdata/dcuid.h"         /* for dcmtk version name */
+#include "dcmtk/ofstd/ofconapp.h"        /* for OFConsoleApplication */
+#include "dcmtk/ofstd/ofcmdln.h"         /* for OFCommandLine */
+#include "dcmtk/dcmimage/diregist.h"     /* include to support color images */
+#include "dcmtk/oflog/oflog.h"
+
+#ifdef WITH_ZLIB
+#include <zlib.h>                        /* for zlibVersion() */
+#endif
+
+#define OFFIS_CONSOLE_APPLICATION "dcmicmp"
+
+static OFLogger dcmicmpLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION);
+
+static const char *consoleDescription = "Compare DICOM images and compute difference metrics";
+
+static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v"
+  OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $";
+
+#define SHORTCOL 4
+#define LONGCOL 20
+
+// processing errors (80-99)
+#define EXITCODE_INITIALIZE_DIFF_IMAGE           80
+#define EXITCODE_DISPLAY_PIPELINE                81
+#define EXITCODE_IMAGE_COMPARISON                82
+#define EXITCODE_LIMIT_EXCEEDED_MAX_ERROR        90
+#define EXITCODE_LIMIT_EXCEEDED_MAE              91
+#define EXITCODE_LIMIT_EXCEEDED_RMSE             92
+#define EXITCODE_LIMIT_EXCEEDED_PSNR             93
+#define EXITCODE_LIMIT_EXCEEDED_SNR              94
+
+// ********************************************
+
+int main(int argc, char *argv[])
+{
+    OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, consoleDescription, rcsid);
+    OFCommandLine cmd;
+
+    E_FileReadMode      opt_readMode = ERM_autoDetect;    /* default: fileformat or dataset */
+    E_TransferSyntax    opt_transferSyntax = EXS_Unknown; /* default: xfer syntax recognition */
+    unsigned long       opt_compatibilityMode = 0;
+    EW_WindowType       opt_windowType = EWT_none;        /* default: no windowing */
+    OFCmdUnsignedInt    opt_windowParameter = 0;
+    OFCmdFloat          opt_windowCenter = 0.0, opt_windowWidth = 0.0;
+    OFBool              opt_sharedWindow = OFFalse;
+    EF_VoiLutFunction   opt_voiFunction = EFV_Default;
+    ES_PresentationLut  opt_presShape = ESP_Default;
+    const char *        opt_ifname1 = NULL;
+    const char *        opt_ifname2 = NULL;
+    const char *        opt_ofname = NULL;
+
+    OFBool              opt_checkError = OFFalse;
+    OFBool              opt_checkMAE = OFFalse;
+    OFBool              opt_checkRMSE = OFFalse;
+    OFBool              opt_checkPSNR = OFFalse;
+    OFBool              opt_checkSNR = OFFalse;
+    OFCmdUnsignedInt    opt_checkErrorLimit = 0;
+    OFCmdFloat          opt_checkMAELimit = 0.0;
+    OFCmdFloat          opt_checkRMSELimit = 0.0;
+    OFCmdFloat          opt_checkPSNRLimit = 0.0;
+    OFCmdFloat          opt_checkSNRLimit = 0.0;
+    OFCmdFloat          opt_amplify = 1.0;
+
+    prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION);
+    cmd.setOptionColumns(LONGCOL, SHORTCOL);
+
+    cmd.addParam("dcmfile-in-1",  "Reference DICOM image file for comparison");
+    cmd.addParam("dcmfile-in-2",  "Test DICOM image file for comparison");
+
+    cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2);
+     cmd.addOption("--help",                "-h",      "print this help text and exit", OFCommandLine::AF_Exclusive);
+     cmd.addOption("--version",                        "print version information and exit", OFCommandLine::AF_Exclusive);
+     OFLog::addOptions(cmd);
+
+    cmd.addGroup("input options:");
+
+     cmd.addSubGroup("input file format:");
+      cmd.addOption("--read-file",          "+f",      "read file format or data set (default)");
+      cmd.addOption("--read-file-only",     "+fo",     "read file format only");
+      cmd.addOption("--read-dataset",       "-f",      "read data set without file meta information");
+
+     cmd.addSubGroup("input transfer syntax:");
+      cmd.addOption("--read-xfer-auto",     "-t=",     "use TS recognition (default)");
+      cmd.addOption("--read-xfer-detect",   "-td",     "ignore TS specified in the file meta header");
+      cmd.addOption("--read-xfer-little",   "-te",     "read with explicit VR little endian TS");
+      cmd.addOption("--read-xfer-big",      "-tb",     "read with explicit VR big endian TS");
+      cmd.addOption("--read-xfer-implicit", "-ti",     "read with implicit VR little endian TS");
+
+    cmd.addGroup("image processing options:");
+
+     cmd.addSubGroup("modality LUT transformation:");
+      cmd.addOption("--use-modality",       "+M",      "use modality LUT transformation (default)");
+      cmd.addOption("--no-modality",        "-M",      "ignore stored modality LUT transformation");
+
+     cmd.addSubGroup("VOI LUT transformation:");
+      cmd.addOption("--no-windowing",       "-W",      "no VOI windowing (default)");
+      cmd.addOption("--use-window",         "+Wi",  1, "[n]umber: integer",
+                                                       "use the n-th VOI window from image file");
+      cmd.addOption("--use-voi-lut",        "+Wl",  1, "[n]umber: integer",
+                                                       "use the n-th VOI look up table from image file");
+      cmd.addOption("--min-max-window",     "+Wm",     "compute VOI window using min-max algorithm\non both images separately");
+      cmd.addOption("--min-max-window-n",   "+Wn",     "compute VOI window using min-max algorithm\non both images separately, ignoring extremes");
+      cmd.addOption("--min-max-ref",        "+Wr",     "compute VOI window using min-max algorithm\nand use same window for the test image");
+      cmd.addOption("--min-max-n-ref",      "+Wq",     "compute VOI window using min-max algorithm,\nignoring extreme values\nand use same window for the test image");
+      cmd.addOption("--set-window",         "+Ww",  2, "[c]enter [w]idth: float",
+                                                       "compute VOI window using center c and width w");
+      cmd.addOption("--linear-function",    "+Wfl",    "set VOI LUT function to LINEAR");
+      cmd.addOption("--sigmoid-function",   "+Wfs",    "set VOI LUT function to SIGMOID");
+
+     cmd.addSubGroup("presentation LUT transformation:");
+      cmd.addOption("--identity-shape",     "+Pid",    "set presentation LUT shape to IDENTITY");
+      cmd.addOption("--inverse-shape",      "+Piv",    "set presentation LUT shape to INVERSE");
+      cmd.addOption("--lin-od-shape",       "+Pod",    "set presentation LUT shape to LIN OD");
+
+    cmd.addGroup("image comparison metrics options:", LONGCOL, SHORTCOL + 2);
+      cmd.addOption("--check-error",        "+ce",  1, "[l]imit: integer",
+                                                       "check if max absolute error <= limit");
+      cmd.addOption("--check-mae",          "+cm",  1, "[l]imit: float",
+                                                       "check if mean absolute error <= limit");
+      cmd.addOption("--check-rmse",         "+cr",  1, "[l]imit: float",
+                                                       "check if root mean square error <= limit");
+      cmd.addOption("--check-psnr",         "+cp",  1, "[l]imit: float",
+                                                       "check if PSNR >= limit");
+      cmd.addOption("--check-snr",          "+cs",  1, "[l]imit: float",
+                                                       "check if SNR >= limit");
+
+    cmd.addGroup("output options:", LONGCOL, SHORTCOL + 2);
+      cmd.addOption("--save-diff",          "+sd",  1, "[f]ilename: string",
+                                                       "write secondary capture difference image");
+      cmd.addOption("--amplify",            "+a",   1, "[f]actor: float",
+                                                       "multiply diff image pixel values by f");
+
+    if (app.parseCommandLine(cmd, argc, argv))
+    {
+        /* check exclusive options first */
+        if (cmd.hasExclusiveOption())
+        {
+            if (cmd.findOption("--version"))
+            {
+                app.printHeader(OFTrue /*print host identifier*/);
+                COUT << OFendl << "External libraries used:" << OFendl;
+#ifdef WITH_ZLIB
+                COUT << "- ZLIB, Version " << zlibVersion() << OFendl;
+#else
+                COUT << " none" << OFendl;
+#endif
+                return EXITCODE_NO_ERROR;
+            }
+        }
+    }
+
+    /* command line parameters */
+
+    cmd.getParam(1, opt_ifname1);
+    cmd.getParam(2, opt_ifname2);
+
+    /* general options */
+
+    OFLog::configureFromCommandLine(cmd, app);
+
+    /* input options: input file format */
+
+    cmd.beginOptionBlock();
+    if (cmd.findOption("--read-file")) opt_readMode = ERM_autoDetect;
+    if (cmd.findOption("--read-file-only")) opt_readMode = ERM_fileOnly;
+    if (cmd.findOption("--read-dataset")) opt_readMode = ERM_dataset;
+    cmd.endOptionBlock();
+
+    /* input options: input transfer syntax */
+
+    cmd.beginOptionBlock();
+    if (cmd.findOption("--read-xfer-auto"))
+        opt_transferSyntax = EXS_Unknown;
+    if (cmd.findOption("--read-xfer-detect"))
+        dcmAutoDetectDatasetXfer.set(OFTrue);
+    if (cmd.findOption("--read-xfer-little"))
+    {
+        app.checkDependence("--read-xfer-little", "--read-dataset", opt_readMode == ERM_dataset);
+        opt_transferSyntax = EXS_LittleEndianExplicit;
+    }
+    if (cmd.findOption("--read-xfer-big"))
+    {
+        app.checkDependence("--read-xfer-big", "--read-dataset", opt_readMode == ERM_dataset);
+        opt_transferSyntax = EXS_BigEndianExplicit;
+    }
+    if (cmd.findOption("--read-xfer-implicit"))
+    {
+        app.checkDependence("--read-xfer-implicit", "--read-dataset", opt_readMode == ERM_dataset);
+        opt_transferSyntax = EXS_LittleEndianImplicit;
+    }
+    cmd.endOptionBlock();
+
+    /* image processing options: modality LUT transformation */
+
+    cmd.beginOptionBlock();
+    if (cmd.findOption("--no-modality"))
+        opt_compatibilityMode |= CIF_IgnoreModalityTransformation;
+    if (cmd.findOption("--use-modality"))
+        opt_compatibilityMode &= ~CIF_IgnoreModalityTransformation;
+    cmd.endOptionBlock();
+
+    /* image processing options: VOI LUT transformation */
+
+    cmd.beginOptionBlock();
+    if (cmd.findOption("--no-windowing"))
+        opt_windowType = EWT_none;
+    if (cmd.findOption("--use-window"))
+    {
+        opt_windowType = EWT_window_from_file;
+        app.checkValue(cmd.getValueAndCheckMin(opt_windowParameter, 1));
+    }
+    if (cmd.findOption("--use-voi-lut"))
+    {
+        opt_windowType = EWT_voi_lut_from_file;
+        app.checkValue(cmd.getValueAndCheckMin(opt_windowParameter, 1));
+    }
+    if (cmd.findOption("--min-max-window"))
+    {
+        opt_windowType = EWT_window_minmax;
+        opt_sharedWindow = OFFalse;
+    }
+    if (cmd.findOption("--min-max-window-n"))
+    {
+        opt_windowType = EWT_window_minmax_n;
+        opt_sharedWindow = OFFalse;
+    }
+
+    if (cmd.findOption("--min-max-ref"))
+    {
+        opt_windowType = EWT_window_minmax;
+        opt_sharedWindow = OFTrue;
+    }
+    if (cmd.findOption("--min-max-n-ref"))
+    {
+        opt_windowType = EWT_window_minmax_n;
+        opt_sharedWindow = OFTrue;
+    }
+
+    if (cmd.findOption("--set-window"))
+    {
+        opt_windowType = EWT_window_center_width;
+        app.checkValue(cmd.getValue(opt_windowCenter));
+        app.checkValue(cmd.getValueAndCheckMin(opt_windowWidth, 1.0));
+    }
+    cmd.endOptionBlock();
+    cmd.beginOptionBlock();
+    if (cmd.findOption("--linear-function"))
+        opt_voiFunction = EFV_Linear;
+    if (cmd.findOption("--sigmoid-function"))
+        opt_voiFunction = EFV_Sigmoid;
+    cmd.endOptionBlock();
+
+    /* image processing options: presentation LUT transformation */
+
+    cmd.beginOptionBlock();
+    if (cmd.findOption("--identity-shape"))
+        opt_presShape = ESP_Identity;
+    if (cmd.findOption("--inverse-shape"))
+        opt_presShape = ESP_Inverse;
+    if (cmd.findOption("--lin-od-shape"))
+        opt_presShape = ESP_LinOD;
+    cmd.endOptionBlock();
+
+    /* image comparison metrics options */
+
+    if (cmd.findOption("--check-error"))
+    {
+        opt_checkError = OFTrue;
+        app.checkValue(cmd.getValueAndCheckMinMax(opt_checkErrorLimit, 0, 65535));
+    }
+    if (cmd.findOption("--check-mae"))
+    {
+        opt_checkMAE = OFTrue;
+        app.checkValue(cmd.getValueAndCheckMin(opt_checkMAELimit, 0.0));
+    }
+    if (cmd.findOption("--check-rmse"))
+    {
+        opt_checkRMSE = OFTrue;
+        app.checkValue(cmd.getValueAndCheckMin(opt_checkRMSELimit, 0.0));
+    }
+    if (cmd.findOption("--check-psnr"))
+    {
+        opt_checkPSNR = OFTrue;
+        app.checkValue(cmd.getValueAndCheckMin(opt_checkPSNRLimit, 0.0));
+    }
+    if (cmd.findOption("--check-snr"))
+    {
+        opt_checkSNR = OFTrue;
+        app.checkValue(cmd.getValueAndCheckMin(opt_checkSNRLimit, 0.0));
+    }
+
+    /* output options */
+
+    if (cmd.findOption("--save-diff"))
+    {
+        app.checkValue(cmd.getValue(opt_ofname));
+    }
+
+    if (cmd.findOption("--amplify"))
+    {
+        app.checkDependence("--amplify", "--save-diff", (opt_ofname != NULL));
+        app.checkValue(cmd.getValueAndCheckMinMax(opt_amplify, 1.0, 65535.0));
+    }
+
+
+    /* print resource identifier */
+    OFLOG_DEBUG(dcmicmpLogger, rcsid << OFendl);
+
+    /* make sure data dictionary is loaded */
+    if (!dcmDataDict.isDictionaryLoaded())
+    {
+        OFLOG_WARN(dcmicmpLogger, "no data dictionary loaded, check environment variable: "
+            << DCM_DICT_ENVIRONMENT_VARIABLE);
+    }
+
+    DicomImageComparison dicmp;
+    OFCondition cond;
+
+    if (opt_ofname)
+    {
+        // prepare the creation of a difference image file
+        cond = dicmp.initializeDiffImage(opt_amplify);
+        if (cond.bad())
+        {
+            OFLOG_FATAL(dcmicmpLogger, "Error while initializing difference image: " << cond.text());
+            return EXITCODE_INITIALIZE_DIFF_IMAGE;
+        }
+    }
+
+    // read the reference image
+    cond = dicmp.readReferenceImage(opt_ifname1, opt_transferSyntax, opt_readMode, opt_compatibilityMode);
+    if (cond.bad())
+    {
+        OFLOG_FATAL(dcmicmpLogger, "Error while loading reference image: " << cond.text());
+        return EXITCODE_INVALID_INPUT_FILE;
+    }
+
+    // read the test image
+    cond = dicmp.readTestImage(opt_ifname2, opt_transferSyntax, opt_readMode, opt_compatibilityMode);
+    if (cond.bad())
+    {
+        OFLOG_FATAL(dcmicmpLogger, "Error while loading test image: " << cond.text());
+        return EXITCODE_INVALID_INPUT_FILE;
+    }
+
+    // configure the display pipelines for both images with the same parameter set
+    cond = dicmp.configureImages(opt_windowType, opt_sharedWindow, opt_windowParameter, opt_windowCenter, opt_windowWidth, opt_voiFunction, opt_presShape);
+    if (cond.bad())
+    {
+        OFLOG_FATAL(dcmicmpLogger, "Error while configuring display pipeline: " << cond.text());
+        return EXITCODE_DISPLAY_PIPELINE;
+    }
+
+    // compute image comparison metrics
+    cond = dicmp.computeImageComparisonMetrics(opt_windowType);
+    if (cond.bad())
+    {
+        OFLOG_FATAL(dcmicmpLogger, "Error while performing image comparison: " << cond.text());
+        return EXITCODE_IMAGE_COMPARISON;
+    }
+
+    // print image comparison metrics
+    COUT << "Max Absolute Error                     = " << dicmp.getMaxAbsoluteError() << "\n"
+         << "Mean Absolute Error (MAE)              = " << dicmp.getMeanAbsoluteError() << "\n"
+         << "Root Mean Square Error (RMSE)          = " << dicmp.getRootMeanSquareError() << "\n"
+         << "Peak Signal to Noise Ratio (PSNR) [dB] = " << dicmp.getPeakSignalToNoiseRatio() << "\n"
+         << "Signal to Noise Ratio (SNR) [dB]       = " << dicmp.getSignalToNoiseRatio() << OFendl;
+
+    if (opt_ofname)
+    {
+        // save difference image
+        cond = dicmp.saveDiffImage(opt_ofname);
+        if (cond.bad())
+        {
+            OFLOG_FATAL(dcmicmpLogger, "Error while writing difference image: " << cond.text());
+            return EXITCODE_CANNOT_WRITE_OUTPUT_FILE;
+        }
+    }
+
+    // process --check options
+    if (opt_checkError && (dicmp.getMaxAbsoluteError() > opt_checkErrorLimit))
+    {
+        OFLOG_FATAL(dcmicmpLogger, "Maximum absolute error " << dicmp.getMaxAbsoluteError() << " exceeds limit " << opt_checkErrorLimit);
+        return EXITCODE_LIMIT_EXCEEDED_MAX_ERROR;
+    }
+
+    if (opt_checkMAE && (dicmp.getMeanAbsoluteError() > opt_checkMAELimit))
+    {
+        OFLOG_FATAL(dcmicmpLogger, "Mean absolute error " << dicmp.getMeanAbsoluteError() << " exceeds limit " << opt_checkMAELimit);
+        return EXITCODE_LIMIT_EXCEEDED_MAE;
+    }
+
+    if (opt_checkRMSE && (dicmp.getRootMeanSquareError() > opt_checkRMSELimit))
+    {
+        OFLOG_FATAL(dcmicmpLogger, "Root mean square error (RMSE) " << dicmp.getRootMeanSquareError() << " exceeds limit " << opt_checkRMSELimit);
+        return EXITCODE_LIMIT_EXCEEDED_RMSE;
+    }
+
+    if (opt_checkPSNR && (dicmp.getPeakSignalToNoiseRatio() < opt_checkPSNRLimit))
+    {
+        OFLOG_FATAL(dcmicmpLogger, "Peak signal to noise ratio (PSNR) " << dicmp.getPeakSignalToNoiseRatio() << " below limit " << opt_checkPSNRLimit);
+        return EXITCODE_LIMIT_EXCEEDED_PSNR;
+    }
+
+    if (opt_checkSNR && (dicmp.getSignalToNoiseRatio() < opt_checkSNRLimit))
+    {
+        OFLOG_FATAL(dcmicmpLogger, "Signal to noise ratio (SNR) " << dicmp.getSignalToNoiseRatio() << " below limit " << opt_checkSNRLimit);
+        return EXITCODE_LIMIT_EXCEEDED_SNR;
+    }
+
+    // done
+    return EXITCODE_NO_ERROR;
+}
index 8be1cc85d4c454f8aac39b0ba7e7355473683529..6cd1d31a1f5575b310165c4634982a0fd2dfb7db 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2001-2017, OFFIS e.V.
+ *  Copyright (C) 2001-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -423,9 +423,7 @@ int main(int argc, char *argv[])
     OFLOG_INFO(dcmquantLogger, "check if new output transfer syntax is possible");
 
     DcmXfer opt_oxferSyn(opt_oxfer);
-    dataset->chooseRepresentation(opt_oxfer, NULL);
-
-    if (dataset->canWriteXfer(opt_oxfer))
+    if (dataset->chooseRepresentation(opt_oxfer, NULL).good() && dataset->canWriteXfer(opt_oxfer))
     {
         OFLOG_INFO(dcmquantLogger, "output transfer syntax " << opt_oxferSyn.getXferName()
             << " can be written");
index cfb075454ad49472ccf2b72f67e87429dbdae27c..7cadfce7269b1c753423eabc02e8d8c6fda019a8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2002-2017, OFFIS e.V.
+ *  Copyright (C) 2002-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -436,9 +436,7 @@ int main(int argc, char *argv[])
     OFLOG_INFO(dcmscaleLogger, "check if new output transfer syntax is possible");
 
     DcmXfer opt_oxferSyn(opt_oxfer);
-    dataset->chooseRepresentation(opt_oxfer, NULL);
-
-    if (dataset->canWriteXfer(opt_oxfer))
+    if (dataset->chooseRepresentation(opt_oxfer, NULL).good() && dataset->canWriteXfer(opt_oxfer))
     {
         OFLOG_INFO(dcmscaleLogger, "output transfer syntax " << opt_oxferSyn.getXferName()
             << " can be written");
diff --git a/dcmimage/docs/dcmicmp.man b/dcmimage/docs/dcmicmp.man
new file mode 100644 (file)
index 0000000..37e8446
--- /dev/null
@@ -0,0 +1,377 @@
+/*!
+
+\if MANPAGES
+\page dcmicmp Compare DICOM images and compute difference metrics
+\else
+\page dcmicmp dcmicmp: Compare DICOM images and compute difference metrics
+\endif
+
+\section dcmicmp_synopsis SYNOPSIS
+
+\verbatim
+dcmicmp [options] dcmfile-in-1 dcmfile-in-2
+\endverbatim
+
+\section dcmicmp_description DESCRIPTION
+
+The \b dcmicmp utility reads two DICOM images, an original "reference
+image" and a post-processed "test image", to which some kind of processing
+such as a lossy image compression, followed by decompression, has been applied.
+This tool requires that both images have the same resolution, the same number
+of frames and are either both color or monochrome. Compressed images are
+not supported.
+
+The \b dcmicmp utility then compares both images and computes and prints
+metrics that describe how similar or different both images are:
+
+  - the maximum absolute error is the largest difference between an
+    pixel value in the reference image and the corresponding pixel value in the
+    test image.
+  - the mean absolute error (MAE) is the average difference between original
+    pixel value and test image pixel value
+  - the root mean square error (RMSE) is computed by adding the squares of all
+    difference values, then dividing by the number of values added, and
+    then taking the square root.
+  - The peak signal to noise ratio (PSNR) considers the reference image as
+    a signal and the differences between reference and test image as noise.
+    PSNR is the maximum signal strength (i.e. maximum pixel value in the
+    reference image) divided by the RMSE, expressed on a logarithmic scale in
+    dB.
+  - The signal to noise ratio (PSNR) also considers the reference image as
+    a signal and the differences between reference and test image as noise.
+    SNR is the average signal strength divided by the RMSE, expressed on
+    a logarithmic scale in dB.
+
+All metrics are computed as defined in R.C. Gonzalez and R.E. Woods,
+"Digital Image Processing," Prentice Hall 2008.
+
+\section dcmicmp_parameters PARAMETERS
+
+\verbatim
+dcmfile-in-1  Reference DICOM image file for comparison
+
+dcmfile-in-2  Test DICOM image file for comparison
+\endverbatim
+
+\section dcmicmp_options OPTIONS
+
+\subsection dcmicmp_general_options general options
+\verbatim
+  -h    --help
+          print this help text and exit
+
+        --version
+          print version information and exit
+
+        --arguments
+          print expanded command line arguments
+
+  -q    --quiet
+          quiet mode, print no warnings and errors
+
+  -v    --verbose
+          verbose mode, print processing details
+
+  -d    --debug
+          debug mode, print debug information
+
+  -ll   --log-level  [l]evel: string constant
+          (fatal, error, warn, info, debug, trace)
+          use level l for the logger
+
+  -lc   --log-config  [f]ilename: string
+          use config file f for the logger
+\endverbatim
+
+\subsection dcmicmp_input_options input options
+\verbatim
+input file format:
+
+  +f    --read-file
+          read file format or data set (default)
+
+  +fo   --read-file-only
+          read file format only
+
+  -f    --read-dataset
+          read data set without file meta information
+
+input transfer syntax:
+
+  -t=   --read-xfer-auto
+          use TS recognition (default)
+
+  -td   --read-xfer-detect
+          ignore TS specified in the file meta header
+
+  -te   --read-xfer-little
+          read with explicit VR little endian TS
+
+  -tb   --read-xfer-big
+          read with explicit VR big endian TS
+
+  -ti   --read-xfer-implicit
+          read with implicit VR little endian TS
+\endverbatim
+
+\subsection dcmicmp_image_processing_options image processing options
+\verbatim
+modality LUT transformation:
+
+  +M    --use-modality
+          use modality LUT transformation (default)
+
+  -M    --no-modality
+          ignore stored modality LUT transformation
+
+VOI LUT transformation:
+
+  -W    --no-windowing
+          no VOI windowing (default)
+
+  +Wi   --use-window  [n]umber: integer
+          use the n-th VOI window from image file
+
+  +Wl   --use-voi-lut  [n]umber: integer
+          use the n-th VOI look up table from image file
+
+  +Wm   --min-max-window
+          compute VOI window using min-max algorithm
+          on both images separately
+
+  +Wn   --min-max-window-n
+          compute VOI window using min-max algorithm
+          on both images separately, ignoring extremes
+
+  +Wr   --min-max-ref
+          compute VOI window using min-max algorithm
+          and use same window for the test image
+
+  +Wq   --min-max-n-ref
+          compute VOI window using min-max algorithm,
+          ignoring extreme values
+          and use same window for the test image
+
+  +Ww   --set-window  [c]enter [w]idth: float
+          compute VOI window using center c and width w
+
+  +Wfl  --linear-function
+          set VOI LUT function to LINEAR
+
+  +Wfs  --sigmoid-function
+          set VOI LUT function to SIGMOID
+
+presentation LUT transformation:
+
+  +Pid  --identity-shape
+          set presentation LUT shape to IDENTITY
+
+  +Piv  --inverse-shape
+          set presentation LUT shape to INVERSE
+
+  +Pod  --lin-od-shape
+          set presentation LUT shape to LIN OD
+\endverbatim
+
+\subsection dcmicmp_image_comparison_metrics_options image comparison metrics options
+\verbatim
+  +ce   --check-error  [l]imit: integer
+          check if max absolute error <= limit
+
+  # Return exit code EXITCODE_LIMIT_EXCEEDED_MAX_ERROR if the computed
+  # maximum absolute error is larger than the given limit.
+
+  +cm   --check-mae  [l]imit: float
+          check if mean absolute error <= limit
+
+  # Return exit code EXITCODE_LIMIT_EXCEEDED_MAE if the computed
+  # mean absolute error is larger than the given limit.
+
+  +cr   --check-rmse  [l]imit: float
+          check if root mean square error <= limit
+
+  # Return exit code EXITCODE_LIMIT_EXCEEDED_RMSE if the computed
+  # root mean square error is larger than the given limit.
+
+  +cp   --check-psnr  [l]imit: float
+          check if PSNR >= limit
+
+  # Return exit code EXITCODE_LIMIT_EXCEEDED_PSNR if the computed
+  # peak signal to noise ratio is smaller than the given limit
+  # (for PSNR, higher values mean better image quality)
+
+  +cs   --check-snr  [l]imit: float
+          check if SNR >= limit
+
+  # Return exit code EXITCODE_LIMIT_EXCEEDED_PSNR if the computed
+  # signal to noise ratio is smaller than the given limit
+  # (for SNR, higher values mean better image quality)
+\endverbatim
+
+\subsection dcmicmp_output_options output options
+\verbatim
+  +sd   --save-diff  [f]ilename: string
+          write secondary capture difference image
+
+  # Create a Multiframe Secondary Capture image that contains a
+  # difference image between reference and test image. For monochrome
+  # images, one difference frame is created for each frame in the reference
+  # image. For color images, three monochrome frames are created for each
+  # frame in the reference image, corresponding to the differences in the
+  # red, green and blue color plane. The difference image will have
+  # BitsStored 8 or 16, depending on the properties of the reference image.
+
+  +a    --amplify  [f]actor: float
+          multiply diff image pixel values by f
+
+  # This option can be used to amplify the grayscale values in the
+  # difference image by multiplying each value with the given factor.
+  # Alternatively, a DICOM VOI LUT window may be used when visualizing
+  # the difference image.
+\endverbatim
+
+\section dcmicmp_notes NOTES
+
+\subsection dcmicmp_notes_display_pipeline grayscale display pipeline
+
+Monochrome DICOM images require that a multi-stage display pipeline is
+executed in order to convert the raw pixel values to the so-called
+presentation values (p-values) that are sent to the (possibly calibrated)
+display. When comparing the similarity of images before and after
+post-processing, it can be relevant to activate some stages of this
+display pipeline before calculating the difference image and metrics.
+The image processing options allow the caller to either activate or
+deactivate the Modality LUT, VOI LUT and Presentation LUT transformations.
+In any case, the same transformation is applied to both images, although
+possibly with different parameters if for example the "first VOI LUT window"
+stored in each image is applied. This assumes that the post-processing
+algorithm (e.g. compression algorithm) has adapted the values of such windows
+during compression such that the image display after applying the window
+is as close as possible to the reference. For images with more than
+8 bits/sample it may be important to known which VOI LUT transformation
+will be applied by the user when viewing the image, because this may
+affect the perceived image quality. Therefore, absolute Window parameters
+can also be given with the --set-window option, which will then be
+applied to both images.
+
+\subsection dcmicmp_notes_diagnostics suitability of images for diagnostic purposes
+
+The user should also note that the metrics computed by this tool
+cannot predict or estimate the suitability of lossy compressed
+image for diagnostic purposes. Much more complex image processing
+and an understanding of the image content (e.g. body part) would be
+needed for this purpose. The metrics computed provide an estimation
+of the level of distortion caused by the post-processing - no more and
+no less.
+
+\section dcmicmp_transfer_syntaxes TRANSFER SYNTAXES
+
+\b dcmicmp supports the following transfer syntaxes for input:
+
+\verbatim
+LittleEndianImplicitTransferSyntax             1.2.840.10008.1.2
+LittleEndianExplicitTransferSyntax             1.2.840.10008.1.2.1
+DeflatedExplicitVRLittleEndianTransferSyntax   1.2.840.10008.1.2.1.99 (*)
+BigEndianExplicitTransferSyntax                1.2.840.10008.1.2.2
+\endverbatim
+
+The difference image file is always written in Little Endian Implicit Transfer Syntax.
+
+(*) if compiled with zlib support enabled
+
+\section dcmicmp_logging LOGGING
+
+The level of logging output of the various command line tools and underlying
+libraries can be specified by the user.  By default, only errors and warnings
+are written to the standard error stream.  Using option \e --verbose also
+informational messages like processing details are reported.  Option
+\e --debug can be used to get more details on the internal activity, e.g. for
+debugging purposes.  Other logging levels can be selected using option
+\e --log-level.  In \e --quiet mode only fatal errors are reported.  In such
+very severe error events, the application will usually terminate.  For more
+details on the different logging levels, see documentation of module "oflog".
+
+In case the logging output should be written to file (optionally with logfile
+rotation), to syslog (Unix) or the event log (Windows) option \e --log-config
+can be used.  This configuration file also allows for directing only certain
+messages to a particular output stream and for filtering certain messages
+based on the module or application where they are generated.  An example
+configuration file is provided in <em>\<etcdir\>/logger.cfg</em>.
+
+\section dcmicmp_command_line COMMAND LINE
+
+All command line tools use the following notation for parameters: square
+brackets enclose optional values (0-1), three trailing dots indicate that
+multiple values are allowed (1-n), a combination of both means 0 to n values.
+
+Command line options are distinguished from parameters by a leading '+' or '-'
+sign, respectively.  Usually, order and position of command line options are
+arbitrary (i.e. they can appear anywhere).  However, if options are mutually
+exclusive the rightmost appearance is used.  This behavior conforms to the
+standard evaluation rules of common Unix shells.
+
+In addition, one or more command files can be specified using an '@' sign as a
+prefix to the filename (e.g. <em>\@command.txt</em>).  Such a command argument
+is replaced by the content of the corresponding text file (multiple
+whitespaces are treated as a single separator unless they appear between two
+quotation marks) prior to any further evaluation.  Please note that a command
+file cannot contain another command file.
+
+\section dcmicmp_exit_codes EXIT CODES
+
+The \b dcmicmp utility uses the following exit codes when terminating.  This
+enables the user to check for the reason why the application terminated.
+
+\subsection dcmicmp_exit_codes_general general
+\verbatim
+EXITCODE_NO_ERROR                         0
+EXITCODE_COMMANDLINE_SYNTAX_ERROR         1
+\endverbatim
+
+\subsection dcmicmp_exit_codes_input_file_errors input/output file errors
+\verbatim
+EXITCODE_INVALID_INPUT_FILE              22
+EXITCODE_CANNOT_WRITE_OUTPUT_FILE        40
+\endverbatim
+
+\subsection dcmicmp_exit_codes_image_processing image processing errors
+\verbatim
+EXITCODE_INITIALIZE_DIFF_IMAGE           80
+EXITCODE_DISPLAY_PIPELINE                81
+EXITCODE_IMAGE_COMPARISON                82
+\endverbatim
+
+\subsection dcmicmp_exit_codes_limit_exceeded error codes for exceeded limits
+\verbatim
+EXITCODE_LIMIT_EXCEEDED_MAX_ERROR        90
+EXITCODE_LIMIT_EXCEEDED_MAE              91
+EXITCODE_LIMIT_EXCEEDED_RMSE             92
+EXITCODE_LIMIT_EXCEEDED_PSNR             93
+EXITCODE_LIMIT_EXCEEDED_SNR              94
+\endverbatim
+
+\section dcmicmp_environment ENVIRONMENT
+
+The \b dcmicmp utility will attempt to load DICOM data dictionaries specified
+in the \e DCMDICTPATH environment variable.  By default, i.e. if the
+\e DCMDICTPATH environment variable is not set, the file
+<em>\<datadir\>/dicom.dic</em> will be loaded unless the dictionary is built
+into the application (default for Windows).
+
+The default behavior should be preferred and the \e DCMDICTPATH environment
+variable only used when alternative data dictionaries are required.  The
+\e DCMDICTPATH environment variable has the same format as the Unix shell
+\e PATH variable in that a colon (":") separates entries.  On Windows systems,
+a semicolon (";") is used as a separator.  The data dictionary code will
+attempt to load each file specified in the \e DCMDICTPATH environment variable.
+It is an error if no data dictionary can be loaded.
+
+\section dcmicmp_see_also SEE ALSO
+
+<b>dcm2pnm</b>(1)
+
+\section dcmicmp_copyright COPYRIGHT
+
+Copyright (C) 2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+
+*/
index f0c0abaf8252989725563c028c8b9f2a65068979..4197eaaf13bed0b5e218c8126fdc17e90643fcea 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmimage DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmimage DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
diff --git a/dcmimage/include/dcmtk/dcmimage/dcmicmph.h b/dcmimage/include/dcmtk/dcmimage/dcmicmph.h
new file mode 100644 (file)
index 0000000..c902625
--- /dev/null
@@ -0,0 +1,288 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  dcmimage
+ *
+ *  Author:  Marco Eichelberg
+ *
+ *  Purpose: A helper class for comparing an original image with
+ *    a processed version (e.g. after lossy compression)
+ *
+ */
+
+#ifndef DCMICMPH_H
+#define DCMICMPH_H
+
+#include "dcmtk/config/osconfig.h"
+#include "dcmtk/dcmimage/dicdefin.h" /* for export macros */
+#include "dcmtk/dcmimgle/diutils.h"  /* for EW_WindowType */
+#include "dcmtk/ofstd/ofstd.h"       /* for OFCondition */
+#include "dcmtk/dcmdata/dcxfer.h"    /* for E_TransferSyntax */
+
+class DicomImage;
+class DcmFileFormat;
+class DcmItem;
+
+/** A helper class for comparing an original image with
+ *  a processed version (e.g. after lossy compression).
+ */
+class DCMTK_DCMIMAGE_EXPORT DicomImageComparison
+{
+public:
+  /// default constructor
+  DicomImageComparison();
+
+  /// destructor
+  virtual ~DicomImageComparison();
+
+  /** instruct the DicomImageComparison instance that the creation
+   *  of a difference image during image comparison is requested.
+   *  This function must be called prior to the call to readReferenceImage().
+   *  @param amplify factor by which all pixel values in the difference image will be multiplied
+   *  @return EC_Normal if successful, and error code otherwise
+   */
+  OFCondition initializeDiffImage(OFCmdFloat amplify = 1.0);
+
+  /** save the difference image created during image comparison.
+   *  This function must be called after to the call to computeImageComparisonMetrics().
+   *  @param ofname filename to be created
+   *  @return EC_Normal if successful, and error code otherwise
+   */
+  OFCondition saveDiffImage(const char *ofname);
+
+  /** read reference image for image comparison from file
+   *  @param ifname filename for DcmFileFormat::loadFile()
+   *  @param xfer DICOM transfer syntax for DcmFileFormat::loadFile()
+   *  @param readMode file read mode for DcmFileFormat::loadFile()
+   *  @param compatibilityMode compatibility mode for DicomImage constructor
+   *  @return EC_Normal if successful, and error code otherwise
+   */
+  OFCondition readReferenceImage(
+    const char *ifname,
+    E_TransferSyntax xfer,
+    E_FileReadMode readMode,
+    unsigned long compatibilityMode);
+
+  /** read test image for image comparison from file
+   *  @param ifname filename for DcmFileFormat::loadFile()
+   *  @param xfer DICOM transfer syntax for DcmFileFormat::loadFile()
+   *  @param readMode file read mode for DcmFileFormat::loadFile()
+   *  @param compatibilityMode compatibility mode for DicomImage constructor
+   *  @return EC_Normal if successful, and error code otherwise
+   */
+  OFCondition readTestImage(
+    const char *ifname,
+    E_TransferSyntax xfer,
+    E_FileReadMode readMode,
+    unsigned long compatibilityMode);
+
+  /** configure the display pipelines for both referenced and test image.
+   *  @param windowType VOI LUT transformation to apply
+   *  @param sharedWindow compute common min/max window for both images if true, separate windows if false
+   *  @param windowParameter index of VOI LUT/window in file (if windowType is EWT_window_from_file or EWT_voi_lut_from_file)
+   *  @param windowCenter window center (ignored unless windowType is EWT_window_parameters)
+   *  @param windowWidth window width (ignored unless windowType is EWT_window_parameters)
+   *  @param voiFunction VOI LUT function (linear or sigmoid)
+   *  @param presShape Presentation LUT Shape (identity, reverse, lin OD)
+   *  @return EC_Normal if successful, and error code otherwise
+   */
+  OFCondition configureImages(
+    EW_WindowType windowType,
+    OFBool sharedWindow,
+    OFCmdUnsignedInt windowParameter,
+    OFCmdFloat windowCenter,
+    OFCmdFloat windowWidth,
+    EF_VoiLutFunction voiFunction,
+    ES_PresentationLut presShape);
+
+  /** compare both images and compute image comparion metrics.
+   *  @param windowType VOI LUT transformation to apply
+   *  @return EC_Normal if successful, an error code otherwise.
+   */
+  OFCondition computeImageComparisonMetrics(EW_WindowType windowType);
+
+  /// return maximum absolute error
+  unsigned long getMaxAbsoluteError() const
+  {
+    return max_error;
+  }
+
+  /// return mean absolute error
+  double getMeanAbsoluteError() const
+  {
+    return meanAbsoluteError;
+  }
+
+  /// return root mean square error
+  double getRootMeanSquareError() const
+  {
+    return rootMeanSquareError;
+  }
+
+  /// return peak signal to noise ratio
+  double getPeakSignalToNoiseRatio() const
+  {
+    return peakSignalToNoiseRatio;
+  }
+
+  /// return signal to noise ratio
+  double getSignalToNoiseRatio() const
+  {
+    return signalToNoiseRatio;
+  }
+
+private:
+
+  /// private undefined copy constructor
+  DicomImageComparison(const DicomImageComparison& rhs);
+
+  /// private undefined copy assignment operator
+  DicomImageComparison& operator=(const DicomImageComparison& arg);
+
+  /** read DICOM image and store pointer to it
+   *  @param di pointer to DICOM image, not NULL upon success, NULL otherwise
+   *  @param isReference indicates whether we're reading the reference image or the test image
+   *  @param ifname filename for DcmFileFormat::loadFile()
+   *  @param xfer DICOM transfer syntax for DcmFileFormat::loadFile()
+   *  @param readMode file read mode for DcmFileFormat::loadFile()
+   *  @param compatibilityMode compatibility mode for DicomImage constructor
+   *  @param diffImage pointer to DICOM dataset for difference image, may be NULL
+   *  @return EC_Normal if successful, and error code otherwise
+   */
+  static OFCondition readDICOMImage(
+    DicomImage *& di,
+    OFBool isReference,
+    const char *ifname,
+    E_TransferSyntax xfer,
+    E_FileReadMode readMode,
+    unsigned long compatibilityMode,
+    DcmItem *diffImage);
+
+  /** configure the display pipeline for a given DICOM image.
+   *  @param di DICOM image, must not be NULL
+   *  @param windowType VOI LUT transformation to apply
+   *  @param windowParameter index of VOI LUT/window in file (if windowType is EWT_window_from_file or EWT_voi_lut_from_file)
+   *  @param windowCenter window center (input for EWT_window_parameters, output for EWT_window_min_max and EWT_window_min_max_n)
+   *  @param windowWidth window width  (input for EWT_window_parameters, output for EWT_window_min_max and EWT_window_min_max_n)
+   *  @param voiFunction VOI LUT function (linear or sigmoid)
+   *  @param presShape Presentation LUT Shape (identity, reverse, lin OD)
+   *  @param depth bit depth to be used when accessing pixel data for this image returned in this parameter
+   *  @return EC_Normal if successful, and error code otherwise
+   */
+  static OFCondition configureImage(
+    DicomImage *di,
+    EW_WindowType windowType,
+    OFCmdUnsignedInt windowParameter,
+    OFCmdFloat& windowCenter,
+    OFCmdFloat& windowWidth,
+    EF_VoiLutFunction voiFunction,
+    ES_PresentationLut presShape,
+    int& depth);
+
+  /** initialize the difference image DICOM dataset by copying all required
+   *  attributes from the reference image and by generating all other attributes
+   *  except for the image pixel module, SOP Class UID, and the information to be copied
+   *  from the test image.
+   *  @param src reference image main dataset
+   *  @param diffImage difference image main dataset
+   */
+  static OFCondition copyReferenceImageAttributes(DcmItem *src, DcmItem *diffImage);
+
+  /** further populate the difference image DICOM dataset by copying all required
+   *  attributes from the test image.
+   *  @param src reference image main dataset
+   *  @param diffImage difference image main dataset
+   */
+  static OFCondition copyTestImageAttributes(DcmItem *src, DcmItem *diffImage);
+
+  /** print the characteristics of the image to to logger at DEBUG level.
+   *  @param di DICOM image
+   *  @param filename filename from which the image was loaded
+   */
+  static void logImageInfo(DicomImage *di, const char *filename);
+
+  /** create content for frame label vector
+   *  @param s string to which the frame label vector is written
+   *  @param numFrames number of frames present in the reference image
+   *  @param isColor true if reference image is a color image
+   */
+  static void createFrameLabelVector(OFString& s, unsigned long numFrames, OFBool isColor);
+
+  /** check if reference and test image have the same resolution,
+   *  number of frames and color model (color or monochrome).
+   *  @return EC_Normal if matching, an error code otherwise.
+   */
+  OFCondition checkImageCharacteristics() const;
+
+  /** compare two images that are both monochrome and have more than
+   *  8 bits/pixel in internal storage, as determined by BitsStored and
+   *  the Modality LUT that may have been applied.
+   *  @return EC_Normal if successful, an error code otherwise.
+   */
+  OFCondition computeMonochromeImageComparionMetricsWord();
+
+  /** compare two monochrome images without setting a VOI window.
+   *  @return EC_Normal if successful, an error code otherwise.
+   */
+  OFCondition computeMonochromeImageComparionMetricsRaw();
+
+  /** compare two images that are both monochrome and have at most
+   *  8 bits/pixel in internal storage, as determined by BitsStored and
+   *  the Modality LUT that may have been applied.
+   *  @return EC_Normal if successful, an error code otherwise.
+   */
+  OFCondition computeMonochromeImageComparionMetricsByte();
+
+  /** compare two images that are both color images.
+   *  @return EC_Normal if successful, an error code otherwise.
+   */
+  OFCondition computeColorImageComparionMetrics();
+
+  /// pointer to reference image
+  DicomImage *di_reference;
+
+  /// pointer to test image
+  DicomImage *di_test;
+
+  /// difference image in DICOM format
+  DcmFileFormat *diff_image;
+
+  /** result of image comparison: max difference between a sample value
+   *  in the reference image and the corresponding sample value in the test image
+   */
+  unsigned long max_error;
+
+  /// bits/sample to use when processing the reference image
+  int reference_bits;
+
+  /// bits/sample to use when processing the test image
+  int test_bits;
+
+  /// result of image comparison: mean absolute error
+  double meanAbsoluteError;
+
+  /// result of image comparison: root mean square error (RMSE)
+  double rootMeanSquareError;
+
+  /// result of image comparison: peak signal to noise ratio (PSNR)
+  double peakSignalToNoiseRatio;
+
+  /// result of image comparison: signal to noise ratio (SNR)
+  double signalToNoiseRatio;
+
+  /// factor by which all pixel values of the difference image will be multiplied
+  double amplification;
+};
+
+
+#endif
index 027aacc070c3e5e0ef8d0c9f8aee75071f08ca0f..a103b51e78064b4faae95efd7057d27a5d499280 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2003-2011, OFFIS e.V.
+ *  Copyright (C) 2003-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -46,6 +46,8 @@ class DiImage;
 /** describes the different types of interlace supported by
  *  the PNG plugin.  Enumeration depends on capabilities
  *  of underlying PNG library (libpng).
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  PNG (libpng) support enabled.
  */
 enum DiPNGInterlace
 {
@@ -57,7 +59,9 @@ enum DiPNGInterlace
 };
 
 /** describes the different types of metainfo written to
- *  the png file
+ *  the png file.
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  PNG (libpng) support enabled.
  */
 enum DiPNGMetainfo
 {
@@ -74,6 +78,8 @@ enum DiPNGMetainfo
  *---------------------*/
 
 /** Implementation of a PNG plugin for the dcmimgle/dcmimage library
+ *  @remark This class is only available if DCMTK is compiled with
+ *  PNG (libpng) support enabled.
  */
 class DCMTK_DCMIMAGE_EXPORT DiPNGPlugin
   : public DiPluginFormat
index 17d564eaea374da933522f7934c40b11c58af16b..d6853a6c8b8901f3666b08e53dfa77cc8e6f7b0b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2001-2011, OFFIS e.V.
+ *  Copyright (C) 2001-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -48,6 +48,8 @@ class DiImage;
 /** describes the different types of compression supported by
  *  the TIFF plugin.  Enumeration depends on capabilities
  *  of underlying TIFF library (libtiff).
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  TIFF (libtiff) support enabled.
  */
 enum DiTIFFCompression
 {
@@ -62,6 +64,8 @@ enum DiTIFFCompression
 };
 
 /** describes the optional predictor used with TIFF LZW compression
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  TIFF (libtiff) support enabled.
  */
 enum DiTIFFLZWPredictor
 {
@@ -81,6 +85,8 @@ enum DiTIFFLZWPredictor
  *---------------------*/
 
 /** Implementation of a TIFF plugin for the dcmimgle/dcmimage library
+ *  @remark This class is only available if DCMTK is compiled with
+ *  TIFF (libtiff) support enabled.
  */
 class DCMTK_DCMIMAGE_EXPORT DiTIFFPlugin
   : public DiPluginFormat
index 2a86b07f1978330d629a514565751d848931cb0b..a32993160c35aaa892b6ac504806f94a8a1627e1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2002-2010, OFFIS e.V.
+ *  Copyright (C) 2002-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -15,7 +15,7 @@
  *
  *  Author:  Marco Eichelberg
  *
- *  Purpose: typdefs and constants for the color quantization classes
+ *  Purpose: typedefs and constants for the color quantization classes
  *
  */
 
@@ -42,6 +42,13 @@ typedef unsigned char DcmQuantComponent;
 #define DcmQuantMaxColors 65536
 
 
+// include this file in doxygen documentation
+
+/** @file diqttype.h
+ *  @brief type definitions and constants for the color quantization classes
+ */
+
+
 /** defines the algorithm used for determining the
  *  largest dimension in the Median Cut algorithm
  */
index f1d4a11171e9df391bf3acc3c61a6bcc592a2d0c..b3a57133b775108aa607e1096edbc23751188993 100644 (file)
@@ -1,5 +1,5 @@
 # create library from source files
-DCMTK_ADD_LIBRARY(dcmimage diargimg dicmyimg dicoimg dicoopx dicopx dihsvimg dilogger dipalimg dipipng dipitiff diqtctab diqtfs diqthash diqthitl diqtpbox diquant diregist dirgbimg diybrimg diyf2img diyp2img)
+DCMTK_ADD_LIBRARY(dcmimage diargimg dicmyimg dicoimg dicoopx dicopx dihsvimg dilogger dipalimg dipipng dipitiff diqtctab diqtfs diqthash diqthitl diqtpbox diquant diregist dirgbimg diybrimg diyf2img diyp2img dcmicmph)
 
 DCMTK_TARGET_LINK_MODULES(dcmimage oflog dcmdata dcmimgle)
 DCMTK_TARGET_LINK_LIBRARIES(dcmimage ${LIBTIFF_LIBS} ${LIBPNG_LIBS})
index 0b482cb81beea9c76eb09a7a95c260786deed778..6a287c5760cb2b7230ca19b5bbff6c6e1f2aa67f 100644 (file)
@@ -1,3 +1,141 @@
+dcmicmph.o: dcmicmph.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmimage/dcmicmph.h \
+ ../include/dcmtk/dcmimage/dicdefin.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdicent.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcmetinf.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdicdir.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmap.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdirrec.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrulup.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcpixseq.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcofsetl.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvras.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdate.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrds.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
+ ../../ofstd/include/dcmtk/ofstd/oftime.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvris.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrur.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrlt.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrsh.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrst.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvruc.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrobow.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcpixel.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrpobw.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcovlay.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrss.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrfl.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
+ ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \
+ ../include/dcmtk/dcmimage/dilogger.h \
+ ../include/dcmtk/dcmimage/diregist.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diregbas.h
 diargimg.o: diargimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -34,6 +172,7 @@ diargimg.o: diargimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -43,6 +182,7 @@ diargimg.o: diargimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -117,6 +257,7 @@ dicmyimg.o: dicmyimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -126,6 +267,7 @@ dicmyimg.o: dicmyimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimage/dicmyimg.h ../include/dcmtk/dcmimage/dicoimg.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
@@ -191,6 +333,7 @@ dicoimg.o: dicoimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -200,6 +343,7 @@ dicoimg.o: dicoimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -286,6 +430,7 @@ dicoopx.o: dicoopx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -295,6 +440,7 @@ dicoopx.o: dicoopx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
  ../include/dcmtk/dcmimage/dicdefin.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h
@@ -334,6 +480,7 @@ dicopx.o: dicopx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -343,6 +490,7 @@ dicopx.o: dicopx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -409,6 +557,7 @@ dihsvimg.o: dihsvimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -418,6 +567,7 @@ dihsvimg.o: dihsvimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimage/dihsvimg.h ../include/dcmtk/dcmimage/dicoimg.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
@@ -483,6 +633,7 @@ dilogger.o: dilogger.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -492,6 +643,7 @@ dilogger.o: dilogger.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmimage/dicdefin.h
 dipalimg.o: dipalimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
@@ -529,6 +681,7 @@ dipalimg.o: dipalimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -538,6 +691,7 @@ dipalimg.o: dipalimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -612,6 +766,7 @@ dipipng.o: dipipng.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -621,6 +776,7 @@ dipipng.o: dipipng.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -682,6 +838,7 @@ dipitiff.o: dipitiff.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -691,6 +848,7 @@ dipitiff.o: dipitiff.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -768,12 +926,14 @@ diqtctab.o: diqtctab.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -849,6 +1009,7 @@ diqthash.o: diqthash.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -857,6 +1018,7 @@ diqthash.o: diqthash.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -944,6 +1106,7 @@ diquant.o: diquant.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -952,6 +1115,7 @@ diquant.o: diquant.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimage/diqttype.h \
  ../include/dcmtk/dcmimage/dicdefin.h ../include/dcmtk/dcmimage/diqtid.h \
@@ -1037,6 +1201,7 @@ diregist.o: diregist.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1046,6 +1211,7 @@ diregist.o: diregist.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
  ../include/dcmtk/dcmimage/dicdefin.h \
  ../include/dcmtk/dcmimage/dipalimg.h ../include/dcmtk/dcmimage/dicoimg.h \
@@ -1127,6 +1293,7 @@ dirgbimg.o: dirgbimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1136,6 +1303,7 @@ dirgbimg.o: dirgbimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimage/dirgbimg.h ../include/dcmtk/dcmimage/dicoimg.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
@@ -1201,6 +1369,7 @@ diybrimg.o: diybrimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1210,6 +1379,7 @@ diybrimg.o: diybrimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimage/diybrimg.h ../include/dcmtk/dcmimage/dicoimg.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
@@ -1280,6 +1450,7 @@ diyf2img.o: diyf2img.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1289,6 +1460,7 @@ diyf2img.o: diyf2img.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimage/diyf2img.h ../include/dcmtk/dcmimage/dicoimg.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
@@ -1359,6 +1531,7 @@ diyp2img.o: diyp2img.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1368,6 +1541,7 @@ diyp2img.o: diyp2img.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimage/diyp2img.h ../include/dcmtk/dcmimage/dicoimg.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
index 5c0491e9a5f6b469c2ffe756330cea64657f454f..fbcd5622ede3681c27eccea14329ee7a7e1367a5 100644 (file)
@@ -27,9 +27,10 @@ LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/incl
 objs = dicoimg.o dicopx.o dicoopx.o diregist.o dilogger.o \
        diargimg.o dicmyimg.o dihsvimg.o dipalimg.o dirgbimg.o \
        diybrimg.o diyf2img.o diyp2img.o dipitiff.o dipipng.o \
-       diqtctab.o diqtfs.o diqthash.o diqthitl.o diqtpbox.o diquant.o
-library = libdcmimage.$(LIBEXT)
+       diqtctab.o diqtfs.o diqthash.o diqthitl.o diqtpbox.o \
+       diquant.o dcmicmph.o
 
+library = libdcmimage.$(LIBEXT)
 
 all: $(library)
 
diff --git a/dcmimage/libsrc/dcmicmph.cc b/dcmimage/libsrc/dcmicmph.cc
new file mode 100644 (file)
index 0000000..0bb682c
--- /dev/null
@@ -0,0 +1,1526 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  dcmimage
+ *
+ *  Authors: Marco Eichelberg
+ *
+ *  Purpose: A helper class for comparing an original image with
+ *    a processed version (e.g. after lossy compression)
+ *
+ */
+
+
+#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
+#include "dcmtk/dcmimage/dcmicmph.h"  /* header file for this implementation file */
+
+#define INCLUDE_CSTDIO
+#define INCLUDE_CSTRING
+#define INCLUDE_CMATH
+#include "dcmtk/ofstd/ofstdinc.h"
+
+#include "dcmtk/ofstd/ofconapp.h"        /* for OFConsoleApplication */
+#include "dcmtk/ofstd/ofcmdln.h"         /* for OFCommandLine */
+#include "dcmtk/ofstd/ofstd.h"           /* for OFStandard */
+#include "dcmtk/dcmdata/dctk.h"          /* for various dcmdata headers */
+#include "dcmtk/dcmdata/cmdlnarg.h"      /* for prepareCmdLineArgs */
+#include "dcmtk/dcmdata/dcuid.h"         /* for dcmtk version name */
+#include "dcmtk/dcmimgle/dcmimage.h"     /* for DicomImage */
+#include "dcmtk/dcmimage/dilogger.h"     /* for the logger macros */
+#include "dcmtk/dcmimage/diregist.h"     /* include to support color images */
+
+#ifdef WITH_ZLIB
+#include <zlib.h>                        /* for zlibVersion() */
+#endif
+
+// ********************************************
+
+DicomImageComparison::DicomImageComparison()
+: di_reference(NULL)
+, di_test(NULL)
+, diff_image(NULL)
+, max_error(0)
+, reference_bits(0)
+, test_bits(0)
+, meanAbsoluteError(0.0)
+, rootMeanSquareError(0.0)
+, peakSignalToNoiseRatio(0.0)
+, signalToNoiseRatio(0.0)
+, amplification(1.0)
+{
+}
+
+
+DicomImageComparison::~DicomImageComparison()
+{
+  delete di_reference;
+  delete di_test;
+  delete diff_image;
+}
+
+
+OFCondition DicomImageComparison::initializeDiffImage(OFCmdFloat amplify)
+{
+    // This function can only be called prior to the call to readReferenceImage().
+    if (di_reference) return EC_IllegalCall;
+
+    amplification = amplify;
+    delete diff_image;
+    diff_image = new DcmFileFormat();
+    return EC_Normal;
+}
+
+
+OFCondition DicomImageComparison::saveDiffImage(const char *ofname)
+{
+  if (ofname == NULL) return EC_IllegalCall;
+  if (diff_image == NULL) return EC_IllegalCall;
+  return diff_image->saveFile(ofname, EXS_LittleEndianExplicit);
+}
+
+
+OFCondition DicomImageComparison::readDICOMImage(
+    DicomImage *& di,
+    OFBool isReference,
+    const char *ifname,
+    E_TransferSyntax xfer,
+    E_FileReadMode readMode,
+    unsigned long compatibilityMode,
+    DcmItem *diffImage)
+{
+
+    // make sure that we do not create a memory leak
+    compatibilityMode |= (CIF_MayDetachPixelData | CIF_TakeOverExternalDataset) ;
+
+    // since we process all frames anyway, decompress the complete pixel data (if required)
+    compatibilityMode |= CIF_DecompressCompletePixelData;
+
+    if (ifname == NULL) return EC_IllegalCall;
+
+    DCMIMAGE_INFO("reading DICOM file: " << ifname);
+
+    // load DICOM file as DcmFileFormat
+    DcmFileFormat *dfile = new DcmFileFormat();
+    OFCondition cond = dfile->loadFile(ifname, xfer, EGL_withoutGL, DCM_MaxReadLength, readMode);
+    if (cond.bad())
+    {
+        DCMIMAGE_ERROR(cond.text() << ": reading file: " << ifname);
+        delete dfile;
+    } else {
+        // determine transfer syntax
+        E_TransferSyntax original_xfer = dfile->getDataset()->getOriginalXfer();
+
+        // The DicomImage instance takes ownership of the DcmFileFormat instance. Do not delete manually.
+        di = new DicomImage(dfile, original_xfer, compatibilityMode);
+
+        // check status of the DICOM image object
+        if (di->getStatus() == EIS_Normal)
+        {
+            logImageInfo(di, ifname);
+            // initialize diff image from reference and test dataset
+            if (diffImage)
+            {
+                if (isReference)
+                    cond = copyReferenceImageAttributes(dfile->getDataset(), diffImage);
+                    else cond = copyTestImageAttributes(dfile->getDataset(), diffImage);
+            }
+        } else {
+            // Creation of DicomImage object failed. Bail out.
+            const char *msg = DicomImage::getString(di->getStatus());
+            DCMIMAGE_ERROR(msg);
+            cond = makeOFCondition(OFM_dcmimage, 129, OF_error, msg);
+            delete di;
+            di = NULL;
+        }
+    }
+    return cond;
+}
+
+
+OFCondition DicomImageComparison::readReferenceImage(
+  const char *ifname,
+  E_TransferSyntax xfer,
+  E_FileReadMode readMode,
+  unsigned long compatibilityMode)
+{
+    delete di_reference;
+    di_reference = NULL;
+    DcmItem *di = NULL;
+    if (diff_image) di = diff_image->getDataset();
+    return readDICOMImage(di_reference, OFTrue, ifname, xfer, readMode, compatibilityMode, di);
+}
+
+
+OFCondition DicomImageComparison::readTestImage(
+  const char *ifname,
+  E_TransferSyntax xfer,
+  E_FileReadMode readMode,
+  unsigned long compatibilityMode)
+{
+    delete di_test;
+    di_test = NULL;
+    DcmItem *di = NULL;
+    if (diff_image) di = diff_image->getDataset();
+    return readDICOMImage(di_test, OFFalse, ifname, xfer, readMode, compatibilityMode, di);
+}
+
+
+OFCondition DicomImageComparison::configureImage(
+    DicomImage *di,
+    EW_WindowType windowType,
+    OFCmdUnsignedInt windowParameter,
+    OFCmdFloat& windowCenter,
+    OFCmdFloat& windowWidth,
+    EF_VoiLutFunction voiFunction,
+    ES_PresentationLut presShape,
+    int& depth)
+{
+    /* check parameters */
+    if (di == NULL) return EC_IllegalCall;
+
+    /* hide overlays*/
+    di->hideAllOverlays();
+
+    /* determine bit depth to request when processing the pixel data */
+    depth = di->getDepth();
+    if (depth > 16) depth = 16;
+    if (depth < 8) depth = 8;
+
+    /* process VOI parameters */
+    switch (windowType)
+    {
+        case EWT_none: /* no VOI windowing */
+            if (di->isMonochrome())
+            {
+                DCMIMAGE_DEBUG("disabling VOI window computation");
+                if (!di->setNoVoiTransformation())
+                    DCMIMAGE_WARN("cannot ignore VOI window");
+            }
+            break;
+        case EWT_window_minmax: /* compute VOI window using min-max algorithm */
+            if (!di->setMinMaxWindow(0))
+                DCMIMAGE_WARN("cannot compute min/max VOI window");
+            if (!di->getWindow(windowCenter, windowWidth))
+                DCMIMAGE_WARN("cannot retrieve VOI window");
+            DCMIMAGE_DEBUG("activating min/max VOI window center=" << windowCenter << ", width=" << windowWidth);
+            break;
+        case EWT_window_minmax_n: /* compute VOI window using min-max algorithm ignoring extremes */
+            if (!di->setMinMaxWindow(0))
+                DCMIMAGE_WARN("cannot compute min/max VOI window");
+            if (!di->getWindow(windowCenter, windowWidth))
+                DCMIMAGE_WARN("cannot retrieve VOI window");
+            DCMIMAGE_DEBUG("activating min/max-n VOI window center=" << windowCenter << ", width=" << windowWidth);
+            break;
+        case EWT_window_from_file: /* use the n-th VOI window from the image file */
+            if ((windowParameter < 1) || (windowParameter > di->getWindowCount()))
+            {
+                DCMIMAGE_FATAL("cannot select VOI window " << windowParameter << ", only "
+                    << di->getWindowCount() << " window(s) in file");
+                return makeOFCondition(OFM_dcmimage, 130, OF_error, "cannot select VOI window");
+            }
+            DCMIMAGE_DEBUG("activating VOI window " << windowParameter);
+            if (!di->setWindow(windowParameter - 1))
+                DCMIMAGE_WARN("cannot select VOI window " << windowParameter);
+            break;
+        case EWT_voi_lut_from_file: /* use the n-th VOI look up table from the image file */
+            if ((windowParameter < 1) || (windowParameter > di->getVoiLutCount()))
+            {
+                DCMIMAGE_FATAL("cannot select VOI LUT " << windowParameter << ", only "
+                    << di->getVoiLutCount() << " LUT(s) in file");
+                return makeOFCondition(OFM_dcmimage, 131, OF_error, "cannot select VOI LUT");
+            }
+            DCMIMAGE_DEBUG("activating VOI LUT " << windowParameter);
+            if (!di->setVoiLut(windowParameter - 1, ELM_UseValue))
+                DCMIMAGE_WARN("cannot select VOI LUT " << windowParameter);
+            break;
+        case EWT_window_center_width: /* Compute VOI window using center and width */
+            DCMIMAGE_DEBUG("activating VOI window center=" << windowCenter << ", width=" << windowWidth);
+            if (!di->setWindow(windowCenter, windowWidth))
+                DCMIMAGE_WARN("cannot set VOI window to specified values");
+            break;
+        default: /* unsupported type */
+            DCMIMAGE_FATAL("unsupported type of VOI LUT transformation requested.");
+            return makeOFCondition(OFM_dcmimage, 132, OF_error, "unsupported type of VOI LUT transformation requested");
+            break;
+    }
+
+    /* VOI LUT function */
+    if (voiFunction != EFV_Default)
+    {
+        if (voiFunction == EFV_Linear)
+            DCMIMAGE_DEBUG("setting VOI LUT function to LINEAR");
+        else if (voiFunction == EFV_Sigmoid)
+            DCMIMAGE_DEBUG("setting VOI LUT function to SIGMOID");
+        if (!di->setVoiLutFunction(voiFunction))
+            DCMIMAGE_WARN("cannot set VOI LUT function");
+    }
+
+    /* process presentation LUT parameters */
+    if (presShape != ESP_Default)
+    {
+        if (presShape == ESP_Identity)
+            DCMIMAGE_DEBUG("setting presentation LUT shape to IDENTITY");
+        else if (presShape == ESP_Inverse)
+            DCMIMAGE_DEBUG("setting presentation LUT shape to INVERSE");
+        else if (presShape == ESP_LinOD)
+            DCMIMAGE_DEBUG("setting presentation LUT shape to LIN OD");
+        if (!di->setPresentationLutShape(presShape))
+            DCMIMAGE_WARN("cannot set presentation LUT shape");
+    }
+
+    return EC_Normal;
+}
+
+
+OFCondition DicomImageComparison::configureImages(
+    EW_WindowType windowType,
+    OFBool sharedWindow,
+    OFCmdUnsignedInt windowParameter,
+    OFCmdFloat windowCenter,
+    OFCmdFloat windowWidth,
+    EF_VoiLutFunction voiFunction,
+    ES_PresentationLut presShape)
+{
+  OFCondition cond = configureImage(di_reference, windowType, windowParameter, windowCenter, windowWidth, voiFunction, presShape, reference_bits);
+
+  // When the user has requested a shared min/max window, re-use the VOI window computed for the reference image also for the test image
+  EW_WindowType windowTypeTestImage = windowType;
+  if (sharedWindow && ((windowType == EWT_window_minmax)||(windowType == EWT_window_minmax_n)))
+      windowTypeTestImage = EWT_window_center_width;
+
+  if (cond.good()) cond = configureImage(di_test, windowTypeTestImage, windowParameter, windowCenter, windowWidth, voiFunction, presShape, test_bits);
+
+  if (di_reference->isMonochrome() && (windowType != EWT_none))
+  {
+      // If a VOI window is applied, use the maximum of the bit depths
+      // determined by configureImage() for both images.
+      if (reference_bits > test_bits)
+          test_bits = reference_bits;
+          else reference_bits = test_bits;
+  }
+
+  DCMIMAGE_DEBUG("Bits/sample selected for reference image: " << reference_bits);
+  DCMIMAGE_DEBUG("Bits/sample selected for test image: " << test_bits);
+  return cond;
+}
+
+OFCondition DicomImageComparison::checkImageCharacteristics() const
+{
+  //check if images have actually been loaded
+  if (di_reference == NULL) return EC_IllegalCall;
+  if (di_test == NULL) return EC_IllegalCall;
+
+  // check resolution
+  if ((di_reference->getWidth() != di_test->getWidth()) || (di_reference->getHeight() != di_test->getHeight()))
+  {
+      DCMIMAGE_FATAL("Resolution mismatch: "
+        << di_reference->getWidth() << " x " << di_reference->getHeight() << " vs. "
+        << di_test->getWidth() << " x " << di_test->getHeight());
+      return makeOFCondition(OFM_dcmimage, 133, OF_error, "resolution mismatch between reference and test image");
+  }
+
+  // check color model
+  if ((di_reference->isMonochrome() && (! di_test->isMonochrome())) || (di_test->isMonochrome() && (! di_reference->isMonochrome())))
+  {
+      const char *colorModel1 =  di_reference->getString(di_reference->getPhotometricInterpretation());
+      if (colorModel1 == NULL) colorModel1 = "unknown";
+
+      const char *colorModel2 =  di_test->getString(di_test->getPhotometricInterpretation());
+      if (colorModel2 == NULL) colorModel2 = "unknown";
+
+      DCMIMAGE_FATAL("Color model mismatch: "
+        << colorModel1 << " vs. " << colorModel2);
+      return makeOFCondition(OFM_dcmimage, 133, OF_error, "color model mismatch between reference and test image");
+  }
+
+  // check number of frames to process
+  if (di_reference->getFrameCount() != di_test->getFrameCount())
+  {
+      DCMIMAGE_FATAL("Frame count mismatch: "
+        << di_reference->getFrameCount() << " vs. " << di_test->getFrameCount());
+      return makeOFCondition(OFM_dcmimage, 133, OF_error, "frame count mismatch between reference and test image");
+  }
+
+  return EC_Normal;
+}
+
+
+OFCondition DicomImageComparison::computeImageComparisonMetrics(EW_WindowType windowType)
+{
+    DCMIMAGE_DEBUG("Computing image comparison metrics");
+
+    // initialize comparison results
+    max_error = 0;
+    meanAbsoluteError = 0.0;
+    rootMeanSquareError = 0.0;
+    peakSignalToNoiseRatio = 0.0;
+    signalToNoiseRatio = 0.0;
+
+    OFCondition cond = checkImageCharacteristics();
+    if (cond.good())
+    {
+       // we don't need to check if di_reference == NULL,
+       // because checkImageCharacteristics() already did that for us.
+       if (di_reference->isMonochrome() && ((reference_bits > 8) || (windowType == EWT_none)))
+       {
+              // monochrome image with more than 8 bits/pixel
+              if (diff_image)
+              {
+                  // monochrome image with more than 8 bits/pixel
+                  // write Multiframe Grayscale Word SC Image
+                  cond = diff_image->getDataset()->putAndInsertString(DCM_SOPClassUID, UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage);
+                  if (cond.bad()) return cond;
+                  cond = diff_image->getDataset()->putAndInsertUint16(DCM_BitsAllocated, 16);
+                  if (cond.bad()) return cond;
+                  cond = diff_image->getDataset()->putAndInsertUint16(DCM_BitsStored, 16);
+                  if (cond.bad()) return cond;
+                  cond = diff_image->getDataset()->putAndInsertUint16(DCM_HighBit, 15);
+                  if (cond.bad()) return cond;
+              }
+              if (windowType == EWT_none)
+                  cond = computeMonochromeImageComparionMetricsRaw();
+                  else cond = computeMonochromeImageComparionMetricsWord();
+       }
+       else
+       {
+          if (diff_image)
+          {
+              // image with 8 bits/pixel (color or monochrome)
+              // the difference image is always be a Multiframe Grayscale Byte SC Image
+              cond = diff_image->getDataset()->putAndInsertString(DCM_SOPClassUID, UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage);
+              if (cond.bad()) return cond;
+              cond = diff_image->getDataset()->putAndInsertUint16(DCM_BitsAllocated, 8);
+              if (cond.bad()) return cond;
+              cond = diff_image->getDataset()->putAndInsertUint16(DCM_BitsStored, 8);
+              if (cond.bad()) return cond;
+              cond = diff_image->getDataset()->putAndInsertUint16(DCM_HighBit, 7);
+              if (cond.bad()) return cond;
+          }
+          if (di_reference->isMonochrome())
+              cond = computeMonochromeImageComparionMetricsByte();
+              else cond = computeColorImageComparionMetrics();
+       }
+    }
+    return cond;
+}
+
+
+OFCondition DicomImageComparison::computeMonochromeImageComparionMetricsWord()
+{
+    DCMIMAGE_DEBUG("Type of computation: monochrome, 16-bits/sample");
+
+    // this check should have already been performed, but just to be sure, and since it's cheap...
+    OFCondition cond = checkImageCharacteristics();
+    if (cond.good() && di_reference->isMonochrome() && (reference_bits > 8))
+    {
+        unsigned long numBytes = di_reference->getOutputDataSize(reference_bits);
+        unsigned int fcount = di_reference->getFrameCount();
+        if (numBytes != di_test->getOutputDataSize(test_bits))
+        {
+            DCMIMAGE_FATAL("Frame size mismatch: "
+                << numBytes << " vs. " << di_test->getOutputDataSize(test_bits) << " bytes");
+            return makeOFCondition(OFM_dcmimage, 134, OF_error, "frame size mismatch");
+        }
+        unsigned long numValues = (numBytes+1) / sizeof(Uint16);
+
+        // prepare creation of difference image pixel data
+        Uint16 *dv = NULL;
+        double dvp;
+        if (diff_image)
+        {
+            // create empty pixel data element and insert into main dataset
+            DcmPixelData *pxd = new DcmPixelData(DCM_PixelData);
+            cond = diff_image->getDataset()->insert(pxd);
+            if (cond.bad()) return cond;
+
+            // create pixel data buffer for all frames of the difference image
+            Uint32 pixelDataLen = numValues * fcount;
+            cond = pxd->createUint16Array(pixelDataLen, dv);
+            if (cond.bad()) return cond;
+        }
+
+        const Uint16 *f1;
+        const Uint16 *f2;
+
+        double square_error_sum = 0; // sum of squared differences between reference and test
+        double simple_error_sum = 0; // sum of (unsigned) differences between reference and test
+        double square_reference_sum = 0; // sum of squared pixel values in reference image
+        unsigned long square_signal_strength = 0; // maximum pixel value in reference image
+        max_error = 0; // maximum (unsigned) difference between reference and test pixel value
+
+        // iterate over all frames
+        for (unsigned int frame = 0; frame < fcount; frame++)
+        {
+            DCMIMAGE_DEBUG("Processing frame " << frame);
+            const void *frame1 = di_reference->getOutputData(16, frame);
+            const void *frame2 = di_test->getOutputData(16, frame);
+            if ((frame1 == NULL) || (frame2 == NULL))
+            {
+              DCMIMAGE_FATAL("Memory exhausted while accessing frames");
+              return EC_MemoryExhausted;
+            }
+            f1 = OFreinterpret_cast(const Uint16 *, frame1);
+            f2 = OFreinterpret_cast(const Uint16 *, frame2);
+            long i1, i2;
+            unsigned long i3, t;
+
+            // iterate over all samples (pixel values) of the current frame
+            for (unsigned long i = 0; i < numValues; ++i)
+            {
+              i1 = *f1; // pixel value in the reference image
+              i2 = *f2; // pixel value in the test image
+              i3 = OFstatic_cast(unsigned long, labs(i1 - i2)); // absolute difference, without sign
+              if (dv)
+              {
+                  dvp = amplification * i3;  // compute diff image pixel value
+                  if (dvp > 65535)
+                      *dv++ = OFstatic_cast(Uint16, 65535);
+                      else *dv++ = OFstatic_cast(Uint16, dvp);
+
+              }
+              max_error = (i3 > max_error ? i3 : max_error);
+              square_error_sum += (double)(i3*i3);
+              simple_error_sum += i3;
+              t = i1 * i1;
+              square_reference_sum += t;
+              square_signal_strength = (t > square_signal_strength) ? t : square_signal_strength;
+              ++f1;
+              ++f2;
+            }
+        }
+
+        // The following four metrics, MAE, RMSE, PSNR and SNR are computed as defined in
+        // R.C. Gonzalez and R.E. Woods, "Digital Image Processing," Prentice Hall 2008
+
+        DCMIMAGE_DEBUG("square_signal_strength: " << square_signal_strength);
+        DCMIMAGE_DEBUG("square_error_sum: " << square_error_sum);
+
+        // as a helper variable, divide the sum of squared errors by the total number of samples
+        double meanSquareError = square_error_sum / (numValues * fcount);
+
+        // the mean absolute error is the sum of (unsigned) error values divided by the total number of samples
+        meanAbsoluteError = simple_error_sum / (numValues * fcount);
+
+        // RMSE is the square root of the mean square error
+        rootMeanSquareError = sqrt(meanSquareError);
+
+        // PSNR is -10 * the logarithm of the mean square error divided by the squared signal strength
+        //(maximum pixel value in reference image)
+        peakSignalToNoiseRatio = log10(meanSquareError / square_signal_strength) * -10.0;
+
+        // SNR is the 10 * the logarithm of the signal (squared sum of all reference pixel values)
+        // divided by the noise (squared sum of all difference values)
+        signalToNoiseRatio =  log10(square_reference_sum / square_error_sum) * 10.0;
+
+        if (diff_image)
+        {
+            char buf[30];
+            OFStandard::snprintf(buf, 30, "%lu", OFstatic_cast(unsigned long, di_reference->getFrameCount()));
+            cond = diff_image->getDataset()->putAndInsertUint16(DCM_Rows, OFstatic_cast(Uint16, di_reference->getHeight()));
+            if (cond.good()) cond = diff_image->getDataset()->putAndInsertUint16(DCM_Columns, OFstatic_cast(Uint16, di_reference->getWidth()));
+            if (cond.good()) cond = diff_image->getDataset()->putAndInsertString(DCM_NumberOfFrames, buf);
+            if (di_reference->getFrameCount() > 1)
+            {
+                DcmTagKey frameIncrementPointer(0x0018, 0x2002);
+                if (cond.good()) cond = diff_image->getDataset()->putAndInsertTagKey(DCM_FrameIncrementPointer, frameIncrementPointer);
+                OFString frameLabelVector;
+                createFrameLabelVector(frameLabelVector, di_reference->getFrameCount(), OFFalse);
+                if (cond.good()) cond = diff_image->getDataset()->putAndInsertOFStringArray(DCM_FrameLabelVector, frameLabelVector);
+            }
+        }
+    }
+    return cond;
+}
+
+OFCondition DicomImageComparison::computeMonochromeImageComparionMetricsRaw()
+{
+    DCMIMAGE_DEBUG("Type of computation: monochrome, without VOI transformation");
+
+    // this check should have already been performed, but just to be sure, and since it's cheap...
+    OFCondition cond = checkImageCharacteristics();
+    if (cond.good() && di_reference->isMonochrome())
+    {
+        // get pointer to internal image representation
+        // (which means Modality LUT has been applied unless disabled, but nothing else)
+        const DiPixel *dinter_reference = di_reference->getInterData();
+        if (dinter_reference == NULL) return EC_IllegalCall;
+        const DiPixel *dinter_test = di_test->getInterData();
+        if (dinter_test == NULL) return EC_IllegalCall;
+
+        // get pointer to internal raw representations of image data
+        const void *draw_reference = dinter_reference->getData();
+        if (draw_reference == NULL) return EC_IllegalCall;
+        const void *draw_test = dinter_test->getData();
+        if (draw_test == NULL) return EC_IllegalCall;
+
+        // get internal representations used for both images
+        EP_Representation drep_reference = dinter_reference->getRepresentation();
+        EP_Representation drep_test = dinter_test->getRepresentation();
+
+        // determine number of pixels
+        unsigned int fcount = di_reference->getFrameCount();
+        unsigned long numValues = di_reference->getWidth() * di_reference->getHeight() * fcount;
+        if (dinter_reference->getCount() < numValues)
+        {
+            DCMIMAGE_FATAL("Insufficient pixel data in reference image: " << numValues << " needed, " << dinter_reference->getCount() << " found.");
+            return makeOFCondition(OFM_dcmimage, 138, OF_error, "insufficient pixel data in reference image");
+        }
+        if (dinter_test->getCount() < numValues)
+        {
+            DCMIMAGE_FATAL("Insufficient pixel data in test image: " << numValues << " needed, " << dinter_reference->getCount() << " found.");
+            return makeOFCondition(OFM_dcmimage, 139, OF_error, "insufficient pixel data in test image");
+        }
+
+        // prepare creation of difference image pixel data
+        Uint16 *dv = NULL;
+        double dvp;
+        if (diff_image)
+        {
+            // create empty pixel data element and insert into main dataset
+            DcmPixelData *pxd = new DcmPixelData(DCM_PixelData);
+            cond = diff_image->getDataset()->insert(pxd);
+            if (cond.bad()) return cond;
+
+            // create pixel data buffer for all frames of the difference image
+            Uint32 pixelDataLen = numValues;
+            cond = pxd->createUint16Array(pixelDataLen, dv);
+            if (cond.bad()) return cond;
+        }
+
+        // create pointers to reference image pixel data in all possible formats
+        const Uint8  *ref_as_uint8  = OFreinterpret_cast(const Uint8  *, draw_reference);
+        const Sint8  *ref_as_sint8  = OFreinterpret_cast(const Sint8  *, draw_reference);
+        const Uint16 *ref_as_uint16 = OFreinterpret_cast(const Uint16 *, draw_reference);
+        const Sint16 *ref_as_sint16 = OFreinterpret_cast(const Sint16 *, draw_reference);
+
+        // create pointers to test image pixel data in all possible formats
+        const Uint8  *test_as_uint8  = OFreinterpret_cast(const Uint8  *, draw_test);
+        const Sint8  *test_as_sint8  = OFreinterpret_cast(const Sint8  *, draw_test);
+        const Uint16 *test_as_uint16 = OFreinterpret_cast(const Uint16 *, draw_test);
+        const Sint16 *test_as_sint16 = OFreinterpret_cast(const Sint16 *, draw_test);
+
+        double square_error_sum = 0; // sum of squared differences between reference and test
+        double simple_error_sum = 0; // sum of (unsigned) differences between reference and test
+        double square_reference_sum = 0; // sum of squared pixel values in reference image
+        unsigned long square_signal_strength = 0; // maximum pixel value in reference image
+        max_error = 0; // maximum (unsigned) difference between reference and test pixel value
+
+        long i1, i2;
+        unsigned long i3, t;
+
+        // iterate over all samples (pixel values) of all frames
+        for (unsigned int i = 0; i < numValues; i++)
+        {
+            switch(drep_reference)
+            {
+                case EPR_Uint8: // image representation is 8 bit unsigned
+                    i1 = *ref_as_uint8++;
+                    break;
+                case EPR_Sint8: // image representation is 8 bit signed
+                    i1 = *ref_as_sint8++;
+                    break;
+                case EPR_Uint16: // image representation is 16 bit unsigned
+                    i1 = *ref_as_uint16++;
+                    break;
+                case EPR_Sint16: // image representation is 16 bit signed
+                    i1 = *ref_as_sint16++;
+                    break;
+                default:
+                    return makeOFCondition(OFM_dcmimage, 140, OF_error, "unsupported internal pixel representation");
+                    break;
+            }
+            switch(drep_test)
+            {
+                case EPR_Uint8: // image representation is 8 bit unsigned
+                    i2 = *test_as_uint8++;
+                    break;
+                case EPR_Sint8: // image representation is 8 bit signed
+                    i2 = *test_as_sint8++;
+                    break;
+                case EPR_Uint16: // image representation is 16 bit unsigned
+                    i2 = *test_as_uint16++;
+                    break;
+                case EPR_Sint16: // image representation is 16 bit signed
+                    i2 = *test_as_sint16++;
+                    break;
+                default:
+                    return makeOFCondition(OFM_dcmimage, 141, OF_error, "unsupported internal pixel representation");
+                    break;
+            }
+
+            i3 = OFstatic_cast(unsigned long, labs(i1 - i2)); // absolute difference, without sign
+            if (dv)
+            {
+                dvp = amplification * i3;  // compute diff image pixel value
+                if (dvp > 65535)
+                    *dv++ = OFstatic_cast(Uint16, 65535);
+                    else *dv++ = OFstatic_cast(Uint16, dvp);
+
+            }
+            max_error = (i3 > max_error ? i3 : max_error);
+            square_error_sum += (double)(i3*i3);
+            simple_error_sum += i3;
+            t = i1 * i1;
+            square_reference_sum += t;
+            square_signal_strength = (t > square_signal_strength) ? t : square_signal_strength;
+        }
+
+        // The following four metrics, MAE, RMSE, PSNR and SNR are computed as defined in
+        // R.C. Gonzalez and R.E. Woods, "Digital Image Processing," Prentice Hall 2008
+
+        DCMIMAGE_DEBUG("square_signal_strength: " << square_signal_strength);
+        DCMIMAGE_DEBUG("square_error_sum: " << square_error_sum);
+
+        // as a helper variable, divide the sum of squared errors by the total number of samples
+        double meanSquareError = square_error_sum / (numValues * fcount);
+
+        // the mean absolute error is the sum of (unsigned) error values divided by the total number of samples
+        meanAbsoluteError = simple_error_sum / (numValues * fcount);
+
+        // RMSE is the square root of the mean square error
+        rootMeanSquareError = sqrt(meanSquareError);
+
+        // PSNR is -10 * the logarithm of the mean square error divided by the squared signal strength
+        //(maximum pixel value in reference image)
+        peakSignalToNoiseRatio = log10(meanSquareError / square_signal_strength) * -10.0;
+
+        // SNR is the 10 * the logarithm of the signal (squared sum of all reference pixel values)
+        // divided by the noise (squared sum of all difference values)
+        signalToNoiseRatio =  log10(square_reference_sum / square_error_sum) * 10.0;
+
+        if (diff_image)
+        {
+            char buf[30];
+            OFStandard::snprintf(buf, 30, "%lu", OFstatic_cast(unsigned long, di_reference->getFrameCount()));
+            cond = diff_image->getDataset()->putAndInsertUint16(DCM_Rows, OFstatic_cast(Uint16, di_reference->getHeight()));
+            if (cond.good()) cond = diff_image->getDataset()->putAndInsertUint16(DCM_Columns, OFstatic_cast(Uint16, di_reference->getWidth()));
+            if (cond.good()) cond = diff_image->getDataset()->putAndInsertString(DCM_NumberOfFrames, buf);
+            if (di_reference->getFrameCount() > 1)
+            {
+                DcmTagKey frameIncrementPointer(0x0018, 0x2002);
+                if (cond.good()) cond = diff_image->getDataset()->putAndInsertTagKey(DCM_FrameIncrementPointer, frameIncrementPointer);
+                OFString frameLabelVector;
+                createFrameLabelVector(frameLabelVector, di_reference->getFrameCount(), OFFalse);
+                if (cond.good()) cond = diff_image->getDataset()->putAndInsertOFStringArray(DCM_FrameLabelVector, frameLabelVector);
+            }
+        }
+    }
+    return cond;
+}
+
+
+OFCondition DicomImageComparison::computeMonochromeImageComparionMetricsByte()
+{
+    DCMIMAGE_DEBUG("Type of computation: monochrome, 8-bits/sample");
+
+    // this check should have already been performed, but just to be sure, and since it's cheap...
+    OFCondition cond = checkImageCharacteristics();
+    if (cond.good() && di_reference->isMonochrome())
+    {
+        unsigned long numBytes = di_reference->getOutputDataSize(8);
+        unsigned int fcount = di_reference->getFrameCount();
+        if (numBytes != di_test->getOutputDataSize(8))
+        {
+          DCMIMAGE_FATAL("Frame size mismatch: "
+            << numBytes << " vs. " << di_test->getOutputDataSize(8) << " bytes");
+          return makeOFCondition(OFM_dcmimage, 135, OF_error, "frame size mismatch");
+        }
+        unsigned long numValues = numBytes;
+
+        // prepare creation of difference image pixel data
+        Uint8 *dv = NULL;
+        double dvp;
+        if (diff_image)
+        {
+            // create empty pixel data element and insert into main dataset
+            DcmPixelData *pxd = new DcmPixelData(DCM_PixelData);
+            cond = diff_image->getDataset()->insert(pxd);
+            if (cond.bad()) return cond;
+
+            // create pixel data buffer for all frames of the difference image
+            Uint32 pixelDataLen = numValues * fcount;
+            cond = pxd->createUint8Array(pixelDataLen, dv);
+            if (cond.bad()) return cond;
+        }
+
+        const Uint8 *f1;
+        const Uint8 *f2;
+
+        double square_error_sum = 0; // sum of squared differences between reference and test
+        double simple_error_sum = 0; // sum of (unsigned) differences between reference and test
+        double square_reference_sum = 0; // sum of squared pixel values in reference image
+        unsigned long square_signal_strength = 0; // maximum pixel value in reference image
+        max_error = 0; // maximum (unsigned) difference between reference and test pixel value
+
+        // iterate over all frames
+        for (unsigned int frame = 0; frame < fcount; frame++)
+        {
+            DCMIMAGE_DEBUG("Processing frame " << frame);
+            const void *frame1 = di_reference->getOutputData(8, frame);
+            const void *frame2 = di_test->getOutputData(8, frame);
+            if ((frame1 == NULL) || (frame2 == NULL))
+            {
+              DCMIMAGE_FATAL("Memory exhausted while accessing frames");
+              return EC_MemoryExhausted;
+            }
+            f1 = OFreinterpret_cast(const Uint8 *, frame1);
+            f2 = OFreinterpret_cast(const Uint8 *, frame2);
+            long i1, i2;
+            unsigned long i3, t;
+
+            // iterate over all samples (pixel values) of the current frame
+            for (unsigned long i = 0; i < numValues; ++i)
+            {
+              i1 = *f1; // pixel value in the reference image
+              i2 = *f2; // pixel value in the test image
+              i3 = OFstatic_cast(unsigned long, labs(i1 - i2)); // absolute difference, without sign
+              if (dv)
+              {
+                  dvp = amplification * i3;  // compute diff image pixel value
+                  if (dvp > 255)
+                      *dv++ = OFstatic_cast(Uint8, 255);
+                      else *dv++ = OFstatic_cast(Uint8, dvp);
+
+              }
+              max_error = (i3 > max_error ? i3 : max_error);
+              square_error_sum += (double)(i3*i3);
+              simple_error_sum += i3;
+              t = i1 * i1;
+              square_reference_sum += t;
+              square_signal_strength = (t > square_signal_strength) ? t : square_signal_strength;
+              ++f1;
+              ++f2;
+            }
+        }
+
+        // The following four metrics, MAE, RMSE, PSNR and SNR are computed as defined in
+        // R.C. Gonzalez and R.E. Woods, "Digital Image Processing," Prentice Hall 2008
+
+        // as a helper variable, divide the sum of squared errors by the total number of samples
+        double meanSquareError = square_error_sum / (numValues * fcount);
+
+        // the mean absolute error is the sum of (unsigned) error values divided by the total number of samples
+        meanAbsoluteError = simple_error_sum / (numValues * fcount);
+
+        // Compute RMSE by taking the square root of the mean square error
+        rootMeanSquareError = sqrt(meanSquareError);
+
+        // PSNR is -10 * the logarithm of the mean square error divided by the squared signal strength
+        //(maximum pixel value in reference image)
+        peakSignalToNoiseRatio = log10(meanSquareError / square_signal_strength) * -10.0;
+
+        // SNR is the 10 * the logarithm of the signal (squared sum of all reference pixel values)
+        // divided by the noise (squared sum of all difference values)
+        signalToNoiseRatio =  log10(square_reference_sum / square_error_sum) * 10.0;
+
+        if (diff_image)
+        {
+            char buf[30];
+            OFStandard::snprintf(buf, 30, "%lu", OFstatic_cast(unsigned long, di_reference->getFrameCount()));
+            cond = diff_image->getDataset()->putAndInsertUint16(DCM_Rows, OFstatic_cast(Uint16, di_reference->getHeight()));
+            if (cond.good()) cond = diff_image->getDataset()->putAndInsertUint16(DCM_Columns, OFstatic_cast(Uint16, di_reference->getWidth()));
+            if (cond.good()) cond = diff_image->getDataset()->putAndInsertString(DCM_NumberOfFrames, buf);
+            if (di_reference->getFrameCount() > 1)
+            {
+                DcmTagKey frameIncrementPointer(0x0018, 0x2002);
+                if (cond.good()) cond = diff_image->getDataset()->putAndInsertTagKey(DCM_FrameIncrementPointer, frameIncrementPointer);
+                OFString frameLabelVector;
+                createFrameLabelVector(frameLabelVector, di_reference->getFrameCount(), OFFalse);
+                if (cond.good()) cond = diff_image->getDataset()->putAndInsertOFStringArray(DCM_FrameLabelVector, frameLabelVector);
+            }
+        }
+    }
+    return cond;
+}
+
+
+OFCondition DicomImageComparison::computeColorImageComparionMetrics()
+{
+    DCMIMAGE_DEBUG("Type of computation: color, 8-bits/sample");
+
+    // this check should have already been performed, but just to be sure, and since it's cheap...
+    OFCondition cond = checkImageCharacteristics();
+    if (cond.good() && (! di_reference->isMonochrome()))
+    {
+        unsigned long numBytes = di_reference->getOutputDataSize(8);
+        unsigned int fcount = di_reference->getFrameCount();
+        if (numBytes != di_test->getOutputDataSize(8))
+        {
+          DCMIMAGE_FATAL("Frame size mismatch: "
+            << numBytes << " vs. " << di_test->getOutputDataSize(8) << " bytes");
+          return makeOFCondition(OFM_dcmimage, 136, OF_error, "frame size mismatch");
+        }
+        unsigned long numValues = numBytes;
+
+        // prepare creation of difference image pixel data
+        Uint8 *dv = NULL;
+        double dvp;
+        if (diff_image)
+        {
+            // create empty pixel data element and insert into main dataset
+            DcmPixelData *pxd = new DcmPixelData(DCM_PixelData);
+            cond = diff_image->getDataset()->insert(pxd);
+            if (cond.bad()) return cond;
+
+            // create pixel data buffer for all frames of the difference image
+            Uint32 pixelDataLen = numValues * fcount;
+            cond = pxd->createUint8Array(pixelDataLen, dv);
+            if (cond.bad()) return cond;
+        }
+
+        const Uint8 *f1;
+        const Uint8 *f2;
+
+        double square_error_sum = 0; // sum of squared differences between reference and test
+        double simple_error_sum = 0; // sum of (unsigned) differences between reference and test
+        double square_reference_sum = 0; // sum of squared pixel values in reference image
+        unsigned long square_signal_strength = 0; // maximum pixel value in reference image
+        max_error = 0; // maximum (unsigned) difference between reference and test pixel value
+
+        // iterate over all frames
+        for (unsigned int frame = 0; frame < fcount; frame++)
+        {
+            DCMIMAGE_DEBUG("Processing frame " << frame);
+            const void *frame1 = di_reference->getOutputData(8, frame, 1 /* color by plane */);
+            const void *frame2 = di_test->getOutputData(8, frame, 1 /* color by plane */);
+            if ((frame1 == NULL) || (frame2 == NULL))
+            {
+              DCMIMAGE_FATAL("Memory exhausted while accessing frames");
+              return EC_MemoryExhausted;
+            }
+            f1 = OFreinterpret_cast(const Uint8 *, frame1);
+            f2 = OFreinterpret_cast(const Uint8 *, frame2);
+            long i1, i2;
+            unsigned long i3, t;
+
+            // iterate over all samples (R, G and B pixel values) of the current frame
+            for (unsigned long i = 0; i < numValues; ++i)
+            {
+              i1 = *f1; // pixel value in the reference image
+              i2 = *f2; // pixel value in the test image
+              i3 = OFstatic_cast(unsigned long, labs(i1 - i2)); // absolute difference, without sign
+              if (dv)
+              {
+                  dvp = amplification * i3;  // compute diff image pixel value
+                  if (dvp > 255)
+                      *dv++ = OFstatic_cast(Uint8, 255);
+                      else *dv++ = OFstatic_cast(Uint8, dvp);
+
+              }
+              max_error = (i3 > max_error ? i3 : max_error);
+              square_error_sum += (double)(i3*i3);
+              simple_error_sum += i3;
+              t = i1 * i1;
+              square_reference_sum += t;
+              square_signal_strength = (t > square_signal_strength) ? t : square_signal_strength;
+              ++f1;
+              ++f2;
+            }
+        }
+
+        // The following four metrics, MAE, RMSE, PSNR and SNR are computed as defined in
+        // R.C. Gonzalez and R.E. Woods, "Digital Image Processing," Prentice Hall 2008
+
+        // as a helper variable, divide the sum of squared errors by the total number of samples
+        double meanSquareError = square_error_sum / (numValues * fcount);
+
+        // the mean absolute error is the sum of (unsigned) error values divided by the total number of samples
+        meanAbsoluteError = simple_error_sum / (numValues * fcount);
+
+        // Compute RMSE by taking the square root of the mean square error
+        rootMeanSquareError = sqrt(meanSquareError);
+
+        // PSNR is -10 * the logarithm of the mean square error divided by the squared signal strength
+        //(maximum pixel value in reference image)
+        peakSignalToNoiseRatio = log10(meanSquareError / square_signal_strength) * -10.0;
+
+        // SNR is the 10 * the logarithm of the signal (squared sum of all reference pixel values)
+        // divided by the noise (squared sum of all difference values)
+        signalToNoiseRatio =  log10(square_reference_sum / square_error_sum) * 10.0;
+
+        if (diff_image)
+        {
+            char buf[30];
+            // For color images, the difference image is always multiframe
+            // because it contains separate R, G and B difference frames
+            OFStandard::snprintf(buf, 30, "%lu", OFstatic_cast(unsigned long, 3UL * di_reference->getFrameCount()));
+            cond = diff_image->getDataset()->putAndInsertUint16(DCM_Rows, OFstatic_cast(Uint16, di_reference->getHeight()));
+            if (cond.good()) cond = diff_image->getDataset()->putAndInsertUint16(DCM_Columns, OFstatic_cast(Uint16, di_reference->getWidth()));
+            if (cond.good()) cond = diff_image->getDataset()->putAndInsertString(DCM_NumberOfFrames, buf);
+            DcmTagKey frameIncrementPointer(0x0018, 0x2002);
+            if (cond.good()) cond = diff_image->getDataset()->putAndInsertTagKey(DCM_FrameIncrementPointer, frameIncrementPointer);
+            OFString frameLabelVector;
+            createFrameLabelVector(frameLabelVector, di_reference->getFrameCount(), OFTrue);
+            if (cond.good()) cond = diff_image->getDataset()->putAndInsertOFStringArray(DCM_FrameLabelVector, frameLabelVector);
+        }
+    }
+    return cond;
+}
+
+
+void DicomImageComparison::logImageInfo(DicomImage *di, const char *filename)
+{
+    if (di == NULL) return;
+    if (filename == NULL) return;
+
+    double minVal = 0.0;
+    double maxVal = 0.0;
+    const char *colorModel;
+    unsigned long i;
+
+    int minmaxValid = di->getMinMaxValues(minVal, maxVal);
+    colorModel = di->getString(di->getPhotometricInterpretation());
+    if (colorModel == NULL)
+        colorModel = "unknown";
+
+    char aspectRatio[30];
+    OFStandard::ftoa(aspectRatio, sizeof(aspectRatio), di->getHeightWidthRatio(), OFStandard::ftoa_format_f, 0, 2);
+
+    /* dump some general information */
+    DCMIMAGE_DEBUG("characteristics of file '" << filename << "':");
+    DCMIMAGE_DEBUG(
+           "  columns x rows      : " << di->getWidth() << " x " << di->getHeight() << OFendl
+        << "  bits per sample     : " << di->getDepth() << OFendl
+        << "  color model         : " << colorModel << OFendl
+        << "  pixel aspect ratio  : " << aspectRatio << OFendl
+        << "  number of frames    : " << di->getNumberOfFrames() << " (" << di->getFrameCount() << " processed)");
+
+    /* dump VOI windows */
+    unsigned long count;
+    OFString explStr, funcStr;
+    count = di->getWindowCount();
+    switch (di->getVoiLutFunction())
+    {
+        case EFV_Default:
+            funcStr = "<default>";
+            break;
+        case EFV_Linear:
+            funcStr = "LINEAR";
+            break;
+        case EFV_Sigmoid:
+            funcStr = "SIGMOID";
+            break;
+    }
+    DCMIMAGE_DEBUG("  VOI LUT function    : " << funcStr);
+    DCMIMAGE_DEBUG("  VOI windows in file : " << di->getWindowCount());
+    for (i = 0; i < count; i++)
+    {
+        if (di->getVoiWindowExplanation(i, explStr) == NULL)
+            DCMIMAGE_DEBUG("  - <no explanation>");
+        else
+            DCMIMAGE_DEBUG("  - " << explStr);
+    }
+
+    /* dump VOI LUTs */
+    count = di->getVoiLutCount();
+    DCMIMAGE_DEBUG("  VOI LUTs in file    : " << count);
+    for (i = 0; i < count; i++)
+    {
+        if (di->getVoiLutExplanation(i, explStr) == NULL)
+            DCMIMAGE_DEBUG("  - <no explanation>");
+        else
+            DCMIMAGE_DEBUG("  - " << explStr);
+    }
+
+    /* dump presentation LUT shape */
+    OFString shapeStr;
+    switch (di->getPresentationLutShape())
+    {
+        case ESP_Default:
+            shapeStr = "<default>";
+            break;
+        case ESP_Identity:
+            shapeStr = "IDENTITY";
+            break;
+        case ESP_Inverse:
+            shapeStr = "INVERSE";
+            break;
+        case ESP_LinOD:
+            shapeStr = "LIN OD";
+            break;
+    }
+    DCMIMAGE_DEBUG("  presentation shape  : " << shapeStr);
+
+    /* dump overlays */
+    DCMIMAGE_DEBUG("  overlays in file    : " << di->getOverlayCount());
+
+    if (minmaxValid)
+    {
+      char minmaxText[30];
+      OFStandard::ftoa(minmaxText, sizeof(minmaxText), maxVal, OFStandard::ftoa_format_f, 0, 0);
+      DCMIMAGE_DEBUG("  maximum pixel value : " << minmaxText);
+      OFStandard::ftoa(minmaxText, sizeof(minmaxText), minVal, OFStandard::ftoa_format_f, 0, 0);
+      DCMIMAGE_DEBUG("  minimum pixel value : " << minmaxText);
+    }
+
+    return;
+}
+
+
+OFCondition DicomImageComparison::copyReferenceImageAttributes(DcmItem *src, DcmItem *diffImage)
+{
+    if (src == NULL) return EC_IllegalCall;
+    if (diffImage == NULL) return EC_IllegalCall;
+    OFCondition cond;
+
+    // Copy Patient Module attributes from the reference image.
+    // All these attributes are type 2 and should thus be present
+    OFString patientName;
+    OFString patientID;
+    OFString patientBirthDate;
+    OFString patientSex;
+
+    if (src->findAndGetOFStringArray(DCM_PatientName, patientName).bad())
+        DCMIMAGE_WARN("Patient Name not found in reference image, ignoring.");
+    if (src->findAndGetOFStringArray(DCM_PatientID, patientID).bad())
+        DCMIMAGE_WARN("Patient ID not found in reference image, ignoring.");
+    if (src->findAndGetOFStringArray(DCM_PatientBirthDate, patientBirthDate).bad())
+        DCMIMAGE_WARN("Patient's Sex not found in reference image, ignoring.");
+    if (src->findAndGetOFStringArray(DCM_PatientSex, patientSex).bad())
+        DCMIMAGE_WARN("Patient's Birth Date not found in reference image, ignoring.");
+
+    cond = diffImage->putAndInsertOFStringArray(DCM_PatientName, patientName);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_PatientID, patientID);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_PatientBirthDate, patientBirthDate);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_PatientSex, patientSex);
+    if (cond.bad()) return cond;
+
+    // Copy General Study Module attributes from the reference image.
+    // All these attributes are type 1 or 2 and should thus be present
+    OFString studyInstanceUID;
+    OFString studyDate;
+    OFString studyTime;
+    OFString referringPhysicianName;
+    OFString studyID;
+    OFString accessionNumber;
+
+    cond = src->findAndGetOFStringArray(DCM_StudyInstanceUID, studyInstanceUID);
+    if (cond.bad())
+    {
+        DCMIMAGE_ERROR("Study Instance UID not found in reference image.");
+        return cond;
+    }
+    if (src->findAndGetOFStringArray(DCM_StudyDate, studyDate).bad())
+        DCMIMAGE_WARN("Study Date not found in reference image, ignoring.");
+    if (src->findAndGetOFStringArray(DCM_StudyTime, studyTime).bad())
+        DCMIMAGE_WARN("Study Time not found in reference image, ignoring.");
+    if (src->findAndGetOFStringArray(DCM_ReferringPhysicianName, referringPhysicianName).bad())
+        DCMIMAGE_WARN("Referring Physician's Name not found in reference image, ignoring.");
+    if (src->findAndGetOFStringArray(DCM_StudyID, studyID).bad())
+        DCMIMAGE_WARN("Study ID not found in reference image, ignoring.");
+    if (src->findAndGetOFStringArray(DCM_AccessionNumber, accessionNumber).bad())
+        DCMIMAGE_WARN("Accession Number not found in reference image, ignoring.");
+
+    cond = diffImage->putAndInsertOFStringArray(DCM_StudyInstanceUID, studyInstanceUID);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_StudyDate, studyDate);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_StudyTime, studyTime);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_ReferringPhysicianName, referringPhysicianName);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_StudyID, studyID);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_AccessionNumber, accessionNumber);
+    if (cond.bad()) return cond;
+
+    // Generate General Series Module attributes
+    OFString modality = "OT"; // OT = "other"
+    char uidbuf[65];
+    OFString seriesInstanceUID;
+    OFString laterality;
+    OFString seriesNumber = "1";
+    seriesInstanceUID = dcmGenerateUniqueIdentifier(uidbuf);
+
+    cond = diffImage->putAndInsertOFStringArray(DCM_Modality, modality);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_SeriesNumber, seriesNumber);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_SeriesInstanceUID, seriesInstanceUID);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_Laterality, laterality);
+    if (cond.bad()) return cond;
+
+    // Generate SC Equipment Module attributes
+    OFString conversionType = "SYN"; // SYN = "Synthetic Image"
+    cond = diffImage->putAndInsertOFStringArray(DCM_ConversionType, conversionType);
+    if (cond.bad()) return cond;
+
+    // Generate General Image Module attributes
+    OFString instanceNumber = "1";
+    OFString contentDate;
+    OFString contentTime;
+    OFString imageType = "DERIVED\\SECONDARY";
+    OFString patientOrientation;
+    OFDateTime dt;
+    if ((! dt.setCurrentDateTime()) ||
+        (! dt.getDate().getISOFormattedDate(contentDate, OFFalse)) ||
+        (! dt.getTime().getISOFormattedTime(contentTime, OFTrue, OFFalse, OFFalse, OFFalse)))
+    {
+        DCMIMAGE_ERROR("Unable to retrieve current date/time");
+        return makeOFCondition(OFM_dcmimage, 137, OF_error, "Unable to retrieve current date/time");
+    }
+
+    cond = diffImage->putAndInsertOFStringArray(DCM_InstanceNumber, instanceNumber);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_ContentDate, contentDate);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_ContentTime, contentTime);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_ImageType, imageType);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_PatientOrientation, patientOrientation);
+    if (cond.bad()) return cond;
+
+    // Generate General Reference Module attributes
+    OFString derivationDescription = "Difference image between reference and lossy compressed test image";
+    DcmItem *derivationCodeSequence = NULL;
+    OFString derivationCodeValue = "113062";
+    OFString derivationCodingSchemeDesignator = "DCM";
+    OFString derivationCodeMeaning = "Pixel by pixel subtraction";
+    DcmItem *sourceImageSequence = NULL;
+    OFString referencedSOPClassUID;
+    OFString referencedSOPInstanceUID;
+    DcmItem *purposeOfReferenceCodeSequence = NULL;
+    OFString purposeOfReferenceCodeValue = "121320";
+    OFString purposeOfReferenceCodingSchemeDesignator = "DCM";
+    OFString purposeOfReferenceCodeMeaning = "Uncompressed predecessor";
+
+    cond = src->findAndGetOFStringArray(DCM_SOPClassUID, referencedSOPClassUID);
+    if (cond.bad())
+    {
+        DCMIMAGE_ERROR("SOP Class UID not found in reference image.");
+        return cond;
+    }
+    cond = src->findAndGetOFStringArray(DCM_SOPInstanceUID, referencedSOPInstanceUID);
+    if (cond.bad())
+    {
+        DCMIMAGE_ERROR("SOP Instance UID not found in reference image.");
+        return cond;
+    }
+
+    cond = diffImage->putAndInsertOFStringArray(DCM_DerivationDescription, derivationDescription);
+    if (cond.bad()) return cond;
+    cond = diffImage->findOrCreateSequenceItem(DCM_DerivationCodeSequence, derivationCodeSequence, -2 /* append new item */);
+    if (cond.bad()) return cond;
+    cond = derivationCodeSequence->putAndInsertOFStringArray(DCM_CodeValue, derivationCodeValue);
+    if (cond.bad()) return cond;
+    cond = derivationCodeSequence->putAndInsertOFStringArray(DCM_CodingSchemeDesignator, derivationCodingSchemeDesignator);
+    if (cond.bad()) return cond;
+    cond = derivationCodeSequence->putAndInsertOFStringArray(DCM_CodeMeaning, derivationCodeMeaning);
+    if (cond.bad()) return cond;
+    cond = diffImage->findOrCreateSequenceItem(DCM_SourceImageSequence, sourceImageSequence, -2 /* append new item */);
+    if (cond.bad()) return cond;
+    cond = sourceImageSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID);
+    if (cond.bad()) return cond;
+    cond = sourceImageSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID);
+    if (cond.bad()) return cond;
+    cond = sourceImageSequence->findOrCreateSequenceItem(DCM_PurposeOfReferenceCodeSequence, purposeOfReferenceCodeSequence, -2 /* append new item */);
+    if (cond.bad()) return cond;
+    cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodeValue, purposeOfReferenceCodeValue);
+    if (cond.bad()) return cond;
+    cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodingSchemeDesignator, purposeOfReferenceCodingSchemeDesignator);
+    if (cond.bad()) return cond;
+    cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodeMeaning, purposeOfReferenceCodeMeaning);
+    if (cond.bad()) return cond;
+
+    // Most of the Image Pixel Module is generated elsewhere.
+    // Here we only populate a few values that are copied from the reference image or are constant
+
+    OFString photometricInterpretation = "MONOCHROME2";
+    Uint16 samplesPerPixel = 1;
+    Uint16 pixelRepresentation = 0;
+    OFString pixelAspectRatio;
+
+    // First look for PixelAspectRatio in the reference image
+    if (src->findAndGetOFStringArray(DCM_PixelAspectRatio, pixelAspectRatio).bad())
+    {
+        // Now look for PixelSpacing. Note that this is a DS (double string) element
+        Float64 rowSpacing = 0.0;
+        Float64 colSpacing = 0.0;
+        unsigned long row;
+        unsigned long col;
+        char buf[30];
+        if (src->findAndGetFloat64(DCM_PixelSpacing, rowSpacing, 0).good() &&
+            src->findAndGetFloat64(DCM_PixelSpacing, colSpacing, 1).good())
+        {
+            row = OFstatic_cast(unsigned long, rowSpacing*1000);
+            col = OFstatic_cast(unsigned long, colSpacing*1000);
+            // only create pixelAspectRatio if pixels are not square
+            if (row != col)
+            {
+                OFStandard::snprintf(buf, 30, "%lu\\%lu", row, col);
+                pixelAspectRatio = buf;
+            }
+        }
+        else
+        {
+            // Finally look for ImagerPixelSpacing. Note that this is a DS (double string) element
+            if (src->findAndGetFloat64(DCM_ImagerPixelSpacing, rowSpacing, 0).good() &&
+                src->findAndGetFloat64(DCM_ImagerPixelSpacing, colSpacing, 1).good())
+            {
+                row = OFstatic_cast(unsigned long, rowSpacing*1000);
+                col = OFstatic_cast(unsigned long, colSpacing*1000);
+                // only create pixelAspectRatio if pixels are not square
+                if (row != col)
+                {
+                    OFStandard::snprintf(buf, 30, "%lu\\%lu", row, col);
+                    pixelAspectRatio = buf;
+                }
+            }
+        }
+    }
+
+    cond = diffImage->putAndInsertOFStringArray(DCM_PhotometricInterpretation, photometricInterpretation);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertUint16(DCM_SamplesPerPixel, samplesPerPixel);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertUint16(DCM_PixelRepresentation, pixelRepresentation);
+    if (cond.bad()) return cond;
+    if (pixelAspectRatio.length() > 0)
+    {
+        cond = diffImage->putAndInsertOFStringArray(DCM_PixelAspectRatio, pixelAspectRatio);
+        if (cond.bad()) return cond;
+    }
+
+    // Generate SC Multi-frame Image Module attributes
+    OFString burnedInAnnotation = "YES";
+    OFString presentationLUTShape = "IDENTITY";
+    OFString rescaleIntercept = "0";
+    OFString rescaleSlope = "1";
+    OFString rescaleType = "US"; // US = unspecified
+
+    cond = diffImage->putAndInsertOFStringArray(DCM_BurnedInAnnotation, burnedInAnnotation);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_PresentationLUTShape, presentationLUTShape);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_RescaleIntercept, rescaleIntercept);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_RescaleSlope, rescaleSlope);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_RescaleType, rescaleType);
+    if (cond.bad()) return cond;
+
+    // Generate SOP Common Module attributes (except SOP Class UID)
+    OFString sOPInstanceUID;
+    OFString specificCharacterSet;
+    // UID constant used for this tool
+    OFString instanceCreatorUID = "1.2.276.0.7230010.3.1.2.1787205428.20064.1535731842.951308";
+    OFString InstanceNumber = "1";
+    if (src->findAndGetOFStringArray(DCM_SpecificCharacterSet, specificCharacterSet).bad()) specificCharacterSet = "";
+    sOPInstanceUID = dcmGenerateUniqueIdentifier(uidbuf);
+
+    cond = diffImage->putAndInsertOFStringArray(DCM_SOPInstanceUID, sOPInstanceUID);
+    if (cond.bad()) return cond;
+    if (specificCharacterSet.length() > 0)
+    {
+        cond = diffImage->putAndInsertOFStringArray(DCM_SpecificCharacterSet, specificCharacterSet);
+        if (cond.bad()) return cond;
+    }
+    // our images always have the same values for content date/time and instance creation date/time
+    cond = diffImage->putAndInsertOFStringArray(DCM_InstanceCreationDate, contentDate);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_InstanceCreationTime, contentTime);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_InstanceCreatorUID, instanceCreatorUID);
+    if (cond.bad()) return cond;
+    cond = diffImage->putAndInsertOFStringArray(DCM_InstanceNumber, instanceNumber);
+    if (cond.bad()) return cond;
+
+    // Generate Common Instance Reference Module attributes (except SOP Class UID)
+    DcmItem *referencedSeriesSequence = NULL;
+    DcmItem *referencedInstanceSequence = NULL;
+    OFString referencedSeriesInstanceUID;
+    cond = src->findAndGetOFStringArray(DCM_SeriesInstanceUID, referencedSeriesInstanceUID);
+    if (cond.bad())
+    {
+        DCMIMAGE_ERROR("Series Instance UID not found in reference image.");
+        return cond;
+    }
+
+    cond = diffImage->findOrCreateSequenceItem(DCM_ReferencedSeriesSequence, referencedSeriesSequence, -2 /* append new item */);
+    if (cond.bad()) return cond;
+    cond = referencedSeriesSequence->putAndInsertOFStringArray(DCM_SeriesInstanceUID, referencedSeriesInstanceUID);
+    if (cond.bad()) return cond;
+    cond = referencedSeriesSequence->findOrCreateSequenceItem(DCM_ReferencedInstanceSequence, referencedInstanceSequence, -2 /* append new item */);
+    if (cond.bad()) return cond;
+    cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID);
+    if (cond.bad()) return cond;
+    cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID);
+    if (cond.bad()) return cond;
+
+    return cond;
+}
+
+OFCondition DicomImageComparison::copyTestImageAttributes(DcmItem *src, DcmItem *diffImage)
+{
+    if (src == NULL) return EC_IllegalCall;
+    if (diffImage == NULL) return EC_IllegalCall;
+    OFCondition cond;
+
+    // Generate General Reference Module attributes
+    DcmItem *sourceImageSequence = NULL;
+    OFString referencedSOPClassUID;
+    OFString referencedSOPInstanceUID;
+    DcmItem *purposeOfReferenceCodeSequence = NULL;
+    OFString purposeOfReferenceCodeValue = "121330";
+    OFString purposeOfReferenceCodingSchemeDesignator = "DCM";
+    OFString purposeOfReferenceCodeMeaning = "Lossy compressed predecessor";
+
+    cond = src->findAndGetOFStringArray(DCM_SOPClassUID, referencedSOPClassUID);
+    if (cond.bad())
+    {
+        DCMIMAGE_ERROR("SOP Class UID not found in test image.");
+        return cond;
+    }
+    cond = src->findAndGetOFStringArray(DCM_SOPInstanceUID, referencedSOPInstanceUID);
+    if (cond.bad())
+    {
+        DCMIMAGE_ERROR("SOP Instance UID not found in test image.");
+        return cond;
+    }
+
+    // Add reference to the test image to the Source Image Sequence
+    cond = diffImage->findOrCreateSequenceItem(DCM_SourceImageSequence, sourceImageSequence, -2 /* append new item */);
+    if (cond.bad()) return cond;
+    cond = sourceImageSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID);
+    if (cond.bad()) return cond;
+    cond = sourceImageSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID);
+    if (cond.bad()) return cond;
+    cond = sourceImageSequence->findOrCreateSequenceItem(DCM_PurposeOfReferenceCodeSequence, purposeOfReferenceCodeSequence, -2 /* append new item */);
+    if (cond.bad()) return cond;
+    cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodeValue, purposeOfReferenceCodeValue);
+    if (cond.bad()) return cond;
+    cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodingSchemeDesignator, purposeOfReferenceCodingSchemeDesignator);
+    if (cond.bad()) return cond;
+    cond = purposeOfReferenceCodeSequence->putAndInsertOFStringArray(DCM_CodeMeaning, purposeOfReferenceCodeMeaning);
+    if (cond.bad()) return cond;
+
+    // Generate Common Instance Reference Module attributes (except SOP Class UID)
+    DcmItem *referencedSeriesSequence = NULL;
+    DcmItem *referencedInstanceSequence = NULL;
+    DcmItem *studiesContainingOtherReferencedInstancesSequence = NULL;
+    OFString referencedStudyInstanceUID;
+    OFString referencedSeriesInstanceUID;
+    OFString diffImageStudyInstanceUID;
+    OFString diffImageSeriesInstanceUID;
+
+    cond = src->findAndGetOFStringArray(DCM_StudyInstanceUID, referencedStudyInstanceUID);
+    if (cond.bad())
+    {
+        DCMIMAGE_ERROR("Study Instance UID not found in test image.");
+        return cond;
+    }
+    cond = src->findAndGetOFStringArray(DCM_SeriesInstanceUID, referencedSeriesInstanceUID);
+    if (cond.bad())
+    {
+        DCMIMAGE_ERROR("Series Instance UID not found in test image.");
+        return cond;
+    }
+    cond = diffImage->findAndGetOFStringArray(DCM_StudyInstanceUID, diffImageStudyInstanceUID);
+    if (cond.bad())
+    {
+        DCMIMAGE_ERROR("Study Instance UID not found in difference image.");
+        return cond;
+    }
+
+    if (diffImageStudyInstanceUID == referencedStudyInstanceUID)
+    {
+        // Reference image and test image share the same Study Instance UID.
+        // Now check the Series Instance UID.
+        cond = diffImage->findAndGetSequenceItem(DCM_ReferencedSeriesSequence, referencedSeriesSequence, 0);
+        if (cond.bad()) return cond;
+        cond = referencedSeriesSequence->findAndGetOFStringArray(DCM_SeriesInstanceUID, diffImageSeriesInstanceUID);
+        if (cond.bad()) return cond;
+        if (diffImageSeriesInstanceUID == referencedSeriesInstanceUID)
+        {
+            // Reference image and test image share the same Series Instance UID.
+            cond = referencedSeriesSequence->findOrCreateSequenceItem(DCM_ReferencedInstanceSequence, referencedInstanceSequence, -2);
+            if (cond.bad()) return cond;
+            cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID);
+            if (cond.bad()) return cond;
+            cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID);
+            if (cond.bad()) return cond;
+        }
+        else
+        {
+            // Reference image and test image have different Series Instance UIDs.
+            // This should not happen unless some deidentification process has taken place.
+            DCMIMAGE_WARN("Test image has a different Series Instance UID than the reference image.");
+            cond = diffImage->findOrCreateSequenceItem(DCM_ReferencedSeriesSequence, referencedSeriesSequence, -2 /* append new item */);
+            if (cond.bad()) return cond;
+            cond = referencedSeriesSequence->putAndInsertOFStringArray(DCM_SeriesInstanceUID, referencedSeriesInstanceUID);
+            if (cond.bad()) return cond;
+            cond = referencedSeriesSequence->findOrCreateSequenceItem(DCM_ReferencedInstanceSequence, referencedInstanceSequence, -2 /* append new item */);
+            if (cond.bad()) return cond;
+            cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID);
+            if (cond.bad()) return cond;
+            cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID);
+            if (cond.bad()) return cond;
+        }
+    }
+    else
+    {
+        // Reference image and test image have different Study Instance UIDs.
+        // This should not happen unless some deidentification process has taken place.
+        DCMIMAGE_WARN("Test image has a different Study Instance UID than the reference image.");
+        cond = diffImage->findOrCreateSequenceItem(DCM_StudiesContainingOtherReferencedInstancesSequence, studiesContainingOtherReferencedInstancesSequence, -2 /* append new item */);
+        if (cond.bad()) return cond;
+        cond = studiesContainingOtherReferencedInstancesSequence->putAndInsertOFStringArray(DCM_StudyInstanceUID, referencedStudyInstanceUID);
+        if (cond.bad()) return cond;
+        cond = studiesContainingOtherReferencedInstancesSequence->findOrCreateSequenceItem(DCM_ReferencedSeriesSequence, referencedSeriesSequence, -2 /* append new item */);
+        if (cond.bad()) return cond;
+        cond = referencedSeriesSequence->putAndInsertOFStringArray(DCM_SeriesInstanceUID, referencedSeriesInstanceUID);
+        if (cond.bad()) return cond;
+        cond = referencedSeriesSequence->findOrCreateSequenceItem(DCM_ReferencedInstanceSequence, referencedInstanceSequence, -2 /* append new item */);
+        if (cond.bad()) return cond;
+        cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, referencedSOPClassUID);
+        if (cond.bad()) return cond;
+        cond = referencedInstanceSequence->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, referencedSOPInstanceUID);
+        if (cond.bad()) return cond;
+    }
+
+    return cond;
+}
+
+
+void DicomImageComparison::createFrameLabelVector(OFString& s, unsigned long numFrames, OFBool isColor)
+{
+    // Create a multi-valued string with one label for each frame.
+    // For monochrome images, the labels will be F001\F002\F003...
+    // For color images, the labels will be F001R\F001G\F001B\F002R\F002G\F002B...
+    // since we store three monochrome difference frames for the R, G and B plane
+    // of each color frame in the reference image.
+    s = "";
+    char buf[100];
+    for (unsigned long i = 0; i < numFrames; ++i)
+    {
+      if (i > 0) s += "\\";
+      if (isColor)
+          OFStandard::snprintf(buf, 100, "F%03luR\\F%03luG\\F%03luB", i+1, i+1, i+1);
+          else OFStandard::snprintf(buf, 100, "F%03lu", i+1);
+      s += buf;
+    }
+
+    // check if we can really represent this string as SH element in explicit VR.
+    // This may become a problem if we have a color image with more than 3100 frames,
+    // or a monochrome image with more than 9300 frames.
+    if (s.length() > 65534)
+    {
+        DCMIMAGE_WARN("frame label vector too long");
+        s.erase(65534);
+    }
+}
index 661fd64a168573c90ea47199d291651f99241e6a..06974c2a13a12cbd84c3e993c8bb7be2cd1d274a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2011, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -37,6 +37,9 @@
 #include "dcmtk/dcmimage/dilogger.h"
 #include "dcmtk/dcmimgle/diutils.h"
 
+#define INCLUDE_CINTTYPES
+#include "dcmtk/ofstd/ofstdinc.h"
+
 
 /*----------------*
  *  constructors  *
@@ -574,7 +577,9 @@ int DiColorImage::writeImageToDataset(DcmItem &dataset,
                 /* set image resolution */
                 dataset.putAndInsertUint16(DCM_Columns, Columns);
                 dataset.putAndInsertUint16(DCM_Rows, Rows);
-#if SIZEOF_LONG == 8
+#ifdef PRId32
+                sprintf(numBuf, "%" PRId32, NumberOfFrames);
+#elif SIZEOF_LONG == 8
                 sprintf(numBuf, "%d", NumberOfFrames);
 #else
                 sprintf(numBuf, "%ld", NumberOfFrames);
@@ -680,8 +685,9 @@ int DiColorImage::writeRawPPM(FILE *stream,
             if ((OutputData != NULL) && (OutputData->getData() != NULL))
             {
                 fprintf(stream, "P6\n%u %u\n%lu\n", Columns, Rows, DicomImageClass::maxval(bits));
-                fwrite(OutputData->getData(), OFstatic_cast(size_t, OutputData->getCount()), OutputData->getItemSize(), stream);
-                return 1;
+                const size_t count = OFstatic_cast(size_t, OutputData->getCount());
+                if (fwrite(OutputData->getData(), OutputData->getItemSize(), count, stream) == count)
+                    return 1;
             }
         }
     }
index 80fc0ece55b81dbe97364c1472808490d2397de0..d47992c68d5e106b5023d2a1b513d246cd542377 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmimgle)
+project(dcmimgle)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmimgle_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR})
+include_directories("${dcmimgle_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc apps include data)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc apps include data)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 8dd407c8f4095e18f9a3608221b838a04befb41a..6909f5dc45f5e4c72bb77cdca2ff378b46ce9c4c 100644 (file)
@@ -1,9 +1,9 @@
 # declare executables
-FOREACH(PROGRAM dcmdspfn dcod2lum dconvlum)
+foreach(PROGRAM dcmdspfn dcod2lum dconvlum)
   DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
-ENDFOREACH(PROGRAM)
+endforeach()
 
 # make sure executables are linked to the corresponding libraries
-FOREACH(PROGRAM dcmdspfn dcod2lum dconvlum)
+foreach(PROGRAM dcmdspfn dcod2lum dconvlum)
   DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmimgle dcmdata oflog ofstd)
-ENDFOREACH(PROGRAM)
+endforeach()
index 63764a074dea96dda452f501e56f29985173f96c..a074718ee37ecb4f70d2d7a14331872aa7393c8a 100644 (file)
@@ -35,6 +35,7 @@ dcmdspfn.o: dcmdspfn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -44,6 +45,7 @@ dcmdspfn.o: dcmdspfn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
index 22b3dd2c5f639b366875a318939533da0425e118..7a02a71762cb7614a5caa802dc37b451768ab915 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES camera.lut monitor.lut printer.lut scanner.lut DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data)
+install(FILES camera.lut monitor.lut printer.lut scanner.lut DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data)
index 3f73b6180f10c3eb84ded9b0999336c1f5a8e48d..f961a2e0400461a678e1da585525838c7a0eb030 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmimgle DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmimgle DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index c13295c04df20f94ae67a985a4bdb002b8860109..e5d11b788c2b405a7e65bf8688a82a07e9ebb4d0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2016, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -1153,10 +1153,13 @@ class DiMonoOutputPixelTemplate
             {
                 if (overlays[j] != NULL)
                 {
-                    if (overlays[j]->getCount() > 0)
-                        DCMIMGLE_DEBUG("applying " << ((j == 0) ? "built-in" : "additional") << " overlay planes");
                     const signed long left_pos = overlays[j]->getLeft();
                     const signed long top_pos = overlays[j]->getTop();
+                    if (overlays[j]->getCount() > 0)
+                    {
+                        DCMIMGLE_DEBUG("applying " << ((j == 0) ? "built-in" : "additional") << " overlay planes");
+                        DCMIMGLE_TRACE("  left_pos: " << left_pos << ", top_pos: " << top_pos << ", columns: " << columns << ", rows: " << rows);
+                    }
                     DiOverlayPlane *plane;
                     for (unsigned int i = 0; i < overlays[j]->getCount(); ++i)
                     {
@@ -1277,8 +1280,10 @@ class DiMonoOutputPixelTemplate
                                     break;
                                 }
                                 default: /* e.g. EMO_Default */
-                                    DCMIMGLE_WARN("unhandled overlay mode (" << OFstatic_cast(int, plane->getMode()) << ")");
+                                    DCMIMGLE_WARN("unhandled overlay mode (" << OFstatic_cast(int, plane->getMode()) << ") for plane " << (i + 1));
                             }
+                            DCMIMGLE_TRACE("  overlay data of this plane is " << (plane->isEmbedded() ? "embedded in the pixel data" : "stored separately"));
+                            DCMIMGLE_TRACE("  xmin: " << xmin << ", ymin: " << ymin << ", xmax: " << xmax << ", ymax: " << ymax);
                         }
                     }
                 }
index f9e154251a3a74123857cf3682b46998f0367b99..9275f660d08e2bd6432e23aa1d9fd745d12b4b4e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2011, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -108,6 +108,8 @@ class DCMTK_DCMIMGLE_EXPORT DiObjectCounter
 #ifdef WITH_THREADS
     /** if compiled for multi-thread operation, the Mutex protecting
      *  access to the value of this object.
+     *  @remark this member is only available if DCMTK is compiled with thread
+     *  support enabled.
      */
     OFMutex theMutex;
 #endif
index 016cadba250fe80c1fee254c2452b3a088d926e7..dcc674ac0369310d882527e43f79f264ce73b40c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2015, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -103,7 +103,7 @@ class DCMTK_DCMIMGLE_EXPORT DiOverlayPlane
      */
     DiOverlayPlane(DiOverlayPlane *plane,
                    const unsigned int bit,
-                   Uint16 *data,
+                   const Uint16 *data,
                    Uint16 *temp,
                    const Uint16 width,
                    const Uint16 height,
@@ -516,7 +516,8 @@ inline int DiOverlayPlane::reset(const unsigned long frame)
                 OFstatic_cast(unsigned long, Columns) + (frameNumber - ImageFrameOrigin) * OFstatic_cast(unsigned long, Rows) *
                 OFstatic_cast(unsigned long, Columns)) * OFstatic_cast(unsigned long, BitsAllocated);
             StartBitPos = BitPos = OFstatic_cast(unsigned long, BitPosition) + bits;
-            DCMIMGLE_TRACE("  StartBitPos: " << StartBitPos << ", BitPosition: " << BitPosition << ", bits: " << bits);
+            DCMIMGLE_TRACE("  StartLeft: " << StartLeft << ", StartTop: " << StartTop << ", Columns: " << Columns << ", Rows: " << Rows);
+            DCMIMGLE_TRACE("  StartBitPos: " << StartBitPos << ", BitPosition: " << BitPosition << ", BitsAllocated: " << BitsAllocated << ", bits: " << bits);
             /* distinguish between embedded and separate overlay data */
             if (BitsAllocated == 16)
                 StartPtr = Ptr = Data + (bits >> 4);
index 4692eee6893fc73a23666ad8489c5e1978b6d955..47f4ce87018622bef435f9361612ab047feb905a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2016, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -45,7 +45,7 @@ extern DCMTK_DCMIMGLE_EXPORT OFLogger DCM_dcmimgleLogger;
 // include this file in doxygen documentation
 
 /** @file diutils.h
- *  @brief utilities for the dcmimgle/dcmimage module
+ *  @brief type definitions, constants and helper functions for the dcmimgle/dcmimage module
  */
 
 
@@ -319,6 +319,28 @@ enum EL_BitsPerTableEntry
     ELM_CheckValue
 };
 
+/** type of VOI LUT transformation to apply.
+ *  Specifies which VOI LUT transformation should be applied to an image.
+ */
+enum EW_WindowType
+{
+    /// use given value
+    EWT_none,
+    /// use the n-th VOI window from the image file
+    EWT_window_from_file,
+    /// use the n-th VOI look up table from the image file
+    EWT_voi_lut_from_file,
+    /// compute VOI window using min-max algorithm
+    EWT_window_minmax,
+    /// compute VOI window using min-max algorithm ignoring extremes
+    EWT_window_minmax_n,
+    /// compute VOI window using min-max algorithm applied to region of interest
+    EWT_window_minmax_roi,
+    /// compute VOI window using Histogram algorithm, ignoring n percent
+    EWT_window_histogram,
+    /// compute VOI window using center and width
+    EWT_window_center_width
+};
 
 /*----------------------------*
  *  constant initializations  *
index 5d51ca30594ba0c69c0490df7acf14b590e2b891..bd48740cc3394b8c38b0e28b6cddd62063e6be91 100644 (file)
@@ -34,6 +34,7 @@ dcmimage.o: dcmimage.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -43,6 +44,7 @@ dcmimage.o: dcmimage.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -117,6 +119,7 @@ dibaslut.o: dibaslut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -126,6 +129,7 @@ dibaslut.o: dibaslut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmimgle/didefine.h
 diciefn.o: diciefn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimgle/diciefn.h ../include/dcmtk/dcmimgle/didispfn.h \
@@ -168,6 +172,7 @@ diciefn.o: diciefn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -176,7 +181,8 @@ diciefn.o: diciefn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h
 dicielut.o: dicielut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimgle/dicielut.h \
  ../include/dcmtk/dcmimgle/didislut.h \
@@ -216,6 +222,7 @@ dicielut.o: dicielut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -225,6 +232,7 @@ dicielut.o: dicielut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmimgle/didefine.h
 didislut.o: didislut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimgle/didislut.h \
@@ -264,6 +272,7 @@ didislut.o: didislut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -273,6 +282,7 @@ didislut.o: didislut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmimgle/didefine.h
 didispfn.o: didispfn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \
@@ -317,6 +327,7 @@ didispfn.o: didispfn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -325,7 +336,8 @@ didispfn.o: didispfn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h
 didocu.o: didocu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
@@ -363,6 +375,7 @@ didocu.o: didocu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -372,6 +385,7 @@ didocu.o: didocu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -484,6 +498,7 @@ digsdfn.o: digsdfn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -492,7 +507,8 @@ digsdfn.o: digsdfn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h
 digsdlut.o: digsdlut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimgle/digsdlut.h \
  ../include/dcmtk/dcmimgle/didislut.h \
@@ -532,6 +548,7 @@ digsdlut.o: digsdlut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -541,6 +558,7 @@ digsdlut.o: digsdlut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmimgle/didefine.h \
  ../include/dcmtk/dcmimgle/displint.h
 diimage.o: diimage.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -579,6 +597,7 @@ diimage.o: diimage.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -588,6 +607,7 @@ diimage.o: diimage.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -656,6 +676,7 @@ diinpx.o: diinpx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -665,6 +686,7 @@ diinpx.o: diinpx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmimgle/didefine.h
 diluptab.o: diluptab.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
@@ -719,7 +741,9 @@ diluptab.o: diluptab.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -770,6 +794,7 @@ dimo1img.o: dimo1img.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -779,6 +804,7 @@ dimo1img.o: dimo1img.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimgle/dimo1img.h ../include/dcmtk/dcmimgle/dimoimg.h \
  ../include/dcmtk/dcmimgle/diimage.h \
@@ -838,6 +864,7 @@ dimo2img.o: dimo2img.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -847,6 +874,7 @@ dimo2img.o: dimo2img.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimgle/dimo2img.h ../include/dcmtk/dcmimgle/dimoimg.h \
  ../include/dcmtk/dcmimgle/diimage.h \
@@ -870,39 +898,29 @@ dimo2img.o: dimo2img.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \
  ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/dimoopx.h \
  ../include/dcmtk/dcmimgle/didispfn.h
-dimoimg3.o: dimoimg3.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmimgle/dimoimg.h \
- ../../ofstd/include/dcmtk/ofstd/ofcast.h \
- ../include/dcmtk/dcmimgle/diimage.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h \
- ../../ofstd/include/dcmtk/ofstd/oftypes.h \
- ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
- ../../ofstd/include/dcmtk/ofstd/ofexport.h \
- ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
- ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oflist.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../../ofstd/include/dcmtk/ofstd/oflimits.h \
- ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h \
+dimoimg.o: dimoimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../oflog/include/dcmtk/oflog/config/defines.h \
  ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
  ../../oflog/include/dcmtk/oflog/loglevel.h \
  ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../oflog/include/dcmtk/oflog/tchar.h \
  ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
  ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../../oflog/include/dcmtk/oflog/layout.h \
  ../../oflog/include/dcmtk/oflog/streams.h \
@@ -916,16 +934,28 @@ dimoimg3.o: dimoimg3.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
+ ../include/dcmtk/dcmimgle/dimoimg.h ../include/dcmtk/dcmimgle/diimage.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
@@ -938,12 +968,23 @@ dimoimg3.o: dimoimg3.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \
  ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/dimoopx.h \
  ../include/dcmtk/dcmimgle/didispfn.h \
+ ../include/dcmtk/dcmimgle/dimo2img.h \
  ../include/dcmtk/dcmimgle/dimoipxt.h \
  ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \
  ../include/dcmtk/dcmimgle/dimopxt.h ../include/dcmtk/dcmimgle/dipxrept.h \
- ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/dimoopxt.h \
- ../include/dcmtk/dcmimgle/didislut.h
-dimoimg4.o: dimoimg4.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/dimocpt.h \
+ ../include/dcmtk/dcmimgle/dimosct.h ../include/dcmtk/dcmimgle/discalet.h \
+ ../include/dcmtk/dcmimgle/ditranst.h ../include/dcmtk/dcmimgle/dimoflt.h \
+ ../include/dcmtk/dcmimgle/diflipt.h ../include/dcmtk/dcmimgle/dimorot.h \
+ ../include/dcmtk/dcmimgle/dirotat.h ../include/dcmtk/dcmimgle/dimoopxt.h \
+ ../include/dcmtk/dcmimgle/didislut.h ../include/dcmtk/dcmimgle/digsdfn.h \
+ ../include/dcmtk/dcmimgle/didocu.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
+ ../include/dcmtk/dcmimgle/diregbas.h
+dimoimg3.o: dimoimg3.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimgle/dimoimg.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../include/dcmtk/dcmimgle/diimage.h \
@@ -989,8 +1030,10 @@ dimoimg4.o: dimoimg4.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1016,7 +1059,7 @@ dimoimg4.o: dimoimg4.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimgle/dimopxt.h ../include/dcmtk/dcmimgle/dipxrept.h \
  ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/dimoopxt.h \
  ../include/dcmtk/dcmimgle/didislut.h
-dimoimg5.o: dimoimg5.cc ../../config/include/dcmtk/config/osconfig.h \
+dimoimg4.o: dimoimg4.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimgle/dimoimg.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../include/dcmtk/dcmimgle/diimage.h \
@@ -1062,8 +1105,10 @@ dimoimg5.o: dimoimg5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1089,29 +1134,39 @@ dimoimg5.o: dimoimg5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimgle/dimopxt.h ../include/dcmtk/dcmimgle/dipxrept.h \
  ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/dimoopxt.h \
  ../include/dcmtk/dcmimgle/didislut.h
-dimoimg.o: dimoimg.cc ../../config/include/dcmtk/config/osconfig.h \
+dimoimg5.o: dimoimg5.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmimgle/dimoimg.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../include/dcmtk/dcmimgle/diimage.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
- ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
- ../../ofstd/include/dcmtk/ofstd/ofcast.h \
- ../../ofstd/include/dcmtk/ofstd/ofexport.h \
- ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../oflog/include/dcmtk/oflog/config/defines.h \
  ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
  ../../oflog/include/dcmtk/oflog/loglevel.h \
  ../../ofstd/include/dcmtk/ofstd/ofvector.h \
- ../../ofstd/include/dcmtk/ofstd/oftypes.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../oflog/include/dcmtk/oflog/tstring.h \
- ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../oflog/include/dcmtk/oflog/tchar.h \
  ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
  ../../ofstd/include/dcmtk/ofstd/ofutil.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../../oflog/include/dcmtk/oflog/layout.h \
  ../../oflog/include/dcmtk/oflog/streams.h \
@@ -1125,26 +1180,18 @@ dimoimg.o: dimoimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
- ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h \
- ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../../ofstd/include/dcmtk/ofstd/oflimits.h \
- ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
- ../include/dcmtk/dcmimgle/dimoimg.h ../include/dcmtk/dcmimgle/diimage.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
@@ -1157,22 +1204,11 @@ dimoimg.o: dimoimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmimgle/dimomod.h ../include/dcmtk/dcmimgle/diluptab.h \
  ../include/dcmtk/dcmimgle/dibaslut.h ../include/dcmtk/dcmimgle/dimoopx.h \
  ../include/dcmtk/dcmimgle/didispfn.h \
- ../include/dcmtk/dcmimgle/dimo2img.h \
  ../include/dcmtk/dcmimgle/dimoipxt.h \
  ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \
  ../include/dcmtk/dcmimgle/dimopxt.h ../include/dcmtk/dcmimgle/dipxrept.h \
- ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/dimocpt.h \
- ../include/dcmtk/dcmimgle/dimosct.h ../include/dcmtk/dcmimgle/discalet.h \
- ../include/dcmtk/dcmimgle/ditranst.h ../include/dcmtk/dcmimgle/dimoflt.h \
- ../include/dcmtk/dcmimgle/diflipt.h ../include/dcmtk/dcmimgle/dimorot.h \
- ../include/dcmtk/dcmimgle/dirotat.h ../include/dcmtk/dcmimgle/dimoopxt.h \
- ../include/dcmtk/dcmimgle/didislut.h ../include/dcmtk/dcmimgle/digsdfn.h \
- ../include/dcmtk/dcmimgle/didocu.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcfilefo.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
- ../include/dcmtk/dcmimgle/diregbas.h
+ ../include/dcmtk/dcmimgle/diinpx.h ../include/dcmtk/dcmimgle/dimoopxt.h \
+ ../include/dcmtk/dcmimgle/didislut.h
 dimomod.o: dimomod.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1214,6 +1250,7 @@ dimomod.o: dimomod.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1223,6 +1260,7 @@ dimomod.o: dimomod.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmimgle/didefine.h \
  ../include/dcmtk/dcmimgle/diobjcou.h ../include/dcmtk/dcmimgle/didocu.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
@@ -1277,6 +1315,7 @@ dimoopx.o: dimoopx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1286,6 +1325,7 @@ dimoopx.o: dimoopx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/dimopx.h \
  ../include/dcmtk/dcmimgle/dipixel.h ../include/dcmtk/dcmimgle/dimomod.h \
  ../include/dcmtk/dcmimgle/diluptab.h \
@@ -1330,6 +1370,7 @@ dimopx.o: dimopx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1339,6 +1380,7 @@ dimopx.o: dimopx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/dimomod.h \
  ../include/dcmtk/dcmimgle/diluptab.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1382,6 +1424,7 @@ diovdat.o: diovdat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1391,6 +1434,7 @@ diovdat.o: diovdat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \
  ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \
@@ -1432,6 +1476,7 @@ diovlay.o: diovlay.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1441,6 +1486,7 @@ diovlay.o: diovlay.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimgle/diovlay.h ../include/dcmtk/dcmimgle/diobjcou.h \
  ../include/dcmtk/dcmimgle/didefine.h ../include/dcmtk/dcmimgle/diovdat.h \
@@ -1502,6 +1548,7 @@ diovlimg.o: diovlimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1511,6 +1558,7 @@ diovlimg.o: diovlimg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimgle/diovlimg.h \
  ../include/dcmtk/dcmimgle/dimo2img.h ../include/dcmtk/dcmimgle/dimoimg.h \
@@ -1577,6 +1625,7 @@ diovpln.o: diovpln.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1586,6 +1635,7 @@ diovpln.o: diovpln.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1646,6 +1696,7 @@ diutils.o: diutils.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1655,5 +1706,6 @@ diutils.o: diutils.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmimgle/diutils.h ../include/dcmtk/dcmimgle/didefine.h
index 13911355a373169544861c74087bb3e1b3c85525..8738a61159e6a8013b435707db3129701e6ae421 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2011, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -114,6 +114,7 @@ DiDocument::DiDocument(DcmObject *object,
 void DiDocument::convertPixelData()
 {
     DcmStack pstack;
+    OFCondition status;
     DcmXfer xfer(Xfer);
     DCMIMGLE_DEBUG("transfer syntax of DICOM dataset: " << xfer.getXferName() << " (" << xfer.getXferID() << ")");
     // only search on main dataset level
@@ -147,7 +148,8 @@ void DiDocument::convertPixelData()
                     pstack.push(Object);
                     // dummy stack entry
                     pstack.push(PixelData);
-                    if (PixelData->chooseRepresentation(EXS_LittleEndianExplicit, NULL, pstack).good())
+                    status = PixelData->chooseRepresentation(EXS_LittleEndianExplicit, NULL, pstack);
+                    if (status.good())
                     {
                         // set transfer syntax to unencapsulated/uncompressed
                         if (xfer.isEncapsulated())
@@ -155,11 +157,13 @@ void DiDocument::convertPixelData()
                             Xfer = EXS_LittleEndianExplicit;
                             DCMIMGLE_DEBUG("decompressed complete pixel data in memory: " << PixelData->getLength(Xfer) << " bytes");
                         }
-                    } else
+                    } else {
                         DCMIMGLE_ERROR("can't change to unencapsulated representation for pixel data");
+                        DCMIMGLE_DEBUG("DcmPixelData::chooseRepresentation() returned: " << status.text());
+                    }
                 }
                 // determine color model of the decompressed image
-                OFCondition status = PixelData->getDecompressedColorModel(OFstatic_cast(DcmItem *, Object), PhotometricInterpretation);
+                status = PixelData->getDecompressedColorModel(OFstatic_cast(DcmItem *, Object), PhotometricInterpretation);
                 if (status.bad())
                 {
                     DCMIMGLE_ERROR("can't determine 'PhotometricInterpretation' of decompressed image");
index aecc9f473404e55794f9b2d590fb5ae8d9260859..ee7cfc3b610ad702403039253ee524f13aa5ac34 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2016, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -619,7 +619,7 @@ void DiImage::convertPixelData()
         else if (InputData->getData() == NULL)
         {
             ImageStatus = EIS_InvalidImage;
-            DCMIMGLE_ERROR("can't convert input pixel data, probably unsupported compression");
+            DCMIMGLE_ERROR("can't convert input pixel data");
         }
         else if (InputData->getPixelStart() >= InputData->getCount())
         {
@@ -708,7 +708,7 @@ void DiImage::updateImagePixelModuleAttributes(DcmItem &dataset)
     /* update PixelAspectRatio & Co. */
     char buffer[32];
     OFStandard::ftoa(buffer, 15, PixelHeight, OFStandard::ftoa_format_f);
-    strcat(buffer, "\\");
+    OFStandard::strlcat(buffer, "\\", 32);
     OFStandard::ftoa(strchr(buffer, 0), 15, PixelWidth, OFStandard::ftoa_format_f);
 
     if (hasPixelSpacing)
@@ -855,31 +855,32 @@ int DiImage::writeBMP(FILE *stream,
                     swapBytes(OFreinterpret_cast(Uint8 *, palette), 256 * 4 /*byteLength*/, 4 /*valWidth*/);
             }
             /* write bitmap file header: do not write the struct because of 32-bit alignment */
-            fwrite(&fileHeader.bfType, sizeof(fileHeader.bfType), 1, stream);
-            fwrite(&fileHeader.bfSize, sizeof(fileHeader.bfSize), 1, stream);
-            fwrite(&fileHeader.bfReserved1, sizeof(fileHeader.bfReserved1), 1, stream);
-            fwrite(&fileHeader.bfReserved2, sizeof(fileHeader.bfReserved2), 1, stream);
-            fwrite(&fileHeader.bfOffBits, sizeof(fileHeader.bfOffBits), 1, stream);
+            int ok = (fwrite(&fileHeader.bfType, sizeof(fileHeader.bfType), 1, stream) == 1);
+            ok &= (fwrite(&fileHeader.bfSize, sizeof(fileHeader.bfSize), 1, stream) == 1);
+            ok &= (fwrite(&fileHeader.bfReserved1, sizeof(fileHeader.bfReserved1), 1, stream) == 1);
+            ok &= (fwrite(&fileHeader.bfReserved2, sizeof(fileHeader.bfReserved2), 1, stream) == 1);
+            ok &= (fwrite(&fileHeader.bfOffBits, sizeof(fileHeader.bfOffBits), 1, stream) == 1);
             /* write bitmap info header: do not write the struct because of 32-bit alignment  */
-            fwrite(&infoHeader.biSize, sizeof(infoHeader.biSize), 1, stream);
-            fwrite(&infoHeader.biWidth, sizeof(infoHeader.biWidth), 1, stream);
-            fwrite(&infoHeader.biHeight, sizeof(infoHeader.biHeight), 1, stream);
-            fwrite(&infoHeader.biPlanes, sizeof(infoHeader.biPlanes), 1, stream);
-            fwrite(&infoHeader.biBitCount, sizeof(infoHeader.biBitCount), 1, stream);
-            fwrite(&infoHeader.biCompression, sizeof(infoHeader.biCompression), 1, stream);
-            fwrite(&infoHeader.biSizeImage, sizeof(infoHeader.biSizeImage), 1, stream);
-            fwrite(&infoHeader.biXPelsPerMeter, sizeof(infoHeader.biXPelsPerMeter), 1, stream);
-            fwrite(&infoHeader.biYPelsPerMeter, sizeof(infoHeader.biYPelsPerMeter), 1, stream);
-            fwrite(&infoHeader.biClrUsed, sizeof(infoHeader.biClrUsed), 1, stream);
-            fwrite(&infoHeader.biClrImportant, sizeof(infoHeader.biClrImportant), 1, stream);
+            ok &= (fwrite(&infoHeader.biSize, sizeof(infoHeader.biSize), 1, stream) == 1);
+            ok &= (fwrite(&infoHeader.biWidth, sizeof(infoHeader.biWidth), 1, stream) == 1);
+            ok &= (fwrite(&infoHeader.biHeight, sizeof(infoHeader.biHeight), 1, stream) == 1);
+            ok &= (fwrite(&infoHeader.biPlanes, sizeof(infoHeader.biPlanes), 1, stream) == 1);
+            ok &= (fwrite(&infoHeader.biBitCount, sizeof(infoHeader.biBitCount), 1, stream) == 1);
+            ok &= (fwrite(&infoHeader.biCompression, sizeof(infoHeader.biCompression), 1, stream) == 1);
+            ok &= (fwrite(&infoHeader.biSizeImage, sizeof(infoHeader.biSizeImage), 1, stream) == 1);
+            ok &= (fwrite(&infoHeader.biXPelsPerMeter, sizeof(infoHeader.biXPelsPerMeter), 1, stream) == 1);
+            ok &= (fwrite(&infoHeader.biYPelsPerMeter, sizeof(infoHeader.biYPelsPerMeter), 1, stream) == 1);
+            ok &= (fwrite(&infoHeader.biClrUsed, sizeof(infoHeader.biClrUsed), 1, stream) == 1);
+            ok &= (fwrite(&infoHeader.biClrImportant, sizeof(infoHeader.biClrImportant), 1, stream) == 1);
             /* write color palette (if applicable) */
             if (palette != NULL)
-                fwrite(palette, 4, 256, stream);
+                ok &= (fwrite(palette, 4, 256, stream) == 256);
             /* write pixel data */
-            fwrite(data, 1, OFstatic_cast(size_t, bytes), stream);
+            ok &= (fwrite(data, 1, OFstatic_cast(size_t, bytes), stream) == OFstatic_cast(size_t, bytes));
             /* delete color palette */
             delete[] palette;
-            result = 1;
+            if (ok)
+                result = 1;
         }
         /* delete pixel data */
         delete OFstatic_cast(char *, data);     // type cast necessary to avoid compiler warnings using gcc >2.95
index 0db68be56d62836e6103746cc87e48e0ecdec79f..268c61e2d31fadd6054dc39eeda3af5d50234396 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2016 OFFIS e.V.
+ *  Copyright (C) 1996-2018 OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -38,6 +38,7 @@
 #include "dcmtk/dcmimgle/diregbas.h"
 
 #define INCLUDE_CMATH
+#define INCLUDE_CINTTYPES
 #include "dcmtk/ofstd/ofstdinc.h"
 
 
@@ -2019,7 +2020,9 @@ int DiMonoImage::writeImageToDataset(DcmItem &dataset,
             /* set image resolution */
             dataset.putAndInsertUint16(DCM_Columns, Columns);
             dataset.putAndInsertUint16(DCM_Rows, Rows);
-#if SIZEOF_LONG == 8
+#ifdef PRId32
+            sprintf(numBuf, "%" PRId32, NumberOfFrames);
+#elif SIZEOF_LONG == 8
             sprintf(numBuf, "%d", NumberOfFrames);
 #else
             sprintf(numBuf, "%ld", NumberOfFrames);
@@ -2143,9 +2146,10 @@ int DiMonoImage::writeRawPPM(FILE *stream,
                 fprintf(stream, "P6\n%u %u\n255\n", Columns, Rows);
             else
                 fprintf(stream, "P5\n%u %u\n%lu\n", Columns, Rows, DicomImageClass::maxval(bits));
-            fwrite(OutputData->getData(), OFstatic_cast(size_t, OutputData->getCount()), OutputData->getItemSize(), stream);
+            const size_t count = OFstatic_cast(size_t, OutputData->getCount());
+            int ok = (fwrite(OutputData->getData(), OutputData->getItemSize(), count, stream) == count) ? 1 : 0;
             deleteOutputData();
-            return 1;
+            return ok;
         }
     }
     return 0;
index ef8f27d039e5fca85df9133798add88f8d3a8eac..e3a95ddcdcff8a5f2318881fb97cc94d252968bd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2012, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -57,11 +57,26 @@ DiMonoModality::DiMonoModality(const DiDocument *docu,
         else if (!(docu->getFlags() & CIF_UsePresentationState))        // ignore modality LUT and rescaling
         {
             const char *sopClassUID = NULL;                             // check for XA and XRF image (ignore MLUT)
-            if ((docu->getValue(DCM_SOPClassUID, sopClassUID) == 0) || (sopClassUID == NULL) ||
-               ((strcmp(sopClassUID, UID_XRayAngiographicImageStorage) != 0) &&
-                (strcmp(sopClassUID, UID_XRayRadiofluoroscopicImageStorage) != 0) &&
-                (strcmp(sopClassUID, UID_RETIRED_XRayAngiographicBiPlaneImageStorage) != 0)))
+            if (!docu->getValue(DCM_SOPClassUID, sopClassUID) || (sopClassUID == NULL))
+                sopClassUID = "";
+            if ((strcmp(sopClassUID, UID_XRayAngiographicImageStorage) == 0) ||
+                (strcmp(sopClassUID, UID_XRayRadiofluoroscopicImageStorage) == 0) ||
+                (strcmp(sopClassUID, UID_RETIRED_XRayAngiographicBiPlaneImageStorage) == 0))
             {
+                /* David Clunie in comp.protocols.dicom (2000-12-13):
+                    "Modality LUTs in XA and XRF objects are totally screwy and
+                     do not follow the normal rules. [...] A Modality LUT may be
+                     included with the image to allow it to be scaled back to its
+                     proportional value to X-Ray beam intensity. In other words,
+                     for the objects that use this module (XA and XRF), the
+                     Modality LUT is used BACKWARDS. It is used to convert stored
+                     pixels to X-Ray beam intensity space, but it is NOT APPLIED
+                     to stored pixels for the purpose of display (or more
+                     specifically prior to application of the VOI LUT Module
+                     attributes to the stored pixel data)."
+                */
+                DCMIMGLE_INFO("processing XA or XRF image ... ignoring possible modality transform");
+            } else {
                 EL_BitsPerTableEntry descMode = ELM_UseValue;          // first search on main level
                 if (docu->getFlags() & CIF_IgnoreModalityLutBitDepth)
                     descMode = ELM_IgnoreValue;
@@ -96,20 +111,33 @@ DiMonoModality::DiMonoModality(const DiDocument *docu,
                     }
                 }
                 checkRescaling(pixel);
-            } else {
-                /* David Clunie on comp.protocols.dicom (13.12.2000):
-                   Modality LUTs in XA and XRF objects are totally screwy and
-                   do not follow the normal rules. [...] A Modality LUT may be
-                   included with the image to allow it to be scaled back to its
-                   proportional value to X-Ray beamintensity. In otherwords,
-                   for the objects that use this module (XA and XRF), the
-                   Modality LUT is used BACKWARDS. It is used to convert
-                   stored pixels to X-Ray beamintensityspace, but it is NOT
-                   APPLIED to stored pixels for the purpose of display (or
-                   more specifically prior to application of the VOI LUT Module
-                   attributes to the storedpixeldata).
-                */
-                DCMIMGLE_INFO("processing XA or XRF image ... ignoring possible modality transform");
+                if (Rescaling || LookupTable)                          // check for possibly inappropriate use of MLUT
+                {
+                    /* David Clunie in comp.protocols.dicom (2012-10-28):
+                        "By the way, in general, it can be difficult to decide
+                         whether or not to apply the conceptual Modality LUT
+                         step before windowing, even if it is specified by
+                         Rescale Slope/Intercept values rather than an actual
+                         LUT. For example, in MR images to which Philips has
+                         added the rescale values, these should not be applied
+                         before their window values; likewise in PET images,
+                         especially those with GML Units and rescale values to
+                         SUV (small decimal numbers), the window values are
+                         historically usually in stored pixel values rather than
+                         SUVs.
+                         Making the correct decision may require comparing the
+                         range of possible rescaled output values (across the
+                         domain of possible input stored pixel values) with the
+                         specific window values, to see if the latter "make
+                         sense".
+                    */
+                    if (strcmp(sopClassUID, UID_MRImageStorage) == 0)
+                        DCMIMGLE_WARN("processing MR image ... applying modality transform may create unexpected result");
+                    else if (strcmp(sopClassUID, UID_PositronEmissionTomographyImageStorage) == 0)
+                        DCMIMGLE_WARN("processing PET image ... applying modality transform may create unexpected result");
+                    else if (strcmp(sopClassUID, UID_RTDoseStorage) == 0)
+                        DCMIMGLE_WARN("processing RTDOSE object ... applying modality transform may create unexpected result");
+                }
             }
         }
         determineRepresentation(docu);
index adfe7b4dfbe0fe3297d40089d22ec89d1c65870b..fce44fe01175fe1556abaa4e3c04e37b4375b418 100644 (file)
@@ -201,33 +201,40 @@ Uint16 *DiOverlay::Init(const DiOverlay *overlay)
             OFstatic_cast(unsigned long, overlay->Height) * overlay->Frames;
         if ((Data != NULL) && (Data->Planes != NULL) && (count > 0))
         {
-            unsigned int i;
-            Data->DataBuffer = new Uint16[OFstatic_cast(unsigned long, Width) * OFstatic_cast(unsigned long, Height) * Frames];
-            if (Data->DataBuffer != NULL)
+            const unsigned long bufSize = OFstatic_cast(unsigned long, Width) *
+                OFstatic_cast(unsigned long, Height) * Frames;
+            if (bufSize > 0)                                            // avoid invalid buffer
             {
-                Uint16 *temp = NULL;
-                if (overlay->Data->DataBuffer == NULL)              // no data buffer
+                Data->DataBuffer = new Uint16[bufSize];
+                if (Data->DataBuffer != NULL)
                 {
-                    temp = new Uint16[count];                       // create temporary buffer
-                    if (temp != NULL)
-                        OFBitmanipTemplate<Uint16>::zeroMem(temp, count);
-                }
-                for (i = 0; i < Data->ArrayEntries; ++i)
-                {
-                    if ((overlay->Data->Planes[i] != NULL) /*&& (overlay->Data->Planes[i]->isValid())*/)
+                    unsigned int i;
+                    Uint16 *temp = NULL;
+                    if (overlay->Data->DataBuffer == NULL)              // no data buffer
                     {
-                        Data->Planes[i] = new DiOverlayPlane(overlay->Data->Planes[i], i, Data->DataBuffer, temp,
-                            overlay->Width, overlay->Height, Width, Height);
-                        ++(Data->Count);
+                        temp = new Uint16[count];                       // create temporary buffer
+                        if (temp != NULL)
+                            OFBitmanipTemplate<Uint16>::zeroMem(temp, count);
                     }
+                    for (i = 0; i < Data->ArrayEntries; ++i)
+                    {
+                        if ((overlay->Data->Planes[i] != NULL) /*&& (overlay->Data->Planes[i]->isValid())*/)
+                        {
+                            Data->Planes[i] = new DiOverlayPlane(overlay->Data->Planes[i], i, Data->DataBuffer, temp,
+                                overlay->Width, overlay->Height, Width, Height);
+                            ++(Data->Count);                            // increase number of valid planes
+                        }
+                    }
+                    if (Data->Count != overlay->Data->Count)            // assertion!
+                    {
+                        DCMIMGLE_WARN("different number of overlay planes for converted and original image");
+                    }
+                    if (overlay->Data->DataBuffer != NULL)              // existing data buffer
+                        temp = overlay->Data->DataBuffer;               // point to input buffer
+                    return temp;
                 }
-                if (Data->Count != overlay->Data->Count)            // assertion!
-                {
-                    DCMIMGLE_WARN("different number of overlay planes for scaled and unscaled image");
-                }
-                if (overlay->Data->DataBuffer != NULL)              // existing data buffer
-                    temp = overlay->Data->DataBuffer;               // point to input buffer
-                return temp;
+            } else {
+                DCMIMGLE_DEBUG("skipping overlay planes for converted image ... calculated buffer size is 0");
             }
         }
     }
index c8d8f0adb10a48722534df46b67b48aa61bbcb81..d982f7cb233897acc9e7a66e1e020024048b27db 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2016, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -27,6 +27,7 @@
 #include "dcmtk/dcmdata/dctagkey.h"
 #include "dcmtk/dcmdata/dcpixel.h"
 #include "dcmtk/ofstd/ofbmanip.h"
+#include "dcmtk/ofstd/ofutil.h"
 
 #include "dcmtk/dcmimgle/diovpln.h"
 #include "dcmtk/dcmimgle/didocu.h"
@@ -262,7 +263,7 @@ DiOverlayPlane::DiOverlayPlane(const unsigned int group,
 
 DiOverlayPlane::DiOverlayPlane(DiOverlayPlane *plane,
                                const unsigned int bit,
-                               Uint16 *data,
+                               const Uint16 *data,
                                Uint16 *temp,
                                const Uint16 width,
                                const Uint16 height,
@@ -554,6 +555,8 @@ void DiOverlayPlane::setScaling(const double xfactor,
     Top = OFstatic_cast(Sint16, yfactor * Top);
     Width = OFstatic_cast(Uint16, xfactor * Width);
     Height = OFstatic_cast(Uint16, yfactor * Height);
+    StartLeft = OFstatic_cast(unsigned int, xfactor * StartLeft);
+    StartTop = OFstatic_cast(unsigned int, yfactor * StartTop);
 }
 
 
@@ -565,12 +568,12 @@ void DiOverlayPlane::setFlipping(const int horz,
     if (horz)
     {
         Left = OFstatic_cast(Sint16, columns - Width - Left);
-        StartLeft = OFstatic_cast(Uint16, OFstatic_cast(signed long, Columns) - Width - StartLeft);
+        StartLeft = OFstatic_cast(unsigned int, OFstatic_cast(signed long, Columns) - Width - StartLeft);
     }
     if (vert)
     {
         Top = OFstatic_cast(Sint16, rows - Height - Top);
-        StartTop = OFstatic_cast(Uint16, OFstatic_cast(signed long, Rows) - Height - StartTop);
+        StartTop = OFstatic_cast(unsigned int, OFstatic_cast(signed long, Rows) - Height - StartTop);
     }
 }
 
@@ -585,29 +588,25 @@ void DiOverlayPlane::setRotation(const int degree,
         setFlipping(1, 1, left_pos + columns, top_pos + rows);
     else if ((degree == 90) || (degree == 270))
     {
-        Uint16 us = Height;                     // swap visible width/height
-        Height = Width;
-        Width = us;
+        OFswap(Width, Height);                  // swap visible width/height
 /*
-        us = Rows;                              // swap stored width/height -> already done in the constructor !
-        Rows = Columns;
-        Columns = us;
+        OFswap(Columns, Rows);                  // swap stored columns/rows -> already done in the constructor !
 */
         if (degree == 90)                       // rotate right
         {
-            Sint16 ss = Left;
-            us = StartLeft;
+            const Sint16 ss = Left;
+            const unsigned int ui = StartLeft;
             Left = OFstatic_cast(Sint16, OFstatic_cast(signed long, columns) - Width - Top + top_pos);
-            StartLeft = OFstatic_cast(Uint16, OFstatic_cast(signed long, Columns) - Width - StartTop);
+            StartLeft = OFstatic_cast(unsigned int, OFstatic_cast(signed long, Columns) - Width - StartTop);
             Top = OFstatic_cast(Sint16, ss - left_pos);
-            StartTop = us;
+            StartTop = ui;
         } else {                                // rotate left
-            Sint16 ss = Left;
-            us = StartLeft;
+            const Sint16 ss = Left;
+            const unsigned int ui = StartLeft;
             Left = OFstatic_cast(Sint16, Top - top_pos);
             StartLeft = StartTop;
             Top = OFstatic_cast(Sint16, OFstatic_cast(signed long, rows) - Height - ss + left_pos);
-            StartTop = OFstatic_cast(Uint16, OFstatic_cast(signed long, Rows) - Height - us);
+            StartTop = OFstatic_cast(unsigned int, OFstatic_cast(signed long, Rows) - Height - ui);
         }
     }
 }
index 07e691f48044ff0768c35ce818f0680610dcd67f..046eb789b178142106617a9c748229be8d983c62 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmiod)
+project(dcmiod)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
+include_directories("${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc include tests)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc include tests)
+  add_subdirectory(${SUBDIR})
+endforeach()
index e73b3cedc521444a5344221fe3361af2d38a8948..9ee1b5e52e2ecc92093071bbff8839e52c5b21e2 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmiod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h" PATTERN "CVS" EXCLUDE)
+install(DIRECTORY dcmtk/dcmiod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 64cd3ff8f8c6d8d2d5a751229cd29a720fd7e02c..c956527a0b22dcd94c037d8a5a30498285ba66dd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, Pascal Getreuer, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Pascal Getreuer, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -55,7 +55,7 @@ public:
    *  @param  B Output sRGB "R" component (blue) with 0 <= B <= 1
    *  @param  LDicom Input DICOM CIELab luminance component with 0 <= L <= 65535
    *  @param  aDicom Input DICOM CIELab "a" component (red<->green) with 0 <= a <= 65535
-   *  @param  bDicom Input DIOCM CIELab "b" component (blue<->yellow) with 0 <= a <= 65535
+   *  @param  bDicom Input DICOM CIELab "b" component (blue<->yellow) with 0 <= a <= 65535
    */
   static void dicomLab2RGB(double& R, double& G, double& B, double LDicom, double aDicom, double bDicom);
 
index 2695751266f1d8c28954cc99adbb9cda43311920..2444edd9c6a16cbd414b152e07aca92d76938c53 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -272,7 +272,7 @@ private:
 
   template<typename T>
 #ifdef HAVE_CXX11
-  typename std::enable_if<DcmIODImageHasType<T,Types...>::value,OFCondition>::type
+  typename std::enable_if<DcmIODImageHasType<IODImagePixelModule<T>,Types...>::value,OFCondition>::type
 #else
   OFTypename OFenable_if
   <
@@ -287,7 +287,7 @@ private:
 
   template<typename T>
 #ifdef HAVE_CXX11
-  typename std::enable_if<!DcmIODImageHasType<T,Types...>::value,OFCondition>::type
+  typename std::enable_if<!DcmIODImageHasType<IODImagePixelModule<T>,Types...>::value,OFCondition>::type
 #else
   OFTypename OFenable_if
   <
index 3678d9becff1b0bd1540315cb05505ed9b390fec..0babf72a15fd132dd0c0a85fd3efc73ba4972964 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -137,7 +137,7 @@ public:
   /** Constructor to create a new attribute rule
    *  @param  key The tag key of the attribute
    *  @param  VM  The VM of the attribute (notation like in DICOM part 6,
-   *          e.g.\ "1-n")
+   *          e.g.\ "1-n"), for sequences the number of items allowed.
    *  @param  type The "IOD type" of the attribute.
    *          Allowed values "1", "1C", "2", "2C" and "3"
    *  @param  module The module or "component" this attribute belongs to
@@ -175,8 +175,9 @@ public:
   virtual OFString getType() const;
 
   /** The VM of the attribute as noted in the DICOM standard part 6,
-   *  e.g.\ "1-n" or "2"
-   *  @return The VM
+   *  e.g.\ "1-n" or "2". For Sequences (VR SQ) whose VM is always 1 by the
+   *  standard, this denotes the number of items permitted.
+   *  @return The VM (or number of items permitted)
    */
   virtual OFString getVM() const;
 
index 37a7851aa041f962905054c2be0ab55e8d5322f7..ae0098c22e30400a02e53d258948c0ec7ed8d9ac 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -353,9 +353,9 @@ public:
     if (elem == NULL)
     return EC_IllegalParameter;
 
-    size_t vm = elem->getVM();
+    size_t numValues = elem->getNumberOfValues();
     OFCondition result;
-    for (size_t count = 0; (count < vm) && result.good(); count ++)
+    for (size_t count = 0; (count < numValues) && result.good(); count ++)
     {
       Uint8 value;
       result = elem->getUint8(value, OFstatic_cast(unsigned long, count));
@@ -478,7 +478,7 @@ public:
    *          See DcmElement::checkVM() for a list of valid values.
    *  @param  type The sequence type as noted in part 3 of the DICOM standard,
    *          i.e.\ "1,1C,2,2C or 3".
-   *  @param  module Nname of the module/macro this sequence is contained in. Used
+   *  @param  module Name of the module/macro this sequence is contained in. Used
    *          for error messages and can also be left empty.
    *  @return status EC_Normal if successful, an error code otherwise
    */
@@ -501,15 +501,15 @@ public:
 
 
   /** Reads DICOM sequence into container by creating a dedicated container
-   *   element for each DICOM item. The container must support the
-   *   push_back(T) function and the container's element type T must support
-   *   the read(DcmItem*) function.
-    *  @param  source The source DICOM item read the sequence from
-    *  @param  seqKey The tag key of the sequence to be read
-    *  @param  destination The destination container to read into
-    *  @param  rule The rule for reading this sequence. If NULL, an error is returned.
-    *  @return EC_Normal if successful, an error code otherwise
-    */
+   *  element for each DICOM item. The container must support the
+   *  push_back(T) function and the container's element type T must support
+   *  the read(DcmItem*) function.
+   *  @param  source The source DICOM item read the sequence from
+   *  @param  seqKey The tag key of the sequence to be read
+   *  @param  destination The destination container to read into
+   *  @param  rule The rule for reading this sequence. If NULL, an error is returned.
+   *  @return EC_Normal if successful, an error code otherwise
+   */
   template <class Container>
   static OFCondition readSubSequence(DcmItem& source,
                                      const DcmTagKey& seqKey,
@@ -918,17 +918,18 @@ public:
     */
   static OFString createUID(const Uint8 level = 0);
 
-  /** Print warning if more than 65535 frames are present. This is the maximum
-   *  number since the Number of Frames attribute is only 16 bit thus not
-   *  permitting larger values.
+  /** Print warning if more than 2147483647 frames are present. This is the maximum
+   *  number since the Number of Frames attribute has a VR of IS which allows
+   *  a maximum of 2^31-1.
    *  The method returns the number of frames that can be used, i.e. either
-   *  65535 if the maximum is exceeded, otherwise the actual number of frames.
+   *  2147483647 if the maximum is exceeded, otherwise the actual number
+   *  of frames.
    *  @param  numFramesPresent The number of frames actually present
-   *  @param  warning The message to be printed if Number of Frames is larger
-   *          than 65535.
+   *  @param  warning The message to be printed if Number of Frames
+   *          is larger than 2147483647.
    *  @return Number of frames that can be safely used.
    */
-  static Uint16 limitMaxFrames(const size_t numFramesPresent,
+  static Uint32 limitMaxFrames(const size_t numFramesPresent,
                                const OFString& warning);
 
 private:
index f974c838ac2b9305ba4de431e1aa91aa1225698a..77e72d7e30d8247ee9e6da34c8888abc369d5cf6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -51,7 +51,11 @@ public:
 
       /** Default Constructor
        */
-      EquipmentInfo() {}
+      EquipmentInfo() :
+        m_Manufacturer(),
+        m_ManufacturerModelName(),
+        m_DeviceSerialNumber(),
+        m_SoftwareVersions() {}
 
       /** Convenience Constructor setting commonly used values
        *  @param manufacturer Manufacturer
index df6b376000a0e535584e9d007a8e208667f66288..213db6d82c85b85d4807b1bdcdd4fbe5efd485ff 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -145,7 +145,7 @@ public:
    *  @param  value Value to be stored
    *  @return EC_Normal if successful, an error code otherwise
    */
-  virtual OFCondition setNumberOfFrames(const Uint16 value);
+  virtual OFCondition setNumberOfFrames(const Uint32 value);
 
   /** Set Representative Frame Number
    *  @param  value Value to be stored
index 32d01341b2f3ee881ba4b30bf9b758afa8d14148..0cf41a8c7be8f5c96848f45998ad9464c63739a4 100644 (file)
@@ -47,6 +47,7 @@ iodcommn.o: iodcommn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -54,6 +55,7 @@ iodcommn.o: iodcommn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \
  ../include/dcmtk/dcmiod/modpatient.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
@@ -178,6 +180,7 @@ iodcontentitemmacro.o: iodcontentitemmacro.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -187,6 +190,7 @@ iodcontentitemmacro.o: iodcontentitemmacro.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -295,6 +299,7 @@ iodmacro.o: iodmacro.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -304,6 +309,7 @@ iodmacro.o: iodmacro.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -413,6 +419,7 @@ iodreferences.o: iodreferences.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -422,6 +429,7 @@ iodreferences.o: iodreferences.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \
  ../include/dcmtk/dcmiod/iodreferences.h \
  ../include/dcmtk/dcmiod/iodutil.h \
@@ -494,6 +502,7 @@ iodrules.o: iodrules.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -501,6 +510,7 @@ iodrules.o: iodrules.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
@@ -550,6 +560,7 @@ iodtypes.o: iodtypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -559,6 +570,7 @@ iodtypes.o: iodtypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h
@@ -598,6 +610,7 @@ iodutil.o: iodutil.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -607,6 +620,7 @@ iodutil.o: iodutil.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmiod/iodutil.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
@@ -678,6 +692,7 @@ modacquisitioncontext.o: modacquisitioncontext.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -687,6 +702,7 @@ modacquisitioncontext.o: modacquisitioncontext.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -804,8 +820,10 @@ modbase.o: modbase.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -867,6 +885,7 @@ modcommoninstanceref.o: modcommoninstanceref.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -876,6 +895,7 @@ modcommoninstanceref.o: modcommoninstanceref.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -995,6 +1015,7 @@ modenhequipment.o: modenhequipment.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1002,6 +1023,7 @@ modenhequipment.o: modenhequipment.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmiod/cielabutil.h ../include/dcmtk/dcmiod/modbase.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
@@ -1074,8 +1096,10 @@ modenhusimage.o: modenhusimage.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1195,6 +1219,7 @@ modenhusseries.o: modenhusseries.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1202,6 +1227,7 @@ modenhusseries.o: modenhusseries.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \
  ../include/dcmtk/dcmiod/iodmacro.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
@@ -1317,6 +1343,7 @@ modequipment.o: modequipment.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1324,6 +1351,7 @@ modequipment.o: modequipment.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmiod/cielabutil.h ../include/dcmtk/dcmiod/modbase.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
@@ -1397,8 +1425,10 @@ modfloatingpointimagepixel.o: modfloatingpointimagepixel.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1468,8 +1498,10 @@ modfor.o: modfor.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1540,6 +1572,7 @@ modgeneralimage.o: modgeneralimage.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1547,6 +1580,7 @@ modgeneralimage.o: modgeneralimage.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \
  ../include/dcmtk/dcmiod/modbase.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -1626,8 +1660,10 @@ modgeneralseries.o: modgeneralseries.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1748,8 +1784,10 @@ modgeneralstudy.o: modgeneralstudy.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1869,8 +1907,10 @@ modhelp.o: modhelp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1883,8 +1923,9 @@ modhelp.o: modhelp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h
-modimagepixelbase.o: modimagepixelbase.cc \
+modimagepixel.o: modimagepixel.cc \
  ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmiod/modimagepixel.h \
  ../include/dcmtk/dcmiod/modimagepixelbase.h \
  ../include/dcmtk/dcmiod/modbase.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
@@ -1930,8 +1971,10 @@ modimagepixelbase.o: modimagepixelbase.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1958,9 +2001,8 @@ modimagepixelbase.o: modimagepixelbase.cc \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatutl.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
  ../../ofstd/include/dcmtk/ofstd/oftime.h
-modimagepixel.o: modimagepixel.cc \
+modimagepixelbase.o: modimagepixelbase.cc \
  ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmiod/modimagepixel.h \
  ../include/dcmtk/dcmiod/modimagepixelbase.h \
  ../include/dcmtk/dcmiod/modbase.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
@@ -2006,8 +2048,10 @@ modimagepixel.o: modimagepixel.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2078,6 +2122,7 @@ modmultiframedimension.o: modmultiframedimension.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2085,6 +2130,7 @@ modmultiframedimension.o: modmultiframedimension.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmiod/ioddef.h ../include/dcmtk/dcmiod/cielabutil.h \
  ../include/dcmtk/dcmiod/modbase.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -2166,7 +2212,9 @@ modmultiframefg.o: modmultiframefg.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2227,6 +2275,7 @@ modpatient.o: modpatient.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2236,6 +2285,7 @@ modpatient.o: modpatient.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -2349,6 +2399,7 @@ modpatientstudy.o: modpatientstudy.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2358,6 +2409,7 @@ modpatientstudy.o: modpatientstudy.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -2469,6 +2521,7 @@ modsegmentationseries.o: modsegmentationseries.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2478,6 +2531,7 @@ modsegmentationseries.o: modsegmentationseries.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -2597,8 +2651,10 @@ modsopcommon.o: modsopcommon.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2678,8 +2734,10 @@ modsynchronization.o: modsynchronization.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2756,8 +2814,10 @@ modusfor.o: modusfor.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
index 77082bd50c3cabe876b6486c38f2644a578f482c..fa4f315440e911372091f3e6affb4d476c70f8aa 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2005-2010, Pascal Getreuer
+ *  Copyright (C) 2005-2018, Pascal Getreuer
  *  Copyright (C) 2016, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
@@ -47,7 +47,7 @@ void IODCIELabUtil::rgb2DicomLab(double& LDicom, double& aDicom, double& bDicom,
 {
   double L, a, b;
   rgb2Lab(L, a, b, R, G, B);
-  lab2DicomLab(LDicom, aDicom, bDicom, R, G, B);
+  lab2DicomLab(LDicom, aDicom, bDicom, L, a, b);
 }
 
 
@@ -106,9 +106,9 @@ void IODCIELabUtil::rgb2Xyz(double& X, double& Y, double& Z, double R, double G,
   R = invGammaCorrection(R);
   G = invGammaCorrection(G);
   B = invGammaCorrection(B);
-  X = (double)(0.4123955889674142161*R + 0.3575834307637148171*G + 0.1804926473817015735*B);
-  Y = (double)(0.2125862307855955516*R + 0.7151703037034108499*G + 0.07220049864333622685*B);
-  Z = (double)(0.01929721549174694484*R + 0.1191838645808485318*G + 0.9504971251315797660*B);
+  X = OFstatic_cast(double, (0.4123955889674142161*R + 0.3575834307637148171*G + 0.1804926473817015735*B));
+  Y = OFstatic_cast(double, (0.2125862307855955516*R + 0.7151703037034108499*G + 0.07220049864333622685*B));
+  Z = OFstatic_cast(double, (0.01929721549174694484*R + 0.1191838645808485318*G + 0.9504971251315797660*B));
 }
 
 
@@ -149,9 +149,9 @@ void IODCIELabUtil::xyz2Rgb(double& R, double& G, double& B, double X, double Y,
 {
   double R1, B1, G1, Min;
 
-  R1 = (double)( 3.2406*X - 1.5372*Y - 0.4986*Z);
-  G1 = (double)(-0.9689*X + 1.8758*Y + 0.0415*Z);
-  B1 = (double)( 0.0557*X - 0.2040*Y + 1.0570*Z);
+  R1 = OFstatic_cast(double, ( 3.2406*X - 1.5372*Y - 0.4986*Z));
+  G1 = OFstatic_cast(double, (-0.9689*X + 1.8758*Y + 0.0415*Z));
+  B1 = OFstatic_cast(double, ( 0.0557*X - 0.2040*Y + 1.0570*Z));
 
   Min = min3(R1, G1, B1);
 
index bc76df8ad28657fc971a9cecdcd33361d701ea8d..a96793cb03aff926b3e187f94d2bdb05ae6dd7dc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -36,7 +36,8 @@ const OFString ContentItemMacro::ReferencedSOPSequenceItem::m_ComponentName = "R
 ContentItemMacro::ReferencedSOPSequenceItem::ReferencedSOPSequenceItem(OFshared_ptr<DcmItem> item,
                                                      OFshared_ptr<IODRules> rules,
                                                      IODComponent* parent)
-: IODComponent(item, rules, parent)
+: IODComponent(item, rules, parent),
+  m_SOPInstanceReferenceMacro()
 {
   // reset element rules
   resetRules();
@@ -44,7 +45,8 @@ ContentItemMacro::ReferencedSOPSequenceItem::ReferencedSOPSequenceItem(OFshared_
 
 
 ContentItemMacro::ReferencedSOPSequenceItem::ReferencedSOPSequenceItem(IODComponent* parent)
-: IODComponent(parent)
+: IODComponent(parent),
+  m_SOPInstanceReferenceMacro()
 {
   // reset element rules
   resetRules();
@@ -52,7 +54,8 @@ ContentItemMacro::ReferencedSOPSequenceItem::ReferencedSOPSequenceItem(IODCompon
 
 
 ContentItemMacro::ReferencedSOPSequenceItem::ReferencedSOPSequenceItem(const ReferencedSOPSequenceItem& rhs)
-: IODComponent(rhs)
+: IODComponent(rhs),
+  m_SOPInstanceReferenceMacro()
 {
 }
 
@@ -145,7 +148,11 @@ const OFString ContentItemMacro::m_ModuleName = "ContentItemMacro";
 
 
 ContentItemMacro::ContentItemMacro()
-: IODComponent()
+: IODComponent(),
+  m_ConceptNameCodeSequence(),
+  m_ConceptCodeSequence(),
+  m_MeasurementUnitsCodeSequence(),
+  m_ReferencedSOPSequence()
 {
   resetRules();
 }
@@ -153,7 +160,11 @@ ContentItemMacro::ContentItemMacro()
 
 ContentItemMacro::ContentItemMacro(OFshared_ptr<DcmItem> item,
                                    OFshared_ptr<IODRules> rules)
-: IODComponent(item, rules)
+: IODComponent(item, rules),
+  m_ConceptNameCodeSequence(),
+  m_ConceptCodeSequence(),
+  m_MeasurementUnitsCodeSequence(),
+  m_ReferencedSOPSequence()
 {
   // reset element rules
   resetRules();
@@ -161,7 +172,11 @@ ContentItemMacro::ContentItemMacro(OFshared_ptr<DcmItem> item,
 
 
 ContentItemMacro::ContentItemMacro(const ContentItemMacro& rhs)
-: IODComponent(rhs)
+: IODComponent(rhs),
+  m_ConceptNameCodeSequence(),
+  m_ConceptCodeSequence(),
+  m_MeasurementUnitsCodeSequence(),
+  m_ReferencedSOPSequence()
 {
   if (this == &rhs)
     return;
index 4386202c24377faa0d0b2bba211117c950a1e81f..2a0d2cdadc9e4884723303912913237cfd11614c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -236,6 +236,7 @@ CodeWithModifiers::CodeWithModifiers(const OFString& modifierType,
                                      const OFString& modifierVM,
                                      const DcmTagKey& modifierSeq)
 : CodeSequenceMacro(),
+  m_Modifiers(),
   m_ModifierType(modifierType),
   m_ModifierVM(modifierVM),
   m_CodeModifierSeq(modifierSeq)
@@ -246,7 +247,10 @@ CodeWithModifiers::CodeWithModifiers(const OFString& modifierType,
 
 CodeWithModifiers::CodeWithModifiers(const CodeWithModifiers& rhs)
 : CodeSequenceMacro(rhs),
-  m_Modifiers()
+  m_Modifiers(),
+  m_ModifierType(),
+  m_ModifierVM(),
+  m_CodeModifierSeq()
 {
   if (&rhs == this)
     return;
@@ -349,7 +353,7 @@ OFCondition CodeWithModifiers::addModifier(const CodeSequenceMacro& modifier)
 
 CodeSequenceMacro* CodeWithModifiers::getModifier(const size_t index)
 {
-  if (index > m_Modifiers.size())
+  if (index + 1 > m_Modifiers.size())
     return NULL;
   else
     return m_Modifiers[index];
@@ -418,16 +422,18 @@ const OFString IODSeriesAndInstanceReferenceMacro::ReferencedSeriesItem::m_Compo
 
 IODSeriesAndInstanceReferenceMacro::IODSeriesAndInstanceReferenceMacro(OFshared_ptr< DcmItem > data,
                                                                        OFshared_ptr< IODRules > rules,
-                                                                       IODComponent* parent)
-: IODComponent(data, rules, parent)
+                                                                       IODComponent* parent) :
+  IODComponent(data, rules, parent),
+  m_ReferencedSeriesItems()
 {
   // reset element rules
   resetRules();
 }
 
 
-IODSeriesAndInstanceReferenceMacro::IODSeriesAndInstanceReferenceMacro(IODComponent* parent)
-: IODComponent(parent)
+IODSeriesAndInstanceReferenceMacro::IODSeriesAndInstanceReferenceMacro(IODComponent* parent) :
+  IODComponent(parent),
+  m_ReferencedSeriesItems()
 {
   // reset element rules
   resetRules();
@@ -764,7 +770,7 @@ ImageSOPInstanceReferenceMacro::~ImageSOPInstanceReferenceMacro()
 
 int ImageSOPInstanceReferenceMacro::compare(const IODComponent& rhs) const
 {
-  ImageSOPInstanceReferenceMacro *macro = OFstatic_cast(ImageSOPInstanceReferenceMacro*, OFconst_cast(IODComponent*, &rhs) );
+  const ImageSOPInstanceReferenceMacro *macro = OFstatic_cast(const ImageSOPInstanceReferenceMacro*, &rhs);
   if (macro == NULL) return -1;
   int result = ReferencedFrameNumber.compare(macro->ReferencedFrameNumber);
   if (result == 0) ReferencedSegmentNumber.compare(macro->ReferencedSegmentNumber);
@@ -840,7 +846,7 @@ OFCondition ImageSOPInstanceReferenceMacro::addReferencedFrameNumber(const Uint1
                                                                      const OFBool checkValue)
 {
   (void)checkValue;
-  const unsigned long count = ReferencedFrameNumber.getVM();
+  const unsigned long count = ReferencedFrameNumber.getNumberOfValues();
   return ReferencedFrameNumber.putUint16(value, count /* starts with 0, so add new value at the end */);
 }
 
@@ -857,7 +863,7 @@ OFCondition ImageSOPInstanceReferenceMacro::addReferencedSegmentNumber(const Uin
                                                                        const OFBool checkValue)
 {
   (void)checkValue;
-  const unsigned long count = ReferencedSegmentNumber.getVM();
+  const unsigned long count = ReferencedSegmentNumber.getNumberOfValues();
   return ReferencedSegmentNumber.putUint16(value, count /* starts with 0, so add new value at the end */);
 
 }
@@ -1783,7 +1789,9 @@ OFCondition HL7HierarchicDesignatorMacro::setUniversalEntityIDType(const OFStrin
 MandatoryViewAndSliceProgressionDirectionMacro::MandatoryViewAndSliceProgressionDirectionMacro(OFshared_ptr< DcmItem > item,
                                                                                                OFshared_ptr< IODRules > rules,
                                                                                                IODComponent* parent)
-: IODComponent(item, rules, parent)
+: IODComponent(item, rules, parent),
+  m_ViewCodeSequence(),
+  m_ViewModifierCode()
 {
   resetRules();
 }
@@ -1791,7 +1799,9 @@ MandatoryViewAndSliceProgressionDirectionMacro::MandatoryViewAndSliceProgression
 
 
 MandatoryViewAndSliceProgressionDirectionMacro::MandatoryViewAndSliceProgressionDirectionMacro(IODComponent* parent)
-: IODComponent(parent)
+: IODComponent(parent),
+  m_ViewCodeSequence(),
+  m_ViewModifierCode()
 {
   resetRules();
 }
index 285f5ba799856e509cdc17117658d665b3cd1e2d..bf57c13fbbc8e4375c40bc266704341484b9a0c9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016-2017, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
 // ------------------- class IODReference -------------------------------
 
 IODReference::IODReference(const IODReference::MAX_LEVEL level)
-: m_Level(level)
+: m_PatientID(),
+  m_StudyInstanceUID(),
+  m_SeriesInstanceUID(),
+  m_SOPClassUID(),
+  m_SOPInstanceUID(),
+  m_Level(level)
 {
 }
 
 
 IODReference::IODReference()
-: m_Level(LEVEL_STUDY)
+: m_PatientID(),
+  m_StudyInstanceUID(),
+  m_SeriesInstanceUID(),
+  m_SOPClassUID(),
+  m_SOPInstanceUID(),
+  m_Level(LEVEL_STUDY)
 {
 }
 
@@ -131,7 +141,7 @@ OFCondition IODReferences::readTractographyReferencedInstanceSequence(DcmItem& s
       DcmElement* elem = NULL;
       if (item->findAndGetElement(DCM_ReferencedFrameNumber, elem).good())
       {
-        unsigned long vm = elem->getVM();
+        unsigned long vm = elem->getNumberOfValues();
         for (unsigned long f = 0; f < vm; f++)
         {
           Sint32 val = 0;
@@ -320,12 +330,14 @@ IODReference* IODReference::clone() const
 
 
 IODImageReference::IODImageReference(const IODReference::MAX_LEVEL level)
-: IODReference(level)
+: IODReference(level),
+  m_ReferencedFrameNumber()
 {
 }
 
 IODImageReference::IODImageReference()
-: IODReference(LEVEL_INSTANCE)
+: IODReference(LEVEL_INSTANCE),
+  m_ReferencedFrameNumber()
 {
 
 }
@@ -337,13 +349,14 @@ IODImageReference::IODImageReference(const OFString& patientID,
                                      const OFString& sopInstanceUID,
                                      const OFString& sopClassUID,
                                      const OFVector<Uint32>& refFrameNumbers)
+: IODReference(LEVEL_INSTANCE),
+  m_ReferencedFrameNumber(refFrameNumbers)
 {
   m_PatientID = patientID;
   m_StudyInstanceUID = studyUID;
   m_SeriesInstanceUID = seriesUID;
   m_SOPInstanceUID = sopInstanceUID;
   m_SOPClassUID = sopClassUID;
-  m_ReferencedFrameNumber = refFrameNumbers;
 }
 
 
@@ -352,6 +365,7 @@ IODImageReference::IODImageReference(const OFString& patientID,
                                      const OFString& seriesUID,
                                      const OFString& sopInstanceUID,
                                      const OFString& sopClassUID)
+: m_ReferencedFrameNumber()
 {
   m_PatientID = patientID;
   m_StudyInstanceUID = studyUID;
@@ -402,13 +416,15 @@ OFBool IODImageReference::readFromFile(const OFString& filename,
 // ------------------ class IODSegmentationReference ---------------------------
 
 IODSegmentationReference::IODSegmentationReference(const IODReference::MAX_LEVEL level)
-: IODReference(level)
+: IODReference(level),
+  m_ReferencedSegmentNumber()
 {
 }
 
 
 IODSegmentationReference::IODSegmentationReference()
-: IODReference(LEVEL_INSTANCE)
+: IODReference(LEVEL_INSTANCE),
+  m_ReferencedSegmentNumber()
 {
 
 }
@@ -453,6 +469,7 @@ void IODSegmentationReference::clear()
 
 
 IODReferences::IODReferences()
+: m_References()
 {
   // nothing to do
 }
@@ -465,6 +482,7 @@ IODReferences::~IODReferences()
 
 
 IODReferences::IODReferences(const IODReferences& rhs)
+: m_References()
 {
   *this = rhs;
 }
index ca18755eb76a078d9510a591b408a76bf9839e5c..b951f8aaa6f36c87feaf6c8bbc1ff96b642a65e8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -360,7 +360,7 @@ OFCondition DcmIODUtil::getFloat64ValuesFromElement(const DcmElement& delem,
   OFCondition cond = OFconst_cast(DcmElement &, delem).getFloat64Array(floats);
   if (cond.good())
   {
-    size_t vm = OFconst_cast(DcmElement &, delem).getVM();
+    size_t vm = OFconst_cast(DcmElement &, delem).getNumberOfValues();
     for (size_t n = 0; n < vm; n++)
     {
       result.push_back(floats[n]);
@@ -441,7 +441,7 @@ OFCondition DcmIODUtil::getUint16ValuesFromElement(DcmElement &delem,
                                                    OFVector<Uint16>& values)
 {
   OFCondition result;
-  const size_t count = delem.getVM();
+  const size_t count = delem.getNumberOfValues();
   values.reserve(count);
   for (size_t i = 0;  i < count; i++)
   {
@@ -556,7 +556,7 @@ OFBool DcmIODUtil::isSequenceTag(const DcmTagKey& key,
   {
     vr = dictRef->getVR();
   }
-  dcmDataDict.unlock();
+  dcmDataDict.rdunlock();
   if (vr.getEVR() == EVR_SQ)
     return OFTrue;
   return OFFalse;
@@ -605,13 +605,13 @@ OFString DcmIODUtil::createUID(const Uint8 level)
 }
 
 
-Uint16 DcmIODUtil::limitMaxFrames(const size_t numFramesPresent,
+Uint32 DcmIODUtil::limitMaxFrames(const size_t numFramesPresent,
                                   const OFString& warning)
 {
-  if (numFramesPresent > 65535)
+  if (numFramesPresent > 2147483647)
   {
     DCMIOD_WARN(warning);
-    return 65535;
+    return 2147483647;
   }
   return OFstatic_cast(Uint16, numFramesPresent);
 }
index 246b15ecec65bdfa50f0cb95a8d079e919149213..baeba89857b8f3c6c2ecca8f8784364b01a2b8b1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -30,6 +30,7 @@ const OFString IODCommonInstanceReferenceModule::StudiesOtherInstancesItem::m_Co
 IODCommonInstanceReferenceModule::IODCommonInstanceReferenceModule(OFshared_ptr< DcmItem > item,
                                                                    OFshared_ptr< IODRules > rules)
 : IODModule(item, rules),
+  m_ReferenceSeriesItems(),
   m_StudiesContainingOtherReferencedInstancesSequence()
 {
   resetRules();
@@ -37,7 +38,9 @@ IODCommonInstanceReferenceModule::IODCommonInstanceReferenceModule(OFshared_ptr<
 
 
 IODCommonInstanceReferenceModule::IODCommonInstanceReferenceModule()
-: IODModule()
+: IODModule(),
+  m_ReferenceSeriesItems(),
+  m_StudiesContainingOtherReferencedInstancesSequence()
 {
   resetRules();
 }
@@ -351,4 +354,4 @@ void IODCommonInstanceReferenceModule::freeMemory()
 {
   DcmIODUtil::freeContainer(m_StudiesContainingOtherReferencedInstancesSequence);
   DcmIODUtil::freeContainer(m_ReferenceSeriesItems);
-}
\ No newline at end of file
+}
index dcd71f4c24c67a4a8836f837fd18558eb06ac068..6c834cdba66989558c69227f1013f21a4073c999 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -38,7 +38,8 @@ IODEnhGeneralEquipmentModule::IODEnhGeneralEquipmentModule(OFshared_ptr<DcmItem>
 
 
 IODEnhGeneralEquipmentModule::IODEnhGeneralEquipmentModule()
-: IODModule()
+: IODModule(),
+  m_ModuleName("EnhancedGeneralEquipmentModule")
 {
   resetRules();
 }
index 34c9dec70e7684a054f7091d4d074b8146a509d4..932bf4403b838fa42ed07547c577f5c652cdf056 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -28,7 +28,9 @@ const OFString IODEnhancedUSSeriesModule::m_ModuleName = "EnhancedUSSeries";
 
 IODEnhancedUSSeriesModule::IODEnhancedUSSeriesModule(OFshared_ptr<DcmItem> item,
                                                      OFshared_ptr<IODRules> rules)
-: IODModule(item, rules)
+: IODModule(item, rules),
+  m_ReferencedPerformedProcedureStep(),
+  m_PerformedProtocolCode()
 {
   // reset element rules
   resetRules();
@@ -36,7 +38,9 @@ IODEnhancedUSSeriesModule::IODEnhancedUSSeriesModule(OFshared_ptr<DcmItem> item,
 
 
 IODEnhancedUSSeriesModule::IODEnhancedUSSeriesModule()
-: IODModule()
+: IODModule(),
+  m_ReferencedPerformedProcedureStep(),
+  m_PerformedProtocolCode()
 {
   // reset element rules
   resetRules();
index ade432db2b975cb38e13c24772762cf44d2decbd..eadd5275d6bd1ea3d0d98f85698efbe364d7ae68 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -38,7 +38,8 @@ IODGeneralEquipmentModule::IODGeneralEquipmentModule(OFshared_ptr<DcmItem> item,
 
 
 IODGeneralEquipmentModule::IODGeneralEquipmentModule()
-: IODModule()
+: IODModule(),
+  m_ModuleName("GeneralEquipmentModule")
 {
   resetRules();
 }
index cacdb6c53ca05569ffa9fe9b45f1c2b650382b4a..8849fd1976dc9b4ec0517f0b911b7b336d28c14a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -37,23 +37,25 @@ const OFString IODGeneralSeriesModule::m_ModuleName = "GeneralSeriesModule";
 
 IODGeneralSeriesModule::IODGeneralSeriesModule(OFshared_ptr<DcmItem> item,
                                                OFshared_ptr<IODRules> rules)
-: IODModule(item, rules)
+: IODModule(item, rules),
+  m_ReferencedPPS()
 {
   // reset element rules
   resetRules();
 }
 
 
-OFString IODGeneralSeriesModule::getName() const
+IODGeneralSeriesModule::IODGeneralSeriesModule()
+: IODModule(),
+  m_ReferencedPPS()
 {
-  return m_ModuleName;
+  resetRules();
 }
 
 
-IODGeneralSeriesModule::IODGeneralSeriesModule()
-: IODModule()
+OFString IODGeneralSeriesModule::getName() const
 {
-  resetRules();
+  return m_ModuleName;
 }
 
 
index 6d67b0d8451e8516eefd1cde31e786652e2366a4..e5102b4df595de497e72e534d1f2bde9c2b03f15 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -47,7 +47,10 @@ IODGeneralStudyModule::IODGeneralStudyModule(OFshared_ptr<DcmItem> item,
 
 
 IODGeneralStudyModule::IODGeneralStudyModule()
-: IODModule()
+: IODModule(),
+  m_IssuerOfAccessionNumberSequence(),
+  m_ProcedureCodeSequence(),
+  m_ReasonForPerformedProcedureCodeSequence()
 {
   resetRules();
 }
index caa3521f1b46c9d0c3ffd3860140ba3de11ca3b3..906cafcd626278dd7bcde870c6655503163c5890 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -44,7 +44,9 @@ IODMultiframeDimensionModule::IODMultiframeDimensionModule(OFshared_ptr<DcmItem>
 
 
 IODMultiframeDimensionModule::IODMultiframeDimensionModule()
-: IODModule()
+: IODModule(),
+  m_DimensionIndexSequence(),
+  m_DimensionOrganizationSequence()
 {
   resetRules();
 }
index 4b256baa34ad1d67aaa0d0b28d702e3e29fee6e3..b706fb94c6fe2b902ad8b0eb328cdfc37ad4b066 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -47,7 +47,8 @@ OFString IODMultiFrameFGModule::getName() const
 
 
 IODMultiFrameFGModule::IODMultiFrameFGModule()
-: IODModule()
+: IODModule(),
+  m_ConcatenationInfo()
 {
   resetRules();
 }
@@ -150,8 +151,13 @@ OFCondition IODMultiFrameFGModule::setContentTime(const OFString& value,
 }
 
 
-OFCondition IODMultiFrameFGModule::setNumberOfFrames(const Uint16 value)
+OFCondition IODMultiFrameFGModule::setNumberOfFrames(const Uint32 value)
 {
+  if (value > 2147483647)
+  {
+     DCMIOD_ERROR("Cannot set Number of Frames to " << value << ": Maximum permitted value is 2147483647");
+     return EC_InvalidValue;
+  }
   OFCondition result;
   OFStringStream oss;
   oss << value;
index 72634ea23d58a05ca8a823ad65f4bd4d78bf5f7c..25032727a6656c919b0979b4430b619ec7f92c18 100644 (file)
@@ -9,17 +9,19 @@ tcielabutil.o: tcielabutil.cc \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -46,6 +48,7 @@ tcielabutil.o: tcielabutil.cc \
  ../../oflog/include/dcmtk/oflog/logmacro.h \
  ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofrand.h \
  ../include/dcmtk/dcmiod/cielabutil.h ../include/dcmtk/dcmiod/ioddef.h
 tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oftest.h \
@@ -57,17 +60,19 @@ tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -105,17 +110,19 @@ timagepixel.o: timagepixel.cc \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
index 9fd78fd8598d01760bd47a58081ef8056f48354b..8cbab8c7abb75a5385041c01865ab0668f64e46d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, OFFIS e.V.
+ *  Copyright (C) 2017-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 
 #include "dcmtk/ofstd/oftest.h"
+#include "dcmtk/ofstd/ofrand.h"
 #include "dcmtk/dcmiod/cielabutil.h"
-#define INCLUDE_CSTDLIB               // for srand()
-#define INCLUDE_CTIME                 // for time() initialization of srand()
-#include "dcmtk/ofstd/ofstdinc.h"
+
 
 OFTEST(dcmiod_tcielabutil)
 {
@@ -79,7 +78,7 @@ OFTEST(dcmiod_tcielabutil)
   // roundtrip is less than around 1 promille
 
   // Initialize random numbers
-  srand (OFstatic_cast(unsigned int, time (NULL)));
+  OFRandom rnd;
 
   // We do 1000 runs
   for (size_t numRun = 0; numRun< 1000; numRun++)
@@ -91,9 +90,9 @@ OFTEST(dcmiod_tcielabutil)
     i1 = i2 = i3 = r1 = r2 = r3 = o1 = o2 = o3 = 0.0;
 
     // Roundtrip RGB -> CIELab -> RGB
-    i1 = (double)rand() / (double)RAND_MAX;
-    i2 = (double)rand() / (double)RAND_MAX;
-    i3 = (double)rand() / (double)RAND_MAX;
+    i1 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1);
+    i2 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1);
+    i3 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1);
     IODCIELabUtil::rgb2Lab(r1, r2, r3, i1, i2, i3);
     IODCIELabUtil::lab2Rgb(o1, o2, o3, r1, r2, r3);
     OFCHECK( fabs(i1 - o1) < 0.001 );
@@ -102,9 +101,9 @@ OFTEST(dcmiod_tcielabutil)
 
     // Roundtrip CIELab -> DICOM CIELab -> CIELab
     i1 = i2 = i3 = r1 = r2 = r3 = o1 = o2 = o3 = 0.0;
-    i1 = ((double)rand() / ((double)RAND_MAX)) * 100.0;
-    i2 = ((double)rand() / ((double)RAND_MAX)) * 255.0 - 128;
-    i3 = ((double)rand() / ((double)RAND_MAX)) * 255.0 - 128;
+    i1 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1) * 100.0;
+    i2 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1) * 255.0 - 128;
+    i3 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1) * 255.0 - 128;
     IODCIELabUtil::lab2DicomLab(r1, r2, r3, i1, i2, i3);
     IODCIELabUtil::dicomlab2Lab(o1, o2, o3, r1, r2, r3);
     OFCHECK( fabs(i1 - o1) < 0.001 );
@@ -113,9 +112,9 @@ OFTEST(dcmiod_tcielabutil)
 
     // Roundtrip RGB -> CIEXYZ -> CIELab -> dicomCIELab -> RGB
     i1 = i2 = i3 = r1 = r2 = r3 = o1 = o2 = o3 = 0.0;
-    i1 = ((double)rand() / ((double)RAND_MAX));
-    i2 = ((double)rand() / ((double)RAND_MAX));
-    i3 = ((double)rand() / ((double)RAND_MAX));
+    i1 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1);
+    i2 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1);
+    i3 = OFstatic_cast(double,rnd.getRND32()) / OFstatic_cast(Uint32,-1);
     IODCIELabUtil::rgb2Xyz(r1, r2, r3, i1, i2, i3);
     IODCIELabUtil::xyz2Lab(o1, o2, o3, r1, r2, r3);
     IODCIELabUtil::lab2DicomLab(r1, r2, r3, o1, o2, o3);
index 89b36ace18659e2fa244d0f6e9ea98798916aa7f..0e995bf8cd27aa0388187e7ff20ea3b569fdaad7 100644 (file)
@@ -1,7 +1,7 @@
 # declare project
-PROJECT(dcmjpeg)
+project(dcmjpeg)
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc libijg8 libijg12 libijg16 apps include)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc libijg8 libijg12 libijg16 apps include)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 9a93bebfad63fd438987fef224a992ceb6f1eef3..294a96f8a83235fc33997088a1eafeed5535defb 100644 (file)
@@ -1,12 +1,12 @@
 # declare additional include directories
-INCLUDE_DIRECTORIES("${dcmjpeg_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${LIBTIFF_INCDIR} ${LIBPNG_INCDIR})
+include_directories("${dcmjpeg_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${LIBTIFF_INCDIR} ${LIBPNG_INCDIR})
 
 # declare executables
-FOREACH(PROGRAM dcmcjpeg dcmdjpeg dcmj2pnm dcmmkdir)
+foreach(PROGRAM dcmcjpeg dcmdjpeg dcmj2pnm dcmmkdir)
   DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
-ENDFOREACH(PROGRAM)
+endforeach()
 
 # make sure executables are linked to the corresponding libraries
-FOREACH(PROGRAM dcmcjpeg dcmdjpeg dcmj2pnm dcmmkdir)
+foreach(PROGRAM dcmcjpeg dcmdjpeg dcmj2pnm dcmmkdir)
   DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmjpeg ijg8 ijg12 ijg16 dcmimage dcmimgle dcmdata oflog ofstd)
-ENDFOREACH(PROGRAM)
+endforeach()
index 1b8ae549329ea76e6d97644160bd86ba5fcf0396..512dac17f215b71e6394cceda6685dd3e242ffce 100644 (file)
@@ -35,6 +35,7 @@ dcmcjpeg.o: dcmcjpeg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -44,6 +45,7 @@ dcmcjpeg.o: dcmcjpeg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -159,6 +161,7 @@ dcmdjpeg.o: dcmdjpeg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -168,6 +171,7 @@ dcmdjpeg.o: dcmdjpeg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -279,6 +283,7 @@ dcmj2pnm.o: dcmj2pnm.cc ../../dcmimage/apps/dcm2pnm.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -288,6 +293,7 @@ dcmj2pnm.o: dcmj2pnm.cc ../../dcmimage/apps/dcm2pnm.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -424,6 +430,7 @@ dcmmkdir.o: dcmmkdir.cc ../../dcmdata/apps/dcmgpdir.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -433,6 +440,7 @@ dcmmkdir.o: dcmmkdir.cc ../../dcmdata/apps/dcmgpdir.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
index 6eaf5b579faf084440a5b9d0271ee664de5079f3..baf6fcbf3d12d28010a06bedcc600f8bc491a6a1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2001-2017, OFFIS e.V.
+ *  Copyright (C) 2001-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -81,8 +81,11 @@ int main(int argc, char *argv[])
   int              opt_compressedBits = 0; // 0=auto, 8/12/16=force
   E_CompressionColorSpaceConversion opt_compCSconversion = ECC_lossyYCbCr;
   E_DecompressionColorSpaceConversion opt_decompCSconversion = EDC_photometricInterpretation;
-  E_SubSampling    opt_sampleFactors = ESS_444;
-  OFBool           opt_useYBR422 = OFFalse;
+  OFBool           opt_predictor6WorkaroundEnable = OFFalse;
+  OFBool           opt_cornellWorkaroundEnable = OFFalse;
+  OFBool           opt_forceSingleFragmentPerFrame = OFFalse;
+  E_SubSampling    opt_sampleFactors = ESS_422;
+  OFBool           opt_useYBR422 = OFTrue;
   OFCmdUnsignedInt opt_fragmentSize = 0; // 0=unlimited
   OFBool           opt_createOffsetTable = OFTrue;
   int              opt_windowType = 0;  /* default: no windowing; 1=Wi, 2=Wl, 3=Wm, 4=Wh, 5=Ww, 6=Wn, 7=Wr */
@@ -94,6 +97,7 @@ int main(int argc, char *argv[])
   OFBool           opt_usePixelValues = OFTrue;
   OFBool           opt_useModalityRescale = OFFalse;
   OFBool           opt_trueLossless = OFTrue;
+  OFBool           opt_lossless = OFTrue;
   OFBool           lossless = OFTrue;  /* see opt_oxfer */
 
   OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Encode DICOM file to JPEG transfer syntax", rcsid);
@@ -171,11 +175,16 @@ int main(int argc, char *argv[])
       cmd.addOption("--conv-always",         "+ca",    "always convert YCbCr to RGB");
       cmd.addOption("--conv-never",          "+cn",    "never convert color space");
 
-    cmd.addSubGroup("standard YCbCr component subsampling (not with +tl):");
-      cmd.addOption("--sample-444",          "+s4",    "4:4:4 sampling with YBR_FULL (default)");
-      cmd.addOption("--sample-422",          "+s2",    "4:2:2 subsampling with YBR_FULL_422");
+    cmd.addSubGroup("decompr. workaround options for incorrect encodings (if input is compressed):");
+      cmd.addOption("--workaround-pred6",    "+w6",    "enable workaround for JPEG lossless images\nwith overflow in predictor 6");
+      cmd.addOption("--workaround-incpl",    "+wi",    "enable workaround for incomplete JPEG data");
+      cmd.addOption("--workaround-cornell",  "+wc",    "enable workaround for 16-bit JPEG lossless\nCornell images with Huffman table overflow");
 
-    cmd.addSubGroup("non-standard YCbCr component subsampling (not with +tl):");
+    cmd.addSubGroup("YCbCr component subsampling (lossy JPEG only):");
+      cmd.addOption("--sample-422",          "+s2",    "4:2:2 subsampling with YBR_FULL_422 (default)");
+
+    cmd.addSubGroup("non-standard YCbCr component subsampling (lossy JPEG only):");
+      cmd.addOption("--nonstd-444",          "+s4",    "4:4:4 sampling with YBR_FULL");
       cmd.addOption("--nonstd-422-full",     "+n2",    "4:2:2 subsampling with YBR_FULL");
       cmd.addOption("--nonstd-411-full",     "+n1",    "4:1:1 subsampling with YBR_FULL");
       cmd.addOption("--nonstd-411",          "+np",    "4:1:1 subsampling with YBR_FULL_422");
@@ -302,12 +311,36 @@ int main(int argc, char *argv[])
       // JPEG options
 
       cmd.beginOptionBlock();
-      if (cmd.findOption("--encode-lossless-sv1")) opt_oxfer = EXS_JPEGProcess14SV1;
-      if (cmd.findOption("--encode-lossless")) opt_oxfer = EXS_JPEGProcess14;
-      if (cmd.findOption("--encode-baseline")) opt_oxfer = EXS_JPEGProcess1;
-      if (cmd.findOption("--encode-extended")) opt_oxfer = EXS_JPEGProcess2_4;
-      if (cmd.findOption("--encode-spectral")) opt_oxfer = EXS_JPEGProcess6_8;
-      if (cmd.findOption("--encode-progressive")) opt_oxfer = EXS_JPEGProcess10_12;
+      if (cmd.findOption("--encode-lossless-sv1"))
+      {
+          opt_oxfer = EXS_JPEGProcess14SV1;
+          opt_lossless = OFTrue;
+      }
+      if (cmd.findOption("--encode-lossless"))
+      {
+          opt_oxfer = EXS_JPEGProcess14;
+          opt_lossless = OFTrue;
+      }
+      if (cmd.findOption("--encode-baseline"))
+      {
+          opt_oxfer = EXS_JPEGProcess1;
+          opt_lossless = OFFalse;
+      }
+      if (cmd.findOption("--encode-extended"))
+      {
+          opt_oxfer = EXS_JPEGProcess2_4;
+          opt_lossless = OFFalse;
+      }
+      if (cmd.findOption("--encode-spectral"))
+      {
+          opt_oxfer = EXS_JPEGProcess6_8;
+          opt_lossless = OFFalse;
+      }
+      if (cmd.findOption("--encode-progressive"))
+      {
+          opt_oxfer = EXS_JPEGProcess10_12;
+          opt_lossless = OFFalse;
+      }
       cmd.endOptionBlock();
 
       // check for JPEG lossless output transfer syntaxes
@@ -433,34 +466,43 @@ int main(int argc, char *argv[])
       cmd.endOptionBlock();
       if (opt_trueLossless) opt_decompCSconversion = EDC_never;
 
+      if (cmd.findOption("--workaround-pred6")) opt_predictor6WorkaroundEnable = OFTrue;
+      if (cmd.findOption("--workaround-incpl")) opt_forceSingleFragmentPerFrame = OFTrue;
+      if (cmd.findOption("--workaround-cornell")) opt_cornellWorkaroundEnable = OFTrue;
+
       cmd.beginOptionBlock();
-      if (cmd.findOption("--sample-444"))
+      if (cmd.findOption("--nonstd-444"))
       {
-        app.checkConflict("--sample-444", "--true-lossless", opt_trueLossless);
+        app.checkConflict("--nonstd-444", "--true-lossless", opt_trueLossless);
+        app.checkConflict("--nonstd-444", "--pseudo-lossless", opt_lossless);
         opt_sampleFactors = ESS_444;
         opt_useYBR422 = OFFalse;
       }
       if (cmd.findOption("--sample-422"))
       {
         app.checkConflict("--sample-422", "--true-lossless", opt_trueLossless);
+        app.checkConflict("--sample-422", "--pseudo-lossless", opt_lossless);
         opt_sampleFactors = ESS_422;
         opt_useYBR422 = OFTrue;
       }
       if (cmd.findOption("--nonstd-422-full"))
       {
         app.checkConflict("--nonstd-422-full", "--true-lossless", opt_trueLossless);
+        app.checkConflict("--nonstd-422-full", "--pseudo-lossless", opt_lossless);
         opt_sampleFactors = ESS_422;
         opt_useYBR422 = OFFalse;
       }
       if (cmd.findOption("--nonstd-411-full"))
       {
         app.checkConflict("--nonstd-411-full", "--true-lossless", opt_trueLossless);
+        app.checkConflict("--nonstd-411-full", "--pseudo-lossless", opt_lossless);
         opt_sampleFactors = ESS_411;
         opt_useYBR422 = OFFalse;
       }
       if (cmd.findOption("--nonstd-411"))
       {
         app.checkConflict("--nonstd-411", "--true-lossless", opt_trueLossless);
+        app.checkConflict("--nonstd-411", "--pseudo-lossless", opt_lossless);
         opt_sampleFactors = ESS_411;
         opt_useYBR422 = OFTrue;
       }
@@ -583,7 +625,11 @@ int main(int argc, char *argv[])
     // register global decompression codecs
     DJDecoderRegistration::registerCodecs(
       opt_decompCSconversion,
-      opt_uidcreation);
+      opt_uidcreation,
+      EPC_default,
+      opt_predictor6WorkaroundEnable,
+      opt_cornellWorkaroundEnable,
+      opt_forceSingleFragmentPerFrame);
 
     // register global compression codecs
     DJEncoderRegistration::registerCodecs(
@@ -670,8 +716,7 @@ int main(int argc, char *argv[])
     if (lossless)
         rp = &rp_lossless;
 
-    dataset->chooseRepresentation(opt_oxfer, rp);
-    if (dataset->canWriteXfer(opt_oxfer))
+    if (dataset->chooseRepresentation(opt_oxfer, rp).good() && dataset->canWriteXfer(opt_oxfer))
     {
       OFLOG_INFO(dcmcjpegLogger, "Output transfer syntax " << opt_oxferSyn.getXferName() << " can be written");
     } else {
index 6b7d54ffacbc7d31f217785794aeac05ca6b147e..64eec45e2af9d51bfb6b36a0740a532be54eae18 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2001-2017, OFFIS e.V.
+ *  Copyright (C) 2001-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -71,6 +71,7 @@ int main(int argc, char *argv[])
   E_UIDCreation opt_uidcreation = EUC_default;
   E_PlanarConfiguration opt_planarconfig = EPC_default;
   OFBool opt_predictor6WorkaroundEnable = OFFalse;
+  OFBool opt_cornellWorkaroundEnable = OFFalse;
   OFBool opt_forceSingleFragmentPerFrame = OFFalse;
 
   OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION, "Decode JPEG-compressed DICOM file", rcsid);
@@ -113,6 +114,7 @@ int main(int argc, char *argv[])
     cmd.addSubGroup("workaround options for incorrect JPEG encodings:");
       cmd.addOption("--workaround-pred6",    "+w6",    "enable workaround for JPEG lossless images\nwith overflow in predictor 6");
       cmd.addOption("--workaround-incpl",    "+wi",    "enable workaround for incomplete JPEG data");
+      cmd.addOption("--workaround-cornell",  "+wc",    "enable workaround for 16-bit JPEG lossless\nCornell images with Huffman table overflow");
 
   cmd.addGroup("output options:");
     cmd.addSubGroup("output file format:");
@@ -188,6 +190,7 @@ int main(int argc, char *argv[])
 
       if (cmd.findOption("--workaround-pred6")) opt_predictor6WorkaroundEnable = OFTrue;
       if (cmd.findOption("--workaround-incpl")) opt_forceSingleFragmentPerFrame = OFTrue;
+      if (cmd.findOption("--workaround-cornell")) opt_cornellWorkaroundEnable = OFTrue;
 
       cmd.beginOptionBlock();
       if (cmd.findOption("--read-file"))
@@ -267,6 +270,7 @@ int main(int argc, char *argv[])
       opt_uidcreation,
       opt_planarconfig,
       opt_predictor6WorkaroundEnable,
+      opt_cornellWorkaroundEnable,
       opt_forceSingleFragmentPerFrame);
 
     /* make sure data dictionary is loaded */
index d0ab0d89b8cebf59069abbc2afdb7d82a1c68e55..b23852af7714b50c60e062581e3a33adfb3b0b6e 100644 (file)
@@ -281,44 +281,76 @@ decompression color space conversion
 
   # Never convert color space during decompression.
 
-standard YCbCr component subsampling (not with +tl):
+decompr. workaround options for incorrect encodings (if input is compressed):
 
-  +s4   --sample-444
-          4:4:4 sampling with YBR_FULL (default)
+  +w6   --workaround-pred6
+          enable workaround for JPEG lossless images
+          with overflow in predictor 6
 
-  # This option disables color component subsampling for compression in
-  # the YCbCr color space. The DICOM photometric interpretation is
-  # encoded as YBR_FULL.
+  # DICOM images with 16 bits/pixel have been observed "in the wild"
+  # that are compressed with lossless JPEG and need special handling
+  # because the encoder produced an 16-bit integer overflow in predictor
+  # 6, which needs to be compensated (reproduced) during decompression.
+  # This flag enables a correct decompression of such faulty images, but
+  # at the same time will cause an incorrect decompression of correctly
+  # compressed images. Use with care.
+
+  +wi   --workaround-incpl
+          enable workaround for incomplete JPEG data
+
+  # This option causes dcmjpeg to ignore incomplete JPEG data
+  # at the end of a compressed fragment and to start decompressing
+  # the next frame from the next fragment (if any). This permits
+  # images with incomplete JPEG data to be decoded.
+
+  +wc   --workaround-cornell
+          enable workaround for 16-bit JPEG lossless
+          Cornell images with Huffman table overflow
+
+  # One of the first open-source implementations of lossless JPEG
+  # compression, the "Cornell" library, has a well-known bug that leads
+  # to invalid values in the Huffmann table when images with 16 bit/sample
+  # are compressed. This flag enables a workaround that permits such
+  # images to be decoded correctly.
+
+YCbCr component subsampling (lossy JPEG only):
 
   +s2   --sample-422
-          4:2:2 subsampling with YBR_FULL_422
+          4:2:2 subsampling with YBR_FULL_422 (default)
 
   # This option enables a 4:2:2 color component subsampling for
   # compression in the YCbCr color space. The DICOM photometric
-  # interpretation is encoded as YBR_FULL.
+  # interpretation is encoded as YBR_FULL_422.
 
 non-standard YCbCr component subsampling (not with +tl):
 
+  +s4   --nonstd-444
+          4:4:4 sampling with YBR_FULL
+
+  # This option disables color component subsampling for compression in
+  # the YCbCr color space. The DICOM photometric interpretation is
+  # encoded as YBR_FULL, which violates DICOM rules for lossy JPEG.
+
   +n2   --nonstd-422-full
           4:2:2 subsampling with YBR_FULL
 
   # This option enables a 4:2:2 color component subsampling for
   # compression in the YCbCr color space. The DICOM photometric
-  # interpretation is encoded as YBR_FULL which violates DICOM rules.
+  # interpretation is encoded as YBR_FULL, which violates DICOM rules.
 
   +n1   --nonstd-411-full
           4:1:1 subsampling with YBR_FULL
 
   # This option enables a 4:1:1 color component subsampling for
   # compression in the YCbCr color space. The DICOM photometric
-  # interpretation is encoded as YBR_FULL which violates DICOM rules.
+  # interpretation is encoded as YBR_FULL, which violates DICOM rules.
 
   +np   --nonstd-411
           4:1:1 subsampling with YBR_FULL_422
 
   # This option enables a 4:1:1 color component subsampling for
   # compression in the YCbCr color space. The DICOM photometric
-  # interpretation is encoded as YBR_FULL_422 which violates DICOM rules.
+  # interpretation is encoded as YBR_FULL_422, which violates DICOM rules.
 \endverbatim
 
 \subsection dcmcjpeg_enc_pix_data_encoding_opt encapsulated pixel data encoding options:
@@ -528,12 +560,13 @@ data set trailing padding:
 
 \section dcmcjpeg_notes NOTES
 
-The \b dcmcjpeg utility compresses DICOM images of all SOP classes.  Special
-handling has been implemented for CT images (where the modality transformation
-is required to create Hounsfield units) and the XA/RF/Biplane SOP classes
-(where the modality transformation has "inversed" semantics).  However,
-\b dcmcjpeg does not attempt to ensure that the compressed image still complies
-with all restrictions of the object's IOD.
+The \b dcmcjpeg utility compresses DICOM images of all SOP classes.  It
+processes all Pixel Data (7fe0,0010) elements in the dataset, i.e. compression
+is also performed on an icon image.  Special handling has been implemented for
+CT images (where the modality transformation is required to create Hounsfield
+units) and the XA/RF/Biplane SOP classes (where the modality transformation has
+"inversed" semantics).  However, \b dcmcjpeg does not attempt to ensure that the
+compressed image still complies with all restrictions of the object's IOD.
 
 A few examples:
 
@@ -546,8 +579,8 @@ A few examples:
 
 The user is responsible for making sure that the compressed images he creates
 are compliant with the DICOM standard.  If in question, the \b dcmcjpeg utility
-allows one to convert an image to secondary capture - this SOP class does not pose
-restrictions as the ones mentioned above.
+allows one to convert an image to secondary capture - this SOP class does not
+pose restrictions as the ones mentioned above.
 
 With version DCMTK 3.5.4 a new encoder for truly lossless JPEG compression was
 added (\e --true-lossless).  Compared to the old (\e --pseudo-lossless) encoder,
@@ -668,6 +701,6 @@ It is an error if no data dictionary can be loaded.
 
 \section dcmcjpeg_copyright COPYRIGHT
 
-Copyright (C) 2001-2016 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2001-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index fa8d346d0477a84d2e5ffe3199265d69861a34a5..76218ec6a0751b042158bf25ea195e1b2ca51519 100644 (file)
@@ -176,6 +176,16 @@ workaround options for incorrect JPEG encodings:
   # the next frame from the next fragment (if any). This permits
   # images with incomplete JPEG data to be decoded.
 
+  +wc   --workaround-cornell
+          enable workaround for 16-bit JPEG lossless
+          Cornell images with Huffman table overflow
+
+  # One of the first open-source implementations of lossless JPEG
+  # compression, the "Cornell" library, has a well-known bug that leads
+  # to invalid values in the Huffmann table when images with 16 bit/sample
+  # are compressed. This flag enables a workaround that permits such
+  # images to be decoded correctly.
+
 \endverbatim
 
 \subsection dcmdjpeg_output_options output options
@@ -332,6 +342,6 @@ It is an error if no data dictionary can be loaded.
 
 \section dcmdjpeg_copyright COPYRIGHT
 
-Copyright (C) 2001-2016 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2001-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index 1777f307ad6112861204b8d995bf7cc79bcdf2e3..7804b8bc74f0543d800d6c735468f0f1d74e57ac 100644 (file)
@@ -153,7 +153,7 @@ scaling:
   +Syv  --scale-y-size  [n]umber: integer
           scale y axis to n pixels, auto-compute x axis
 
-color space conversion (compressed images only):
+color space conversion (JPEG compressed images only):
 
   +cp   --conv-photometric
           convert if YCbCr photometric interpretation (default)
@@ -174,6 +174,38 @@ color space conversion (compressed images only):
   +cn   --conv-never
           never convert color space
 
+workaround options for incorrect encodings (JPEG compressed images only):
+
+  +w6   --workaround-pred6
+          enable workaround for JPEG lossless images
+          with overflow in predictor 6
+
+  # DICOM images with 16 bits/pixel have been observed "in the wild"
+  # that are compressed with lossless JPEG and need special handling
+  # because the encoder produced an 16-bit integer overflow in predictor
+  # 6, which needs to be compensated (reproduced) during decompression.
+  # This flag enables a correct decompression of such faulty images, but
+  # at the same time will cause an incorrect decompression of correctly
+  # compressed images. Use with care.
+
+  +wi   --workaround-incpl
+          enable workaround for incomplete JPEG data
+
+  # This option causes dcmj2pnm to ignore incomplete JPEG data
+  # at the end of a compressed fragment and to start decompressing
+  # the next frame from the next fragment (if any). This permits
+  # images with incomplete JPEG data to be decoded.
+
+  +wc   --workaround-cornell
+          enable workaround for 16-bit JPEG lossless
+          Cornell images with Huffman table overflow
+
+  # One of the first open-source implementations of lossless JPEG
+  # compression, the "Cornell" library, has a well-known bug that leads
+  # to invalid values in the Huffmann table when images with 16 bit/sample
+  # are compressed. This flag enables a workaround that permits such
+  # images to be decoded correctly.
+
 modality LUT transformation:
 
   -M    --no-modality
@@ -542,6 +574,6 @@ It is an error if no data dictionary can be loaded.
 
 \section dcmj2pnm_copyright COPYRIGHT
 
-Copyright (C) 2001-2014 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2001-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index b060942fa0e08839c329d09f16e0e130f995de41..147d3d098b82c89dd13f5946fb77ef0540a6994c 100644 (file)
@@ -36,10 +36,8 @@ if (fileformat.loadFile("test.dcm").good())
   DJ_RPLossless params; // codec parameters, we use the defaults
 
   // this causes the lossless JPEG version of the dataset to be created
-  dataset->chooseRepresentation(EXS_JPEGProcess14SV1, &params);
-
-  // check if everything went well
-  if (dataset->canWriteXfer(EXS_JPEGProcess14SV1))
+  if (dataset->chooseRepresentation(EXS_JPEGProcess14SV1, &params).good() &&
+      dataset->canWriteXfer(EXS_JPEGProcess14SV1))
   {
     // force the meta-header UIDs to be re-generated when storing the file
     // since the UIDs in the data set may have changed
@@ -63,10 +61,8 @@ if (fileformat.loadFile("test_jpeg.dcm").good())
   DcmDataset *dataset = fileformat.getDataset();
 
   // decompress data set if compressed
-  dataset->chooseRepresentation(EXS_LittleEndianExplicit, NULL);
-
-  // check if everything went well
-  if (dataset->canWriteXfer(EXS_LittleEndianExplicit))
+  if (dataset->chooseRepresentation(EXS_LittleEndianExplicit, NULL).good() &&
+      dataset->canWriteXfer(EXS_LittleEndianExplicit))
   {
     fileformat.saveFile("test_decompressed.dcm", EXS_LittleEndianExplicit);
   }
index eb9d4a9620712390c1883ec5211f068604c95d4a..1036689c0a42cbbcf75c19db7d1021ee05dd8f67 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmjpeg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmjpeg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index f9a5e2a3a79ceae60de009e9338ade680fdb23ef..fee96fdc4acd17fcda3f86d913f04aa22b5d0163 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2016, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -40,6 +40,8 @@ public:
    *    decompressed color images should be handled
    *  @param predictor6WorkaroundEnable enable workaround for buggy lossless compressed images with
    *    overflow in predictor 6 for images with 16 bits/pixel
+   *  @param cornellWorkaroundEnable enable workaround for buggy Cornell lossless compressed images with
+   *    Huffman table overflow
    *  @param pForceSingleFragmentPerFrame while decompressing a multiframe image,
    *    assume one fragment per frame even if the JPEG data for some frame is incomplete
    *  @param pOptimizeHuffman perform huffman table optimization for 8 bits/pixel compression?
@@ -73,6 +75,7 @@ public:
     E_UIDCreation pCreateSOPInstanceUID,
     E_PlanarConfiguration pPlanarConfiguration,
     OFBool predictor6WorkaroundEnable = OFFalse,
+    OFBool cornellWorkaroundEnable = OFFalse,
     OFBool pForceSingleFragmentPerFrame = OFFalse,
     OFBool pOptimizeHuffman = OFFalse,
     int pSmoothingFactor = 0,
@@ -304,6 +307,14 @@ public:
     return predictor6WorkaroundEnabled_;
   }
 
+  /** returns flag indicating whether the workaround for buggy Cornell JPEG lossless images with Huffman table overflow is enabled
+   *  @return flag indicating whether the workaround for buggy Cornell JPEG lossless images with Huffman table overflow is enabled
+   */
+  OFBool cornellWorkaroundEnabled() const
+  {
+    return cornellWorkaroundEnabled_;
+  }
+
   /** returns flag indicating whether one fragment per frame should be enforced while decoding
    *  @return flag indicating whether one fragment per frame should be enforced while decoding
    */
@@ -408,6 +419,9 @@ private:
   /// flag indicating that the workaround for buggy JPEG lossless images with incorrect predictor 6 is enabled
   OFBool predictor6WorkaroundEnabled_;
 
+  /// flag indicating that the workaround for buggy Cornell JPEG lossless images with huffman table overflow is enabled
+  OFBool cornellWorkaroundEnabled_;
+
   /** flag indicating that while decompressing a multiframe image one fragment per frame
    *  should be assumed even if the JPEG data for some frame is incomplete
    */
index 11abc6d6d1342a1c0615673937114508554a8959..d2d5c791c49d23f7f7ef3be75a2971a0ac62799c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -48,6 +48,8 @@ public:
    *    of color images should be encoded upon decompression.
    *  @param predictor6WorkaroundEnable enable workaround for buggy lossless compressed images with
    *           overflow in predictor 6 for images with 16 bits/pixel
+   *  @param cornellWorkaroundEnable enable workaround for buggy Cornell lossless compressed images with
+   *    Huffman table overflow
    *  @param pForceSingleFragmentPerFrame while decompressing a multiframe image,
    *    assume one fragment per frame even if the JPEG data for some frame is incomplete
    */
@@ -56,6 +58,7 @@ public:
     E_UIDCreation pCreateSOPInstanceUID = EUC_default,
     E_PlanarConfiguration pPlanarConfiguration = EPC_default,
     OFBool predictor6WorkaroundEnable = OFFalse,
+    OFBool cornellWorkaroundEnable = OFFalse,
     OFBool pForceSingleFragmentPerFrame = OFFalse);
 
   /** deregisters decoders.
index 207b79643fa31ed59510a6a4fb59ff0e094b9697..27d2371dc7ed46cf088b54e4a9d521e74e83589f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2011, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -51,9 +51,9 @@ public:
    *  @param pForcedBitDepth forced bit depth for image compression, 0 (auto) or 8/12/16
    *  @param pFragmentSize maximum fragment size (in kbytes) for compression, 0 for unlimited.
    *  @param pCreateOffsetTable create offset table during image compression?
-   *  @param pSampleFactors subsampling mode for color image compression
+   *  @param pSampleFactors subsampling mode for lossy YCbCr color image compression
    *  @param pWriteYBR422 flag indicating whether a compressed YBR color stream should
-   *    be marked as YBR_FULL or YBR_FULL_422 on DICOM level
+   *    be marked as YBR_FULL_422 (if true) or YBR_FULL (if false) on DICOM level
    *  @param pConvertToSC flag indicating whether image should be converted to
    *    Secondary Capture upon compression
    *  @param pWindowType mode for VOI transformation of monochrome images
@@ -79,8 +79,8 @@ public:
     int pForcedBitDepth = 0,
     Uint32 pFragmentSize = 0,
     OFBool pCreateOffsetTable = OFTrue,
-    E_SubSampling pSampleFactors = ESS_444,
-    OFBool pWriteYBR422 = OFFalse,
+    E_SubSampling pSampleFactors = ESS_422,
+    OFBool pWriteYBR422 = OFTrue,
     OFBool pConvertToSC = OFFalse,
     unsigned long pWindowType = 0,
     unsigned long pWindowParameter = 0,
index 1275dd7b86b9b77b5106885f05fffd7c7268b62d..0a2426eb523690a75fb5fb493b05c0712b888241 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -44,7 +44,7 @@ extern DCMTK_DCMJPEG_EXPORT OFLogger DCM_dcmjpegLogger;
 // include this file in doxygen documentation
 
 /** @file djutils.h
- *  @brief enumerations, error constants and helper functions for the dcmjpeg module
+ *  @brief type definitions and constants for the dcmjpeg module
  */
 
 
@@ -196,6 +196,8 @@ extern DCMTK_DCMJPEG_EXPORT const OFConditionConst EJ_IJG16_FrameBufferTooSmall;
 extern DCMTK_DCMJPEG_EXPORT const OFConditionConst EJ_UnsupportedPhotometricInterpretation;
 /// Codec does not support this kind of color conversion
 extern DCMTK_DCMJPEG_EXPORT const OFConditionConst EJ_UnsupportedColorConversion;
+/// Codec does not support this kind of bit depth
+extern DCMTK_DCMJPEG_EXPORT const OFConditionConst EJ_UnsupportedBitDepth;
 
 // reserved condition codes for IJG error messages
 const unsigned short EJCode_IJG8_Compression    = 0x0100;
index e7a798c01d6380f9a4a46379186f582c4a7ad4ef..5e467eceae1241f460faeef4278092bc95334c2f 100644 (file)
@@ -130,7 +130,7 @@ METHODDEF(void) start_pass
 
 METHODDEF(void)
 jpeg_difference1(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_1D(INITIAL_PREDICTOR2);
@@ -139,7 +139,7 @@ jpeg_difference1(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference2(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_2D(PREDICTOR2);
@@ -149,7 +149,7 @@ jpeg_difference2(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference3(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_2D(PREDICTOR3);
@@ -159,7 +159,7 @@ jpeg_difference3(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference4(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_2D(PREDICTOR4);
@@ -169,7 +169,7 @@ jpeg_difference4(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference5(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -180,7 +180,7 @@ jpeg_difference5(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference6(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -191,7 +191,7 @@ jpeg_difference6(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference7(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -210,7 +210,7 @@ jpeg_difference7(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference_first_row(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_1D(INITIAL_PREDICTORx);
index 6ba9927c450a9a3d6b2cac0596f5d0e3e7ded3c4..44456e0e107aec6d918b405cfd9454538687f082 100644 (file)
@@ -18,7 +18,7 @@
 
 METHODDEF(void)
 simple_downscale(j_compress_ptr cinfo,
-                JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width)
+                const JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width)
 {
   /* j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; */
   unsigned int xindex;
index 61d6de359f46544a352d8d6c97aa9d050024be97..14bf7dba0c18bbf93b58aff03a24536b5df96501 100644 (file)
@@ -254,7 +254,7 @@ flush_bits (working_state * state)
 /* Encode a single block's worth of coefficients */
 
 LOCAL(boolean)
-encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
+encode_one_block (working_state * state, const JCOEFPTR block, int last_dc_val,
                  c_derived_tbl *dctbl, c_derived_tbl *actbl)
 {
   register int temp, temp2;
@@ -475,7 +475,7 @@ finish_pass_huff (j_compress_ptr cinfo)
 /* Process a single block's worth of coefficients */
 
 LOCAL(void)
-htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
+htest_one_block (j_compress_ptr cinfo, const JCOEFPTR block, int last_dc_val,
                 long dc_counts[], long ac_counts[])
 {
   register int temp;
index 0739983e5e4e8a22d83697d9db43e1274e0db458..4eb9b0aa793f800e739706f783c0c7ae2e721b37 100644 (file)
@@ -115,7 +115,7 @@ EXTERN(void) jpeg_idct_2x2
         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
 EXTERN(void) jpeg_idct_1x1
     JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
-        JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+        const JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
 
 
 /*
index 3045f5f1c2edfb7432581e220da3715af1da98aa..355835c7f7d196a595f6b0674a6a64485c475df1 100644 (file)
@@ -583,7 +583,7 @@ get_dri (j_decompress_ptr cinfo)
 
 
 LOCAL(void)
-examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
+examine_app0 (j_decompress_ptr cinfo, const JOCTET FAR * data,
           unsigned int datalen, IJG_INT32 remaining)
 /* Examine first few bytes from an APP0.
  * Take appropriate action if it is a JFIF marker.
@@ -659,7 +659,7 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
 
 
 LOCAL(void)
-examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
+examine_app14 (j_decompress_ptr cinfo, const JOCTET FAR * data,
            unsigned int datalen, IJG_INT32 remaining)
 /* Examine first few bytes from an APP14.
  * Take appropriate action if it is an Adobe marker.
index 066d5d538460816c23a4409e951824d121378239..7aa46a3534f0a3ef3b8927b6b24b47049ef3ec7e 100644 (file)
@@ -98,7 +98,7 @@
 
 METHODDEF(void)
 jpeg_undifference1(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_1D(INITIAL_PREDICTOR2);
@@ -106,7 +106,7 @@ jpeg_undifference1(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference2(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_2D(PREDICTOR2);
@@ -116,7 +116,7 @@ jpeg_undifference2(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference3(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_2D(PREDICTOR3);
@@ -126,7 +126,7 @@ jpeg_undifference3(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference4(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_2D(PREDICTOR4);
@@ -136,7 +136,7 @@ jpeg_undifference4(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference5(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -147,7 +147,7 @@ jpeg_undifference5(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference6(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -158,7 +158,7 @@ jpeg_undifference6(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference7(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -177,7 +177,7 @@ jpeg_undifference7(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference_first_row(j_decompress_ptr cinfo, int comp_index,
-                JDIFFROW diff_buf, JDIFFROW prev_row,
+                const JDIFFROW diff_buf, JDIFFROW prev_row,
                 JDIFFROW undiff_buf, JDIMENSION width)
 {
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
index 2ca6f9426d4933e713ef880175a9180b0cc0f29a..0c9d5a2db8b7a902f62fcc759520a58e994305fe 100644 (file)
@@ -35,7 +35,7 @@ typedef scaler * scaler_ptr;
 
 METHODDEF(void)
 simple_upscale(j_decompress_ptr cinfo,
-              JDIFFROW diff_buf, JSAMPROW output_buf,
+              const JDIFFROW diff_buf, JSAMPROW output_buf,
               JDIMENSION width)
 {
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
@@ -49,7 +49,7 @@ simple_upscale(j_decompress_ptr cinfo,
 
 METHODDEF(void)
 simple_downscale(j_decompress_ptr cinfo,
-                JDIFFROW diff_buf, JSAMPROW output_buf,
+                const JDIFFROW diff_buf, JSAMPROW output_buf,
                 JDIMENSION width)
 {
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
@@ -64,7 +64,7 @@ simple_downscale(j_decompress_ptr cinfo,
 
 METHODDEF(void)
 noscale(j_decompress_ptr cinfo,
-       JDIFFROW diff_buf, JSAMPROW output_buf,
+       const JDIFFROW diff_buf, JSAMPROW output_buf,
        JDIMENSION width)
 {
   unsigned int xindex;
index 527f17155cd46d9134ec223b7f0efdddc169fe10..03898b0cc9746fc8995372e47769a60dadc58d0b 100644 (file)
@@ -377,7 +377,7 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
 
 GLOBAL(void)
 jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
-              JCOEFPTR coef_block,
+              const JCOEFPTR coef_block,
               JSAMPARRAY output_buf, JDIMENSION output_col)
 {
   int dcval;
index 7f8c8b523a50677dd2f69e1063da6fe429d87786..761f518f4831f8eff317fa846132b5ee985c7519 100644 (file)
@@ -773,7 +773,7 @@ find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
 
 LOCAL(void)
 find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
-          int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])
+          int numcolors, const JSAMPLE colorlist[], JSAMPLE bestcolor[])
 /* Find the closest colormap entry for each cell in the update box,
  * given the list of candidate colors prepared by find_nearby_colors.
  * Return the indexes of the closest entries in the bestcolor[] array.
index 286959d46e7e138a2b680516330c7b10608fd38e..06b54e40c65d3461d84332ce2d92bf960e01e796 100644 (file)
@@ -14,8 +14,8 @@ jccoefct.o: jccoefct.c jinclude16.h jconfig16.h \
  ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h \
  jlossy16.h
-jccolor.o: jccolor.c jinclude16.h jconfig16.h \
../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \
+jccolor.o: jccolor.c ../../config/include/dcmtk/config/osconfig.h \
jinclude16.h jconfig16.h jpeglib16.h jmorecfg16.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h
 jcdctmgr.o: jcdctmgr.c jinclude16.h jconfig16.h \
  ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \
@@ -148,8 +148,8 @@ jdmarker.o: jdmarker.c jinclude16.h jconfig16.h \
 jdmaster.o: jdmaster.c jinclude16.h jconfig16.h \
  ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h
-jdmerge.o: jdmerge.c jinclude16.h jconfig16.h \
../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \
+jdmerge.o: jdmerge.c ../../config/include/dcmtk/config/osconfig.h \
jinclude16.h jconfig16.h jpeglib16.h jmorecfg16.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h jpegint16.h jerror16.h
 jdphuff.o: jdphuff.c jinclude16.h jconfig16.h \
  ../../config/include/dcmtk/config/osconfig.h jpeglib16.h jmorecfg16.h \
index 55e484c8d57021a8824f02bbdbfa529745c95c6f..6b5ad733da08c006f3df458e3179581f34d1bbaf 100644 (file)
@@ -9,9 +9,23 @@
  */
 
 #define JPEG_INTERNALS
+#include "dcmtk/config/osconfig.h"
 #include "jinclude16.h"
 #include "jpeglib16.h"
 
+/* check if we have a 64-bit integer type */
+#if SIZEOF_LONG == 8
+typedef long jccolor_sint64;
+#elif defined(_WIN32)
+typedef __int64 jccolor_sint64;
+#elif defined(HAVE_LONG_LONG)
+typedef long long jccolor_sint64;
+#elif defined (HAVE_LONGLONG)
+typedef longlong jccolor_sint64;
+#else
+#define JCCOLOR_NO_SINT64
+#endif
+
 
 /* Private subobject */
 
@@ -115,7 +129,11 @@ rgb_ycc_start (j_compress_ptr cinfo)
      * This ensures that the maximum output will round to MAXJSAMPLE
      * not MAXJSAMPLE+1, and thus that we don't have to range-limit.
      */
+#ifdef JCCOLOR_NO_SINT64
     rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
+#else
+    rgb_ycc_tab[i+B_CB_OFF] = (IJG_INT32) ((jccolor_sint64) FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1);
+#endif
 /*  B=>Cb and R=>Cr tables are the same
     rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
 */
index 192e3e8a687bd9ac98d5339b83b7bcf86394b62e..3778db94a0ba60c819ef4a218f84a748342f3de5 100644 (file)
@@ -130,7 +130,7 @@ METHODDEF(void) start_pass
 
 METHODDEF(void)
 jpeg_difference1(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_1D(INITIAL_PREDICTOR2);
@@ -139,7 +139,7 @@ jpeg_difference1(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference2(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_2D(PREDICTOR2);
@@ -149,7 +149,7 @@ jpeg_difference2(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference3(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_2D(PREDICTOR3);
@@ -159,7 +159,7 @@ jpeg_difference3(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference4(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_2D(PREDICTOR4);
@@ -169,7 +169,7 @@ jpeg_difference4(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference5(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -180,7 +180,7 @@ jpeg_difference5(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference6(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -191,7 +191,7 @@ jpeg_difference6(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference7(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -210,7 +210,7 @@ jpeg_difference7(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference_first_row(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_1D(INITIAL_PREDICTORx);
index dc2ed92efb3ac50ffe4e0f0170e6b5e1ebb3464d..e2547ef80d68ebde8e96377b95bc80964040dbc8 100644 (file)
@@ -18,7 +18,7 @@
 
 METHODDEF(void)
 simple_downscale(j_compress_ptr cinfo,
-                JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width)
+                const JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width)
 {
   /* j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; */
   unsigned int xindex;
index 2ba6d86edfbba336403a886730163364a231c4a0..a948c37ea922b418dd8584aee1490b23933699e1 100644 (file)
@@ -254,7 +254,7 @@ flush_bits (working_state * state)
 /* Encode a single block's worth of coefficients */
 
 LOCAL(boolean)
-encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
+encode_one_block (working_state * state, const JCOEFPTR block, int last_dc_val,
                  c_derived_tbl *dctbl, c_derived_tbl *actbl)
 {
   register int temp, temp2;
@@ -475,7 +475,7 @@ finish_pass_huff (j_compress_ptr cinfo)
 /* Process a single block's worth of coefficients */
 
 LOCAL(void)
-htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
+htest_one_block (j_compress_ptr cinfo, const JCOEFPTR block, int last_dc_val,
                 long dc_counts[], long ac_counts[])
 {
   register int temp;
index 792ab15399529b36a3a80d1db451176e8b8a304b..447f331a2bc8098a6ae482549fd99e471d93920d 100644 (file)
@@ -115,7 +115,7 @@ EXTERN(void) jpeg_idct_2x2
         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
 EXTERN(void) jpeg_idct_1x1
     JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
-        JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+        const JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
 
 
 /*
index f7194ba88462b6cf4c3364d11fb95e8f06eee47c..f83bacafa81a5dfd640f7f45e4a30fe9b7f44d23 100644 (file)
@@ -16,7 +16,6 @@
 #include "jlossls16.h"      /* Private declarations for lossless codec */
 #include "jdhuff16.h"       /* Declarations shared with jd*huff.c */
 
-
 /*
  * Compute the derived values for a Huffman table.
  * This routine also performs some validation checks on the table.
@@ -280,7 +279,7 @@ jpeg_fill_bit_buffer (bitread_working_state * state,
 GLOBAL(int)
 jpeg_huff_decode (bitread_working_state * state,
           register bit_buf_type get_buffer, register int bits_left,
-          d_derived_tbl * htbl, int min_bits)
+          d_derived_tbl * htbl, int min_bits, boolean enable_cornell_workaround)
 {
   register int l = min_bits;
   register IJG_INT32 code;
@@ -309,7 +308,17 @@ jpeg_huff_decode (bitread_working_state * state,
 
   if (l > 16) {
     WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);
-    return 0;           /* fake a zero as the safest result */
+    if (enable_cornell_workaround)
+    {
+        if (l == 17)
+          return 17;        /* this is the result of the buggy Cornell encoder */
+        else
+          return 0;         /* fake a zero as the safest result */
+    }
+    else
+    {
+        return 0;           /* fake a zero as the safest result */
+    }
   }
 
   return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];
index 79cb24db9567666226a2c784112f2d29e5cf1afd..ad63671eac45d40dd8cf9cf2f4ccb251c0012ef8 100644 (file)
 /* Short forms of external names for systems with brain-damaged linkers. */
 
 #ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jpeg_make_d_derived_tbl                jpeg16_make_d_derived_tbl
-#define jpeg_fill_bit_buffer           jpeg16_fill_bit_buffer
-#define jpeg_huff_decode               jpeg16_huff_decode
+#define jpeg_make_d_derived_tbl     jpeg16_make_d_derived_tbl
+#define jpeg_fill_bit_buffer        jpeg16_fill_bit_buffer
+#define jpeg_huff_decode        jpeg16_huff_decode
 #endif /* NEED_SHORT_EXTERNAL_NAMES */
 
 
 /* Derived data constructed for each Huffman table */
 
-#define HUFF_LOOKAHEAD 8       /* # of bits of lookahead */
+#define HUFF_LOOKAHEAD  8   /* # of bits of lookahead */
 
 typedef struct {
   /* Basic tables: (element [0] of each array is unused) */
-  IJG_INT32 maxcode[18];               /* largest code of length k (-1 if none) */
+  IJG_INT32 maxcode[18];        /* largest code of length k (-1 if none) */
   /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */
-  IJG_INT32 valoffset[17];             /* huffval[] offset for codes of length k */
+  IJG_INT32 valoffset[17];      /* huffval[] offset for codes of length k */
   /* valoffset[k] = huffval[] index of 1st symbol of code length k, less
    * the smallest code of length k; so given a code of length k, the
    * corresponding symbol is huffval[code + valoffset[k]]
@@ -48,8 +48,8 @@ typedef struct {
 
 /* Expand a Huffman table definition into the derived format */
 EXTERN(void) jpeg_make_d_derived_tbl
-       JPP((j_decompress_ptr cinfo, boolean isDC, int tblno,
-            d_derived_tbl ** pdtbl));
+    JPP((j_decompress_ptr cinfo, boolean isDC, int tblno,
+         d_derived_tbl ** pdtbl));
 
 
 /*
@@ -70,8 +70,8 @@ EXTERN(void) jpeg_make_d_derived_tbl
  * necessary.
  */
 
-typedef IJG_INT32 bit_buf_type;        /* type of bit-extraction buffer */
-#define BIT_BUF_SIZE  32       /* size of buffer in bits */
+typedef IJG_INT32 bit_buf_type; /* type of bit-extraction buffer */
+#define BIT_BUF_SIZE  32    /* size of buffer in bits */
 
 /* If long is > 32 bits on your machine, and shifting/masking longs is
  * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE
@@ -80,43 +80,43 @@ typedef IJG_INT32 bit_buf_type;     /* type of bit-extraction buffer */
  * because not all machines measure sizeof in 8-bit bytes.
  */
 
-typedef struct {               /* Bitreading state saved across MCUs */
-  bit_buf_type get_buffer;     /* current bit-extraction buffer */
-  int bits_left;               /* # of unused bits in it */
+typedef struct {        /* Bitreading state saved across MCUs */
+  bit_buf_type get_buffer;  /* current bit-extraction buffer */
+  int bits_left;        /* # of unused bits in it */
 } bitread_perm_state;
 
-typedef struct {               /* Bitreading working state within an MCU */
+typedef struct {        /* Bitreading working state within an MCU */
   /* Current data source location */
   /* We need a copy, rather than munging the original, in case of suspension */
   const JOCTET * next_input_byte; /* => next byte to read from source */
-  size_t bytes_in_buffer;      /* # of bytes remaining in source buffer */
+  size_t bytes_in_buffer;   /* # of bytes remaining in source buffer */
   /* Bit input buffer --- note these values are kept in register variables,
    * not in this struct, inside the inner loops.
    */
-  bit_buf_type get_buffer;     /* current bit-extraction buffer */
-  int bits_left;               /* # of unused bits in it */
+  bit_buf_type get_buffer;  /* current bit-extraction buffer */
+  int bits_left;        /* # of unused bits in it */
   /* Pointer needed by jpeg_fill_bit_buffer. */
-  j_decompress_ptr cinfo;      /* back link to decompress master record */
+  j_decompress_ptr cinfo;   /* back link to decompress master record */
 } bitread_working_state;
 
 /* Macros to declare and load/save bitread local variables. */
 #define BITREAD_STATE_VARS  \
-       register bit_buf_type get_buffer;  \
-       register int bits_left;  \
-       bitread_working_state br_state
+    register bit_buf_type get_buffer;  \
+    register int bits_left;  \
+    bitread_working_state br_state
 
 #define BITREAD_LOAD_STATE(cinfop,permstate)  \
-       br_state.cinfo = cinfop; \
-       br_state.next_input_byte = cinfop->src->next_input_byte; \
-       br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
-       get_buffer = permstate.get_buffer; \
-       bits_left = permstate.bits_left;
+    br_state.cinfo = cinfop; \
+    br_state.next_input_byte = cinfop->src->next_input_byte; \
+    br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
+    get_buffer = permstate.get_buffer; \
+    bits_left = permstate.bits_left;
 
 #define BITREAD_SAVE_STATE(cinfop,permstate)  \
-       cinfop->src->next_input_byte = br_state.next_input_byte; \
-       cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
-       permstate.get_buffer = get_buffer; \
-       permstate.bits_left = bits_left
+    cinfop->src->next_input_byte = br_state.next_input_byte; \
+    cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
+    permstate.get_buffer = get_buffer; \
+    permstate.bits_left = bits_left
 
 /*
  * These macros provide the in-line portion of bit fetching.
@@ -124,37 +124,37 @@ typedef struct {          /* Bitreading working state within an MCU */
  * before using GET_BITS, PEEK_BITS, or DROP_BITS.
  * The variables get_buffer and bits_left are assumed to be locals,
  * but the state struct might not be (jpeg_huff_decode needs this).
- *     CHECK_BIT_BUFFER(state,n,action);
- *             Ensure there are N bits in get_buffer; if suspend, take action.
+ *  CHECK_BIT_BUFFER(state,n,action);
+ *      Ensure there are N bits in get_buffer; if suspend, take action.
  *      val = GET_BITS(n);
- *             Fetch next N bits.
+ *      Fetch next N bits.
  *      val = PEEK_BITS(n);
- *             Fetch next N bits without removing them from the buffer.
- *     DROP_BITS(n);
- *             Discard next N bits.
+ *      Fetch next N bits without removing them from the buffer.
+ *  DROP_BITS(n);
+ *      Discard next N bits.
  * The value N should be a simple variable, not an expression, because it
  * is evaluated multiple times.
  */
 
 #define CHECK_BIT_BUFFER(state,nbits,action) \
-       { if (bits_left < (nbits)) {  \
-           if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits))  \
-             { action; }  \
-           get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }
+    { if (bits_left < (nbits)) {  \
+        if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits))  \
+          { action; }  \
+        get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }
 
 #define GET_BITS(nbits) \
-       (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1))
+    (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1))
 
 #define PEEK_BITS(nbits) \
-       (((int) (get_buffer >> (bits_left -  (nbits)))) & ((1<<(nbits))-1))
+    (((int) (get_buffer >> (bits_left -  (nbits)))) & ((1<<(nbits))-1))
 
 #define DROP_BITS(nbits) \
-       (bits_left -= (nbits))
+    (bits_left -= (nbits))
 
 /* Load up the bit buffer to a depth of at least nbits */
 EXTERN(boolean) jpeg_fill_bit_buffer
-       JPP((bitread_working_state * state, register bit_buf_type get_buffer,
-            register int bits_left, int nbits));
+    JPP((bitread_working_state * state, register bit_buf_type get_buffer,
+         register int bits_left, int nbits));
 
 
 /*
@@ -174,7 +174,7 @@ EXTERN(boolean) jpeg_fill_bit_buffer
  * 3. jpeg_huff_decode returns -1 if forced to suspend.
  */
 
-#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \
+#define HUFF_DECODE(result,state,htbl,failaction,slowlabel,cornell_workaround) \
 { register int nb, look; \
   if (bits_left < HUFF_LOOKAHEAD) { \
     if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \
@@ -190,16 +190,16 @@ EXTERN(boolean) jpeg_fill_bit_buffer
   } else { \
     nb = HUFF_LOOKAHEAD+1; \
 slowlabel: \
-    if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \
-       { failaction; } \
+    if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb,cornell_workaround)) < 0) \
+    { failaction; } \
     get_buffer = state.get_buffer; bits_left = state.bits_left; \
   } \
 }
 
 /* Out-of-line case for Huffman code fetching */
 EXTERN(int) jpeg_huff_decode
-       JPP((bitread_working_state * state, register bit_buf_type get_buffer,
-            register int bits_left, d_derived_tbl * htbl, int min_bits));
+    JPP((bitread_working_state * state, register bit_buf_type get_buffer,
+         register int bits_left, d_derived_tbl * htbl, int min_bits, boolean enable_cornell_workaround));
 
 
 /* Common fields between sequential, progressive and lossless Huffman entropy
@@ -207,11 +207,11 @@ EXTERN(int) jpeg_huff_decode
  */
 
 #define huffd_common_fields \
-  boolean insufficient_data;   /* set TRUE after emmitting warning */ \
+  boolean insufficient_data;    /* set TRUE after emmitting warning */ \
   /* These fields are loaded into local variables at start of each MCU. \
    * In case of suspension, we exit WITHOUT updating them. \
    */ \
-  bitread_perm_state bitstate  /* Bit buffer at start of MCU */
+  bitread_perm_state bitstate   /* Bit buffer at start of MCU */
 
 /* Routines that are to be used by any or all of the entropy decoders are
  * declared to receive a pointer to this structure.  There are no actual
@@ -219,7 +219,7 @@ EXTERN(int) jpeg_huff_decode
  * phuff_entropy_decoder and lhuff_entropy_decoder.
  */
 struct huffd_common_struct {
-  huffd_common_fields;         /* Fields common to all decoder struct types */
+  huffd_common_fields;      /* Fields common to all decoder struct types */
   /* Additional fields follow in an actual shuff_entropy_decoder,
    * phuff_entropy_decoder or lhuff_entropy_decoder struct.  All four structs
    * must agree on these initial fields!  (This would be a lot cleaner in C++.)
index 34d18aa1218e99a90134585cb5d4849ab9fa19ba..b9cfb434f0ac19421bd4987085f366889e40a339 100644 (file)
@@ -20,7 +20,6 @@
 #include "jlossls16.h"      /* Private declarations for lossless codec */
 #include "jdhuff16.h"       /* Declarations shared with jd*huff.c */
 
-
 #ifdef D_LOSSLESS_SUPPORTED
 
 typedef struct {
@@ -129,20 +128,26 @@ start_pass_lhuff_decoder (j_decompress_ptr cinfo)
 
 #define HUFF_EXTEND(x,s)  ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
 
-static const int extend_test[16] =   /* entry n is 2**(n-1) */
+/* We should only need 16 entries in this array, the 17th one is for
+ * invalid Cornell images with the Huffman table overflow bug
+ */
+static const int extend_test[17] =   /* entry n is 2**(n-1) */
   { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
-    0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
+    0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000 };
 
 /*
  * Originally, a -1 was shifted but since shifting a negative value is
  * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used,
  * shifted and casted to an int. The result is the same, of course.
+ *
+ * We should only need 16 entries in this array, the 17th one is for
+ * invalid Cornell images with the Huffman table overflow bug
  */
-static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
+static const int extend_offset[17] = /* entry n is (-1 << n) + 1 */
   { 0, (int)((~0U)<<1) + 1, (int)((~0U)<<2) + 1, (int)((~0U)<<3) + 1, (int)((~0U)<<4) + 1,
     (int)((~0U)<<5) + 1, (int)((~0U)<<6) + 1, (int)((~0U)<<7) + 1, (int)((~0U)<<8) + 1,
     (int)((~0U)<<9) + 1, (int)((~0U)<<10) + 1, (int)((~0U)<<11) + 1, (int)((~0U)<<12) + 1,
-    (int)((~0U)<<13) + 1, (int)((~0U)<<14) + 1, (int)((~0U)<<15) + 1 };
+    (int)((~0U)<<13) + 1, (int)((~0U)<<14) + 1, (int)((~0U)<<15) + 1, (int)((~0U)<<16) + 1 };
 
 #endif /* AVOID_TABLES */
 
@@ -204,6 +209,7 @@ decode_mcus (j_decompress_ptr cinfo, JDIFFIMAGE diff_buf,
   unsigned int mcu_num;
   int sampn, ci, yoffset, MCU_width, ptrn;
   BITREAD_STATE_VARS;
+  boolean cornell_workaround = (cinfo->workaround_options & WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER) != 0;
 
   /* Set output pointer locations based on MCU_col_num */
   for (ptrn = 0; ptrn < entropy->num_output_ptrs; ptrn++) {
@@ -244,14 +250,38 @@ decode_mcus (j_decompress_ptr cinfo, JDIFFIMAGE diff_buf,
     register int s, r;
 
     /* Section H.2.2: decode the sample difference */
-    HUFF_DECODE(s, br_state, dctbl, return mcu_num, label1);
+    HUFF_DECODE(s, br_state, dctbl, return mcu_num, label1, cornell_workaround);
     if (s) {
-      if (s == 16)  /* special case: always output 32768 */
-        s = 32768;
-      else {    /* normal case: fetch subsequent bits */
-        CHECK_BIT_BUFFER(br_state, s, return mcu_num);
-        r = GET_BITS(s);
-        s = HUFF_EXTEND(r, s);
+      if (cornell_workaround)
+      {
+          if ((s == 16) && (bits_left < 16)) { /* standard case: always output 32768 */
+            s = 32768;
+          }
+          else if (s >= 16) { /* there are enough bits available, so check ... */
+            r = PEEK_BITS(16);
+            s = HUFF_EXTEND(r, 16);
+            if ((s & 0xffff) == 0x8000) { /* special case: handle buggy Cornell encoder */
+              DROP_BITS(16);
+            } else {  /* standard case: always output 32768 */
+              if (s == 0x7fff)
+                DROP_BITS(16);
+              s = 32768;
+            }
+          } else {    /* normal case: fetch subsequent bits */
+            CHECK_BIT_BUFFER(br_state, s, return mcu_num);
+            r = GET_BITS(s);
+            s = HUFF_EXTEND(r, s);
+          }
+      }
+      else
+      {
+          if (s == 16)  /* special case: always output 32768 */
+            s = 32768;
+          else {    /* normal case: fetch subsequent bits */
+            CHECK_BIT_BUFFER(br_state, s, return mcu_num);
+            r = GET_BITS(s);
+            s = HUFF_EXTEND(r, s);
+          }
       }
     }
 
index 6daa28a2ddcd27642bbc3b4a37eb01cdd4be3b30..f2b6188e84f9f085d9a34c68c618d613d97d1780 100644 (file)
@@ -583,7 +583,7 @@ get_dri (j_decompress_ptr cinfo)
 
 
 LOCAL(void)
-examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
+examine_app0 (j_decompress_ptr cinfo, const JOCTET FAR * data,
           unsigned int datalen, IJG_INT32 remaining)
 /* Examine first few bytes from an APP0.
  * Take appropriate action if it is a JFIF marker.
@@ -659,7 +659,7 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
 
 
 LOCAL(void)
-examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
+examine_app14 (j_decompress_ptr cinfo, const JOCTET FAR * data,
            unsigned int datalen, IJG_INT32 remaining)
 /* Examine first few bytes from an APP14.
  * Take appropriate action if it is an Adobe marker.
index cdf87b2bc32fef70d40bcc323949e63d7378594d..84875e7c49569a26385a0066fa4cbac496e52cc3 100644 (file)
  */
 
 #define JPEG_INTERNALS
+#include "dcmtk/config/osconfig.h"
 #include "jinclude16.h"
 #include "jpeglib16.h"
 
+/* check if we have a 64-bit integer type */
+#if SIZEOF_LONG == 8
+typedef long jdmerge_sint64;
+#elif defined(_WIN32)
+typedef __int64 jdmerge_sint64;
+#elif defined(HAVE_LONG_LONG)
+typedef long long jdmerge_sint64;
+#elif defined (HAVE_LONGLONG)
+typedef longlong jdmerge_sint64;
+#else
+#define JDMERGE_NO_SINT64
+#endif
+
 #ifdef UPSAMPLE_MERGING_SUPPORTED
 
 
@@ -103,12 +117,21 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
   for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
     /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
     /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
+#ifdef JDMERGE_NO_SINT64
     /* Cr=>R value is nearest int to 1.40200 * x */
     upsample->Cr_r_tab[i] = (int)
             RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
     /* Cb=>B value is nearest int to 1.77200 * x */
     upsample->Cb_b_tab[i] = (int)
             RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
+#else
+    /* Cr=>R value is nearest int to 1.40200 * x */
+    upsample->Cr_r_tab[i] = (int)
+            RIGHT_SHIFT((jdmerge_sint64) FIX(1.40200) * x + ONE_HALF, SCALEBITS);
+    /* Cb=>B value is nearest int to 1.77200 * x */
+    upsample->Cb_b_tab[i] = (int)
+            RIGHT_SHIFT((jdmerge_sint64) FIX(1.77200) * x + ONE_HALF, SCALEBITS);
+#endif
     /* Cr=>G value is scaled-up -0.71414 * x */
     upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x;
     /* Cb=>G value is scaled-up -0.34414 * x */
index f68cf51c3cf146fb8fe980c6c2e93bf1af92c431..2750a67d68149657218c1c2a31d4e5bdffe58a52 100644 (file)
@@ -302,6 +302,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
   savable_state state;
   d_derived_tbl * tbl;
   jpeg_component_info * compptr;
+  boolean cornell_workaround = (cinfo->workaround_options & WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER) != 0;
 
   /* Process restart marker if needed; may have to suspend */
   if (cinfo->restart_interval) {
@@ -330,7 +331,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
       /* Decode a single block's worth of coefficients */
 
       /* Section F.2.2.1: decode the DC coefficient difference */
-      HUFF_DECODE(s, br_state, tbl, return FALSE, label1);
+      HUFF_DECODE(s, br_state, tbl, return FALSE, label1, cornell_workaround);
       if (s) {
     CHECK_BIT_BUFFER(br_state, s, return FALSE);
     r = GET_BITS(s);
@@ -373,6 +374,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
   JBLOCKROW block;
   BITREAD_STATE_VARS;
   d_derived_tbl * tbl;
+  boolean cornell_workaround = (cinfo->workaround_options & WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER) != 0;
 
   /* Process restart marker if needed; may have to suspend */
   if (cinfo->restart_interval) {
@@ -401,7 +403,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
       tbl = entropy->ac_derived_tbl;
 
       for (k = cinfo->Ss; k <= Se; k++) {
-    HUFF_DECODE(s, br_state, tbl, return FALSE, label2);
+    HUFF_DECODE(s, br_state, tbl, return FALSE, label2, cornell_workaround);
     r = s >> 4;
     s &= 15;
     if (s) {
@@ -504,6 +506,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
   phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyd->entropy_private;
   int Se = cinfo->Se;
   int p1 = 1 << cinfo->Al;  /* 1 in the bit position being coded */
+  boolean cornell_workaround = (cinfo->workaround_options & WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER) != 0;
 
   /* Originally, a -1 was shifted but since shifting a negative value is
    * undefined behavior, now "~0U" (bit-wise NOT unsigned int 0) is used,
@@ -552,7 +555,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
 
     if (EOBRUN == 0) {
       for (; k <= Se; k++) {
-    HUFF_DECODE(s, br_state, tbl, goto undoit, label3);
+    HUFF_DECODE(s, br_state, tbl, goto undoit, label3, cornell_workaround);
     r = s >> 4;
     s &= 15;
     if (s) {
index 78c182c50fabe6b96cd6fe9e57eb6c65b25f8db4..bf7ad40050555931bffe9b3c0de329e774222946 100644 (file)
@@ -98,7 +98,7 @@
 
 METHODDEF(void)
 jpeg_undifference1(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_1D(INITIAL_PREDICTOR2);
@@ -106,7 +106,7 @@ jpeg_undifference1(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference2(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_2D(PREDICTOR2);
@@ -116,7 +116,7 @@ jpeg_undifference2(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference3(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_2D(PREDICTOR3);
@@ -126,7 +126,7 @@ jpeg_undifference3(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference4(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_2D(PREDICTOR4);
@@ -136,7 +136,7 @@ jpeg_undifference4(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference5(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -147,7 +147,7 @@ jpeg_undifference5(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference6(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -158,7 +158,7 @@ jpeg_undifference6(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference6a(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -169,7 +169,7 @@ jpeg_undifference6a(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference7(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -188,7 +188,7 @@ jpeg_undifference7(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference_first_row(j_decompress_ptr cinfo, int comp_index,
-                JDIFFROW diff_buf, JDIFFROW prev_row,
+                const JDIFFROW diff_buf, JDIFFROW prev_row,
                 JDIFFROW undiff_buf, JDIMENSION width)
 {
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
index 88e24c49a323f1c1479e1b323c78990d0277b3ad..306c40922ddf0cc1c4a1c0966d96f2c87aa600f1 100644 (file)
@@ -35,7 +35,7 @@ typedef scaler * scaler_ptr;
 
 METHODDEF(void)
 simple_upscale(j_decompress_ptr cinfo,
-              JDIFFROW diff_buf, JSAMPROW output_buf,
+              const JDIFFROW diff_buf, JSAMPROW output_buf,
               JDIMENSION width)
 {
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
@@ -49,7 +49,7 @@ simple_upscale(j_decompress_ptr cinfo,
 
 METHODDEF(void)
 simple_downscale(j_decompress_ptr cinfo,
-                JDIFFROW diff_buf, JSAMPROW output_buf,
+                const JDIFFROW diff_buf, JSAMPROW output_buf,
                 JDIMENSION width)
 {
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
@@ -64,7 +64,7 @@ simple_downscale(j_decompress_ptr cinfo,
 
 METHODDEF(void)
 noscale(j_decompress_ptr cinfo,
-       JDIFFROW diff_buf, JSAMPROW output_buf,
+       const JDIFFROW diff_buf, JSAMPROW output_buf,
        JDIMENSION width)
 {
   unsigned int xindex;
index 16b4f2e6ddd6f52e9313428a066d02fc6cd8bd10..1e0295942413edc9f9893b0f3ad3080572413887 100644 (file)
@@ -233,6 +233,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
   int blkn;
   BITREAD_STATE_VARS;
   savable_state state;
+  boolean cornell_workaround = (cinfo->workaround_options & WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER) != 0;
 
   /* Process restart marker if needed; may have to suspend */
   if (cinfo->restart_interval) {
@@ -261,7 +262,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
       /* Decode a single block's worth of coefficients */
 
       /* Section F.2.2.1: decode the DC coefficient difference */
-      HUFF_DECODE(s, br_state, dctbl, return FALSE, label1);
+      HUFF_DECODE(s, br_state, dctbl, return FALSE, label1, cornell_workaround);
       if (s) {
     CHECK_BIT_BUFFER(br_state, s, return FALSE);
     r = GET_BITS(s);
@@ -282,7 +283,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
     /* Section F.2.2.2: decode the AC coefficients */
     /* Since zeroes are skipped, output area must be cleared beforehand */
     for (k = 1; k < DCTSIZE2; k++) {
-      HUFF_DECODE(s, br_state, actbl, return FALSE, label2);
+      HUFF_DECODE(s, br_state, actbl, return FALSE, label2, cornell_workaround);
 
       r = s >> 4;
       s &= 15;
@@ -309,7 +310,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
     /* Section F.2.2.2: decode the AC coefficients */
     /* In this path we just discard the values */
     for (k = 1; k < DCTSIZE2; k++) {
-      HUFF_DECODE(s, br_state, actbl, return FALSE, label3);
+      HUFF_DECODE(s, br_state, actbl, return FALSE, label3, cornell_workaround);
 
       r = s >> 4;
       s &= 15;
index 83bf83f33d44199310996bcb2a9aea84744ce8f7..5c48a03613c2c0f3d459c71604ce90470324943d 100644 (file)
@@ -377,7 +377,7 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
 
 GLOBAL(void)
 jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
-              JCOEFPTR coef_block,
+              const JCOEFPTR coef_block,
               JSAMPARRAY output_buf, JDIMENSION output_col)
 {
   int dcval;
index 3ebb55ae740ddef9701f9a27182aa72158859c50..1fcc033a3ed1b8f4e6dee3f313616cd491a219f4 100644 (file)
@@ -658,6 +658,7 @@ struct jpeg_decompress_struct {
 
 /* constants for workaround_options in struct jpeg_decompress_struct */
 #define WORKAROUND_PREDICTOR6OVERFLOW 1
+#define WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER 2
 
 /* "Object" declarations for JPEG modules that may be supplied or called
  * directly by the surrounding application.
index 5453e15af06ccae5d6f9d8c13bb476bf7c829a39..f62a992c734764e3ee7a1db3d0bb4770ca518b64 100644 (file)
@@ -773,7 +773,7 @@ find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
 
 LOCAL(void)
 find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
-          int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])
+          int numcolors, const JSAMPLE colorlist[], JSAMPLE bestcolor[])
 /* Find the closest colormap entry for each cell in the update box,
  * given the list of candidate colors prepared by find_nearby_colors.
  * Return the indexes of the closest entries in the bestcolor[] array.
index 503058abcb5013f252130d20e2d4f0b43334aa98..030e10c5bc0201f4bafecac18d3bc5956883b629 100644 (file)
@@ -130,7 +130,7 @@ METHODDEF(void) start_pass
 
 METHODDEF(void)
 jpeg_difference1(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_1D(INITIAL_PREDICTOR2);
@@ -139,7 +139,7 @@ jpeg_difference1(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference2(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_2D(PREDICTOR2);
@@ -149,7 +149,7 @@ jpeg_difference2(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference3(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_2D(PREDICTOR3);
@@ -159,7 +159,7 @@ jpeg_difference3(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference4(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_2D(PREDICTOR4);
@@ -169,7 +169,7 @@ jpeg_difference4(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference5(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -180,7 +180,7 @@ jpeg_difference5(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference6(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -191,7 +191,7 @@ jpeg_difference6(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference7(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, const JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -210,7 +210,7 @@ jpeg_difference7(j_compress_ptr cinfo, int ci,
 
 METHODDEF(void)
 jpeg_difference_first_row(j_compress_ptr cinfo, int ci,
-         JSAMPROW input_buf, JSAMPROW prev_row,
+         const JSAMPROW input_buf, JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
   DIFFERENCE_1D(INITIAL_PREDICTORx);
index 620ac3cf97dab68e478039ea83e26b32ebea5a2e..62dc88ed0e796ab89b94f387cd4439bf8cf81e82 100644 (file)
@@ -18,7 +18,7 @@
 
 METHODDEF(void)
 simple_downscale(j_compress_ptr cinfo,
-                JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width)
+                const JSAMPROW input_buf, JSAMPROW output_buf, JDIMENSION width)
 {
   /* j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec; */
   unsigned int xindex;
index 0a55ced8270fa9afd6def90847b68d45fec8ee37..b933f4550cb7a5c72417e0591496dc3ade035a93 100644 (file)
@@ -254,7 +254,7 @@ flush_bits (working_state * state)
 /* Encode a single block's worth of coefficients */
 
 LOCAL(boolean)
-encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
+encode_one_block (working_state * state, const JCOEFPTR block, int last_dc_val,
                  c_derived_tbl *dctbl, c_derived_tbl *actbl)
 {
   register int temp, temp2;
@@ -475,7 +475,7 @@ finish_pass_huff (j_compress_ptr cinfo)
 /* Process a single block's worth of coefficients */
 
 LOCAL(void)
-htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
+htest_one_block (j_compress_ptr cinfo, const JCOEFPTR block, int last_dc_val,
                 long dc_counts[], long ac_counts[])
 {
   register int temp;
index 55ed102cf70fe68cb9b131169a51321aa51d4163..c509bfb9ace87b55c2b3ed47d71f73aa12734a69 100644 (file)
@@ -115,7 +115,7 @@ EXTERN(void) jpeg_idct_2x2
         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
 EXTERN(void) jpeg_idct_1x1
     JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
-        JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+        const JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
 
 
 /*
index 23ee2b02395bb581b97f96802598b43aea4d3ddb..22f18e567a7900b20ed86e20b19cf04193ad8667 100644 (file)
@@ -583,7 +583,7 @@ get_dri (j_decompress_ptr cinfo)
 
 
 LOCAL(void)
-examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
+examine_app0 (j_decompress_ptr cinfo, const JOCTET FAR * data,
           unsigned int datalen, IJG_INT32 remaining)
 /* Examine first few bytes from an APP0.
  * Take appropriate action if it is a JFIF marker.
@@ -659,7 +659,7 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
 
 
 LOCAL(void)
-examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
+examine_app14 (j_decompress_ptr cinfo, const JOCTET FAR * data,
            unsigned int datalen, IJG_INT32 remaining)
 /* Examine first few bytes from an APP14.
  * Take appropriate action if it is an Adobe marker.
index b815ed8034af5f13f9abc11caddf1ed89df4847c..a4f336da59cbe787283226a678a0c9d01e0e4127 100644 (file)
@@ -98,7 +98,7 @@
 
 METHODDEF(void)
 jpeg_undifference1(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_1D(INITIAL_PREDICTOR2);
@@ -106,7 +106,7 @@ jpeg_undifference1(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference2(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_2D(PREDICTOR2);
@@ -116,7 +116,7 @@ jpeg_undifference2(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference3(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_2D(PREDICTOR3);
@@ -126,7 +126,7 @@ jpeg_undifference3(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference4(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   UNDIFFERENCE_2D(PREDICTOR4);
@@ -136,7 +136,7 @@ jpeg_undifference4(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference5(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -147,7 +147,7 @@ jpeg_undifference5(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference6(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -158,7 +158,7 @@ jpeg_undifference6(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference7(j_decompress_ptr cinfo, int comp_index,
-           JDIFFROW diff_buf, JDIFFROW prev_row,
+           const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
   SHIFT_TEMPS
@@ -177,7 +177,7 @@ jpeg_undifference7(j_decompress_ptr cinfo, int comp_index,
 
 METHODDEF(void)
 jpeg_undifference_first_row(j_decompress_ptr cinfo, int comp_index,
-                JDIFFROW diff_buf, JDIFFROW prev_row,
+                const JDIFFROW diff_buf, JDIFFROW prev_row,
                 JDIFFROW undiff_buf, JDIMENSION width)
 {
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
index c49689c24d2ea6722d93d783e5370c4353f48b1b..a83f7d16740fc24e487575293686022d2931c443 100644 (file)
@@ -35,7 +35,7 @@ typedef scaler * scaler_ptr;
 
 METHODDEF(void)
 simple_upscale(j_decompress_ptr cinfo,
-              JDIFFROW diff_buf, JSAMPROW output_buf,
+              const JDIFFROW diff_buf, JSAMPROW output_buf,
               JDIMENSION width)
 {
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
@@ -49,7 +49,7 @@ simple_upscale(j_decompress_ptr cinfo,
 
 METHODDEF(void)
 simple_downscale(j_decompress_ptr cinfo,
-                JDIFFROW diff_buf, JSAMPROW output_buf,
+                const JDIFFROW diff_buf, JSAMPROW output_buf,
                 JDIMENSION width)
 {
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
@@ -64,7 +64,7 @@ simple_downscale(j_decompress_ptr cinfo,
 
 METHODDEF(void)
 noscale(j_decompress_ptr cinfo,
-       JDIFFROW diff_buf, JSAMPROW output_buf,
+       const JDIFFROW diff_buf, JSAMPROW output_buf,
        JDIMENSION width)
 {
   unsigned int xindex;
index e035a749028b30077c95ba7d4b93d29178e78a11..afeeca0906389961169bea024d5908f0bb32afb7 100644 (file)
@@ -377,7 +377,7 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
 
 GLOBAL(void)
 jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
-              JCOEFPTR coef_block,
+              const JCOEFPTR coef_block,
               JSAMPARRAY output_buf, JDIMENSION output_col)
 {
   int dcval;
index aacc2740ee5d3814fd64f941c3270722c4fa5d2d..96c87e6c27a70a654457dbc9f8d6f5d464ef6b28 100644 (file)
@@ -773,7 +773,7 @@ find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
 
 LOCAL(void)
 find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
-          int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])
+          int numcolors, const JSAMPLE colorlist[], JSAMPLE bestcolor[])
 /* Find the closest colormap entry for each cell in the update box,
  * given the list of candidate colors prepared by find_nearby_colors.
  * Return the indexes of the closest entries in the bestcolor[] array.
index 8321c681ee17f3fc54874a26749fcbe08e518be5..a4a8a60b8ae3b1ecb44f2175dac15b05c47ae274 100644 (file)
@@ -1,5 +1,5 @@
 # declare additional include directories
-INCLUDE_DIRECTORIES("${dcmjpeg_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" "${dcmjpeg_SOURCE_DIR}/libijg8" "${dcmjpeg_SOURCE_DIR}/libijg12" "${dcmjpeg_SOURCE_DIR}/libijg16" ${ZLIB_INCDIR})
+include_directories("${dcmjpeg_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" "${dcmjpeg_SOURCE_DIR}/libijg8" "${dcmjpeg_SOURCE_DIR}/libijg12" "${dcmjpeg_SOURCE_DIR}/libijg16" ${ZLIB_INCDIR})
 
 # create library from source files
 DCMTK_ADD_LIBRARY(dcmjpeg ddpiimpl dipijpeg djcodecd djcodece djcparam djdecbas djdecext djdeclol djdecode djdecpro djdecsps djdecsv1 djdijg12 djdijg8 djdijg16 djeijg12 djeijg8 djeijg16 djencbas djencext djenclol djencode djencpro djencsps djencsv1 djrplol djrploss djutils)
index f94d7c87b213b88f42a9dfe3daa9189538cae5ff..5b9d3ec8b58df748c295fb2c6b0a9a87eb25167b 100644 (file)
@@ -47,8 +47,10 @@ ddpiimpl.o: ddpiimpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -125,6 +127,7 @@ dipijpeg.o: dipijpeg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -134,6 +137,7 @@ dipijpeg.o: dipijpeg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -200,6 +204,7 @@ djcodecd.o: djcodecd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -208,6 +213,7 @@ djcodecd.o: djcodecd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -275,6 +281,7 @@ djcodece.o: djcodece.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -283,6 +290,7 @@ djcodece.o: djcodece.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -374,6 +382,7 @@ djcparam.o: djcparam.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -382,6 +391,7 @@ djcparam.o: djcparam.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -429,6 +439,7 @@ djdecbas.o: djdecbas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -437,6 +448,7 @@ djdecbas.o: djdecbas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -495,6 +507,7 @@ djdecext.o: djdecext.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -503,6 +516,7 @@ djdecext.o: djdecext.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -562,6 +576,7 @@ djdeclol.o: djdeclol.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -570,6 +585,7 @@ djdeclol.o: djdeclol.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -629,6 +645,7 @@ djdecode.o: djdecode.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -637,6 +654,7 @@ djdecode.o: djdecode.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
  ../include/dcmtk/dcmjpeg/djdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \
@@ -688,6 +706,7 @@ djdecpro.o: djdecpro.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -696,6 +715,7 @@ djdecpro.o: djdecpro.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -755,6 +775,7 @@ djdecsps.o: djdecsps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -763,6 +784,7 @@ djdecsps.o: djdecsps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -822,6 +844,7 @@ djdecsv1.o: djdecsv1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -830,6 +853,7 @@ djdecsv1.o: djdecsv1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -887,6 +911,7 @@ djdijg12.o: djdijg12.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -896,6 +921,7 @@ djdijg12.o: djdijg12.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmjpeg/djutils.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \
@@ -945,6 +971,7 @@ djdijg16.o: djdijg16.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -954,6 +981,7 @@ djdijg16.o: djdijg16.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmjpeg/djutils.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \
@@ -1003,6 +1031,7 @@ djdijg8.o: djdijg8.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1012,6 +1041,7 @@ djdijg8.o: djdijg8.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmjpeg/djutils.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \
@@ -1063,6 +1093,7 @@ djeijg12.o: djeijg12.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1071,6 +1102,7 @@ djeijg12.o: djeijg12.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
@@ -1123,6 +1155,7 @@ djeijg16.o: djeijg16.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1131,6 +1164,7 @@ djeijg16.o: djeijg16.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
@@ -1183,6 +1217,7 @@ djeijg8.o: djeijg8.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1191,6 +1226,7 @@ djeijg8.o: djeijg8.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
@@ -1243,6 +1279,7 @@ djencbas.o: djencbas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1251,6 +1288,7 @@ djencbas.o: djencbas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -1309,6 +1347,7 @@ djencext.o: djencext.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1317,6 +1356,7 @@ djencext.o: djencext.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -1376,6 +1416,7 @@ djenclol.o: djenclol.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1384,6 +1425,7 @@ djenclol.o: djenclol.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -1443,6 +1485,7 @@ djencode.o: djencode.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1451,6 +1494,7 @@ djencode.o: djencode.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
  ../include/dcmtk/dcmjpeg/djdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
@@ -1502,6 +1546,7 @@ djencpro.o: djencpro.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1510,6 +1555,7 @@ djencpro.o: djencpro.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -1569,6 +1615,7 @@ djencsps.o: djencsps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1577,6 +1624,7 @@ djencsps.o: djencsps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -1636,6 +1684,7 @@ djencsv1.o: djencsv1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1644,6 +1693,7 @@ djencsv1.o: djencsv1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -1712,6 +1762,7 @@ djrplol.o: djrplol.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1719,6 +1770,7 @@ djrplol.o: djrplol.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1772,6 +1824,7 @@ djrploss.o: djrploss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1779,6 +1832,7 @@ djrploss.o: djrploss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1822,6 +1876,7 @@ djutils.o: djutils.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1830,6 +1885,7 @@ djutils.o: djutils.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
  ../include/dcmtk/dcmjpeg/djdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
index 754eb90300c6d14b58e91059750ce412d3e27889..f7280d97d7da272f3c4e5c4ede71b34279de6391 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2001-2016, OFFIS e.V.
+ *  Copyright (C) 2001-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -126,7 +126,7 @@ OFCondition DJCodecDecoder::decode(
       DcmPixelItem *pixItem = NULL;
       Uint8 * jpegData = NULL;
       result = pixSeq->getItem(pixItem, 1); // first item is offset table, use second item
-      if (result.good())
+      if (result.good() && (pixItem != NULL))
       {
         Uint32 fragmentLength = pixItem->getLength();
         result = pixItem->getUint8Array(jpegData);
@@ -352,6 +352,46 @@ OFCondition DJCodecDecoder::decode(
 }
 
 
+// the following macros make the source code more readable and easier to maintain
+
+#define GET_AND_CHECK_UINT16_VALUE(tag, variable)                                                                           \
+  if (result.good())                                                                                                        \
+  {                                                                                                                         \
+    result = dataset->findAndGetUint16(tag, variable);                                                                      \
+    if (result == EC_TagNotFound)                                                                                           \
+    {                                                                                                                       \
+      DCMJPEG_WARN("mandatory element " << DcmTag(tag).getTagName() << " " << tag << " is missing");                        \
+      result = EC_MissingAttribute;                                                                                         \
+    }                                                                                                                       \
+    else if ((result == EC_IllegalCall) || (result == EC_IllegalParameter))                                                 \
+    {                                                                                                                       \
+      DCMJPEG_WARN("no value for mandatory element " << DcmTag(tag).getTagName() << " " << tag);                            \
+      result = EC_MissingValue;                                                                                             \
+    }                                                                                                                       \
+    else if (result.bad())                                                                                                  \
+      DCMJPEG_WARN("cannot retrieve value of element " << DcmTag(tag).getTagName() << " " << tag << ": " << result.text()); \
+  }
+
+#define GET_AND_CHECK_STRING_VALUE(tag, variable)                                                                           \
+  if (result.good())                                                                                                        \
+  {                                                                                                                         \
+    result = dataset->findAndGetOFString(tag, variable);                                                                    \
+    if (result == EC_TagNotFound)                                                                                           \
+    {                                                                                                                       \
+      DCMJPEG_WARN("mandatory element " << DcmTag(tag).getTagName() << " " << tag << " is missing");                        \
+      result = EC_MissingAttribute;                                                                                         \
+    }                                                                                                                       \
+    else if (result.bad())                                                                                                  \
+    {                                                                                                                       \
+      DCMJPEG_WARN("cannot retrieve value of element " << DcmTag(tag).getTagName() << " " << tag << ": " << result.text()); \
+    }                                                                                                                       \
+    else if (variable.empty())                                                                                              \
+    {                                                                                                                       \
+      DCMJPEG_WARN("no value for mandatory element " << DcmTag(tag).getTagName() << " " << tag);                            \
+      result = EC_MissingValue;                                                                                             \
+    }                                                                                                                       \
+  }
+
 OFCondition DJCodecDecoder::decodeFrame(
     const DcmRepresentationParameter *fromParam,
     DcmPixelSequence *fromPixSeq,
@@ -368,7 +408,10 @@ OFCondition DJCodecDecoder::decodeFrame(
   // assume we can cast the codec parameter to what we need
   const DJCodecParameter *djcp = OFreinterpret_cast(const DJCodecParameter*, cp);
 
-  if ((!dataset)||((dataset->ident()!= EVR_dataset) && (dataset->ident()!= EVR_item))) result = EC_InvalidTag;
+  if (dataset == NULL)
+    result = EC_IllegalParameter;
+  else if ((dataset->ident() != EVR_dataset) && (dataset->ident() != EVR_item))
+    result = EC_CorruptedData;
   else
   {
     Uint16 imageSamplesPerPixel = 0;
@@ -383,17 +426,18 @@ OFCondition DJCodecDecoder::decodeFrame(
     OFBool isSigned = OFFalse;
     Uint16 pixelRep = 0; // needed to decline color conversion of signed pixel data to RGB
 
-    if (result.good()) result = dataset->findAndGetUint16(DCM_SamplesPerPixel, imageSamplesPerPixel);
-    if (result.good()) result = dataset->findAndGetUint16(DCM_Rows, imageRows);
-    if (result.good()) result = dataset->findAndGetUint16(DCM_Columns, imageColumns);
-    if (result.good()) result = dataset->findAndGetUint16(DCM_BitsAllocated, imageBitsAllocated);
-    if (result.good()) result = dataset->findAndGetUint16(DCM_BitsStored, imageBitsStored);
-    if (result.good()) result = dataset->findAndGetUint16(DCM_HighBit, imageHighBit);
-    if (result.good()) result = dataset->findAndGetUint16(DCM_PixelRepresentation, pixelRep);
-    if (result.good()) result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, photometricInterpretation);
+    /* retrieve values from dataset (and warn if missing or empty) */
+    GET_AND_CHECK_UINT16_VALUE(DCM_SamplesPerPixel, imageSamplesPerPixel)
+    GET_AND_CHECK_UINT16_VALUE(DCM_Rows, imageRows)
+    GET_AND_CHECK_UINT16_VALUE(DCM_Columns, imageColumns)
+    GET_AND_CHECK_UINT16_VALUE(DCM_BitsAllocated, imageBitsAllocated)
+    GET_AND_CHECK_UINT16_VALUE(DCM_BitsStored, imageBitsStored)
+    GET_AND_CHECK_UINT16_VALUE(DCM_HighBit, imageHighBit)
+    GET_AND_CHECK_UINT16_VALUE(DCM_PixelRepresentation, pixelRep)
+    GET_AND_CHECK_STRING_VALUE(DCM_PhotometricInterpretation, photometricInterpretation)
     if (imageSamplesPerPixel > 1)
     {
-      if (result.good()) result = dataset->findAndGetUint16(DCM_PlanarConfiguration, planarConfig);
+      GET_AND_CHECK_UINT16_VALUE(DCM_PlanarConfiguration, planarConfig);
     }
 
     isSigned = (pixelRep == 0) ? OFFalse : OFTrue;
index 2bad18981ded131953f3946d4ada7d04ebc53565..897dca4b8f4abf124cd650296f94cf31183e2217 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2001-2017, OFFIS e.V.
+ *  Copyright (C) 2001-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -246,6 +246,24 @@ OFCondition DJCodecEncoder::encodeColorImage(
   double uncompressedSize = 0.0;
   Uint16 compressedBits = OFstatic_cast(Uint16, cp->getForcedBitDepth());
 
+  // Check if image is continuous-tone, bail out otherwise.
+  // We check the value of BitsStored, which is not affected by any transformation such as MLUT.
+  Uint16 bitsStored = 0;
+  result = dataset->findAndGetUint16(DCM_BitsStored, bitsStored);
+  if (result.bad()) return result;
+
+  if ((bitsStored > 16) && isLosslessProcess())
+  {
+    DCMJPEG_WARN("Cannot lossless compress image with " << bitsStored << " bits/sample: JPEG supports max. 16 bits.");
+    return EJ_UnsupportedBitDepth;
+  }
+
+  if (bitsStored < 2)
+  {
+    DCMJPEG_WARN("Cannot compress image with " << bitsStored << " bit/sample: JPEG requires at least 2 bits.");
+    return EJ_UnsupportedBitDepth;
+  }
+
   // initialize settings with defaults for RGB mode
   OFBool monochromeMode = OFFalse;
   unsigned long flags = 0; // flags for initialization of DicomImage
@@ -911,6 +929,24 @@ OFCondition DJCodecEncoder::encodeMonochromeImage(
   if (cp->getAcrNemaCompatibility())
     flags |= CIF_AcrNemaCompatibility;
 
+  // Check if image is continuous-tone, bail out otherwise.
+  // We check the value of BitsStored, which is not affected by any transformation such as MLUT.
+  Uint16 bitsStored = 0;
+  result = dataset->findAndGetUint16(DCM_BitsStored, bitsStored);
+  if (result.bad()) return result;
+
+  if ((bitsStored > 16) && isLosslessProcess())
+  {
+    DCMJPEG_WARN("Cannot lossless compress image with " << bitsStored << " bits/sample: JPEG supports max. 16 bits.");
+    return EJ_UnsupportedBitDepth;
+  }
+
+  if (bitsStored < 2)
+  {
+    DCMJPEG_WARN("Cannot compress image with " << bitsStored << " bit/sample: JPEG requires at least 2 bits.");
+    return EJ_UnsupportedBitDepth;
+  }
+
   // create DicomImage object. Will fail if dcmimage has not been activated in main().
   // transfer syntax can be any uncompressed one.
   DicomImage dimage(dataset, EXS_LittleEndianImplicit, flags); // read all frames
index 9b04db40c9301670d519986a0c50aeae7fd9a7dd..6c46eb5eb174eacb8bc7390fabf04ad652a054a1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2016, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -28,6 +28,7 @@ DJCodecParameter::DJCodecParameter(
     E_UIDCreation pCreateSOPInstanceUID,
     E_PlanarConfiguration pPlanarConfiguration,
     OFBool predictor6WorkaroundEnable,
+    OFBool cornellWorkaroundEnable,
     OFBool pForceSingleFragmentPerFrame,
     OFBool pOptimizeHuffman,
     int pSmoothingFactor,
@@ -77,6 +78,7 @@ DJCodecParameter::DJCodecParameter(
 , acrNemaCompatibility(pAcrNemaCompatibility)
 , trueLosslessMode(pTrueLosslessMode)
 , predictor6WorkaroundEnabled_(predictor6WorkaroundEnable)
+, cornellWorkaroundEnabled_(cornellWorkaroundEnable)
 , forceSingleFragmentPerFrame(pForceSingleFragmentPerFrame)
 {
 }
@@ -110,6 +112,7 @@ DJCodecParameter::DJCodecParameter(const DJCodecParameter& arg)
 , acrNemaCompatibility(arg.acrNemaCompatibility)
 , trueLosslessMode(arg.trueLosslessMode)
 , predictor6WorkaroundEnabled_(arg.predictor6WorkaroundEnabled_)
+, cornellWorkaroundEnabled_(arg.cornellWorkaroundEnabled_)
 , forceSingleFragmentPerFrame(arg.forceSingleFragmentPerFrame)
 {
 }
index f4276ad1dcdcfa9afb2cecbb80486e6934e8d7a3..9166c7bc13cff61078026732b06f8a504cd30dbf 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -46,6 +46,7 @@ void DJDecoderRegistration::registerCodecs(
     E_UIDCreation pCreateSOPInstanceUID,
     E_PlanarConfiguration pPlanarConfiguration,
     OFBool predictor6WorkaroundEnable,
+    OFBool cornellWorkaroundEnable,
     OFBool pForceSingleFragmentPerFrame)
 {
   if (! registered)
@@ -56,6 +57,7 @@ void DJDecoderRegistration::registerCodecs(
       pCreateSOPInstanceUID,
       pPlanarConfiguration,
       predictor6WorkaroundEnable,
+      cornellWorkaroundEnable,
       pForceSingleFragmentPerFrame);
 
     if (cp)
index ff479ebf7d0d60013523b91bf8bd031118a266b9..4eb139dc0439f41633579b8577ad1a398ae4b477 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2001-2014, OFFIS e.V.
+ *  Copyright (C) 2001-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -262,6 +262,7 @@ OFCondition DJDecompressIJG16Bit::init()
     cinfo->src = &OFconst_cast(DJDIJG16SourceManagerStruct*, src)->pub;
     cinfo->workaround_options = 0;
     if (cparam->predictor6WorkaroundEnabled()) cinfo->workaround_options |= WORKAROUND_PREDICTOR6OVERFLOW;
+    if (cparam->cornellWorkaroundEnabled()) cinfo->workaround_options |= WORKAROUND_BUGGY_CORNELL_16BIT_JPEG_ENCODER;
   } else return EC_MemoryExhausted;
 
   // everything OK
index a350436f0c9f881fe8a40feba3636aba60e21e63..c5c12aee51c9f1aaa56edd79759204d19ebde0ff 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -410,7 +410,7 @@ OFCondition DJCompressIJG12Bit::encode(
   cinfo.smoothing_factor = cparam->getSmoothingFactor();
 
   // initialize sampling factors
-  if (cinfo.jpeg_color_space == JCS_YCbCr)
+  if ((cinfo.jpeg_color_space == JCS_YCbCr) && (modeofOperation != EJM_lossless))
   {
     switch(cparam->getSampleFactors())
     {
@@ -430,7 +430,8 @@ OFCondition DJCompressIJG12Bit::encode(
   }
   else
   {
-    // JPEG color space is not YCbCr, disable subsampling.
+    // JPEG color space is not YCbCr, or we are using lossless compression.
+    // Disable subsampling.
     cinfo.comp_info[0].h_samp_factor = 1;
     cinfo.comp_info[0].v_samp_factor = 1;
   }
index c490e160c73d84e6b50a9f1bd5cc25a5378fcc2d..a85c176c87f6fb538a23de0002d59c75eecadfc4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -246,7 +246,7 @@ OFCondition DJCompressIJG16Bit::encode(
   cinfo.smoothing_factor = cparam->getSmoothingFactor();
 
   // initialize sampling factors
-  if (cinfo.jpeg_color_space == JCS_YCbCr)
+  if ((cinfo.jpeg_color_space == JCS_YCbCr) && (modeofOperation != EJM_lossless))
   {
     switch(cparam->getSampleFactors())
     {
@@ -266,7 +266,8 @@ OFCondition DJCompressIJG16Bit::encode(
   }
   else
   {
-    // JPEG color space is not YCbCr, disable subsampling.
+    // JPEG color space is not YCbCr, or we are using lossless compression.
+    // Disable subsampling.
     cinfo.comp_info[0].h_samp_factor = 1;
     cinfo.comp_info[0].v_samp_factor = 1;
   }
index 28890c1ecfdcd63902a125551fbf182c2124b9dc..77420938b451a8631029ceef163b02c4da5ad483 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -414,7 +414,7 @@ OFCondition DJCompressIJG8Bit::encode(
   cinfo.smoothing_factor = cparam->getSmoothingFactor();
 
   // initialize sampling factors
-  if (cinfo.jpeg_color_space == JCS_YCbCr)
+  if ((cinfo.jpeg_color_space == JCS_YCbCr) && (modeofOperation != EJM_lossless))
   {
     switch(cparam->getSampleFactors())
     {
@@ -434,7 +434,8 @@ OFCondition DJCompressIJG8Bit::encode(
   }
   else
   {
-    // JPEG color space is not YCbCr, disable subsampling.
+    // JPEG color space is not YCbCr, or we are using lossless compression.
+    // Disable subsampling.
     cinfo.comp_info[0].h_samp_factor = 1;
     cinfo.comp_info[0].v_samp_factor = 1;
   }
index 9dc18e433a668c2e178d33b1ba94f762b5c70c0e..b8c9150c3ccbbbd8962263707b61000db9d8c82d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2016, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -75,6 +75,7 @@ void DJEncoderRegistration::registerCodecs(
       EPC_default, // not relevant, used for decompression only
       OFFalse, // not relevant, used for decompression only
       OFFalse, // not relevant, used for decompression only
+      OFFalse, // not relevant, used for decompression only
       pOptimizeHuffman,
       pSmoothingFactor,
       pForcedBitDepth,
index f2cc7a10f5212900dec5048d838b8ecdc44eac86..e7ec4a2cdc23a39b22af52688f1f760650d7f3c5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -35,6 +35,7 @@ makeOFConditionConst(EJ_IJG12_FrameBufferTooSmall,            OFM_dcmjpeg,  3, O
 makeOFConditionConst(EJ_IJG16_FrameBufferTooSmall,            OFM_dcmjpeg,  4, OF_error, "Buffer for decompressed image (16 bits/sample) too small"  );
 makeOFConditionConst(EJ_UnsupportedPhotometricInterpretation, OFM_dcmjpeg,  5, OF_error, "Codec does not support this PhotometricInterpretation"  );
 makeOFConditionConst(EJ_UnsupportedColorConversion,           OFM_dcmjpeg,  6, OF_error, "Codec does not support this kind of color conversion"  );
+makeOFConditionConst(EJ_UnsupportedBitDepth,                  OFM_dcmjpeg,  7, OF_error, "Unsupported bit depth for this codec"  );
 
 EP_Interpretation DcmJpegHelper::getPhotometricInterpretation(DcmItem *item)
 {
index e114663776f0e1654d6fddbc3316ffd5e8b6725b..c8a05a7a99eedfbf101f7d69c728ea26fefc49d8 100644 (file)
@@ -1,7 +1,7 @@
 # declare project
-PROJECT(dcmjpls)
+project(dcmjpls)
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc libcharls apps include)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc libcharls apps include)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 14d8756966adfcfc80cc20885a72d82a8ae0d347..2a9a4526ee00dc19102a09a334cbd549720325e7 100644 (file)
@@ -1,12 +1,12 @@
 # declare additional include directories
-INCLUDE_DIRECTORIES("${dcmjpls_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${LIBTIFF_INCDIR} ${LIBPNG_INCDIR})
+include_directories("${dcmjpls_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${LIBTIFF_INCDIR} ${LIBPNG_INCDIR})
 
 # declare executables
-FOREACH(PROGRAM dcmcjpls dcmdjpls dcml2pnm)
+foreach(PROGRAM dcmcjpls dcmdjpls dcml2pnm)
   DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
-ENDFOREACH(PROGRAM)
+endforeach()
 
 # make sure executables are linked to the corresponding libraries
-FOREACH(PROGRAM dcmcjpls dcmdjpls dcml2pnm)
+foreach(PROGRAM dcmcjpls dcmdjpls dcml2pnm)
   DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmjpls charls dcmimage dcmimgle dcmdata oflog ofstd ofstd)
-ENDFOREACH(PROGRAM)
+endforeach()
index 0cb3878ba25be8f4e393ca67ec9dab196d1f4815..9a8cc769057fda03982e9eef4c6477c24da72e45 100644 (file)
@@ -35,6 +35,7 @@ dcmcjpls.o: dcmcjpls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -44,6 +45,7 @@ dcmcjpls.o: dcmcjpls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -158,6 +160,7 @@ dcmdjpls.o: dcmdjpls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -167,6 +170,7 @@ dcmdjpls.o: dcmdjpls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -280,6 +284,7 @@ dcml2pnm.o: dcml2pnm.cc ../../dcmimage/apps/dcm2pnm.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -289,6 +294,7 @@ dcml2pnm.o: dcml2pnm.cc ../../dcmimage/apps/dcm2pnm.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
index 0ce5ca0b91b37b457b59db7f637f97d6901b6809..b1cea9a1b51af1e0266b9270d5f3e2ceba3771a2 100644 (file)
@@ -282,9 +282,11 @@ data set trailing padding:
 
 \section dcmcjpls_notes NOTES
 
-The \b dcmcjpls utility compresses DICOM images of all SOP classes. However,
-\b dcmcjpls does not attempt to ensure that the compressed image still
-complies with all restrictions of the object's IOD.
+The \b dcmcjpls utility compresses DICOM images of all SOP classes.  It
+processes all Pixel Data (7fe0,0010) elements in the dataset, i.e. compression
+is also performed on an icon image.  However, \b dcmcjpls does not attempt to
+ensure that the compressed image still complies with all restrictions of the
+object's IOD.
 
 The user is responsible for making sure that the compressed images he creates
 are compliant with the DICOM standard.  If in question, the \b dcmcjpls utility
@@ -376,6 +378,6 @@ It is an error if no data dictionary can be loaded.
 
 \section dcmcjpls_copyright COPYRIGHT
 
-Copyright (C) 2009-2016 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2009-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index 936c7558f3dc524afca5e7a66b828027c8250dc0..1f37cb08ab7e026aee3cacc1200826e689154d12 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmjpls DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmjpls DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 92f67e994de97f5299be187d1c3570651afe7bea..fc0f9ba7191d09f69d3c7928fc30cb63087b2472 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2014, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -46,7 +46,7 @@ extern DCMTK_DCMJPLS_EXPORT OFLogger DCM_dcmjplsLogger;
 // include this file in doxygen documentation
 
 /** @file djlsutil.h
- *  @brief enumerations, error constants and helper functions for the dcmjpls module
+ *  @brief type definitions and constants for the dcmjpls module
  */
 
 
index efd52ff5f281252e9670bf2aa753449505bdc7d5..0c5b14335c218382583d63753ef9deaa3ff7db7e 100644 (file)
@@ -1,5 +1,5 @@
 # declare additional include directories
-INCLUDE_DIRECTORIES("${dcmjpls_SOURCE_DIR}/libcharls" "${ofstd_SOURCE_DIR}/include")
+include_directories("${dcmjpls_SOURCE_DIR}/libcharls" "${ofstd_SOURCE_DIR}/include")
 
 # create library from source files
 DCMTK_ADD_LIBRARY(charls header intrface jpegls)
index 7e84f4dc502d3b4df5053f65498f572a7bcc1249..314face74ba48929884af105eff8151ef453fcaa 100644 (file)
@@ -1,5 +1,5 @@
 # declare additional include directories
-INCLUDE_DIRECTORIES("${dcmjpls_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" "${dcmjpls_SOURCE_DIR}/libcharls" ${ZLIB_INCDIR})
+include_directories("${dcmjpls_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" "${dcmjpls_SOURCE_DIR}/libcharls" ${ZLIB_INCDIR})
 
 # create library from source files
 DCMTK_ADD_LIBRARY(dcmjpls djcparam djdecode djencode djrparam djcodecd djutils djcodece)
index cd51a06c8bd029c6bdd74707bc336fa63ce73d38..64380e188a5a3961bae7fdb9f25250e44ca3d6a3 100644 (file)
@@ -37,6 +37,7 @@ djcodecd.o: djcodecd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -45,6 +46,7 @@ djcodecd.o: djcodecd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -111,6 +113,7 @@ djcodece.o: djcodece.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -119,6 +122,7 @@ djcodece.o: djcodece.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -214,6 +218,7 @@ djcparam.o: djcparam.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -222,6 +227,7 @@ djcparam.o: djcparam.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -265,6 +271,7 @@ djdecode.o: djdecode.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -273,6 +280,7 @@ djdecode.o: djdecode.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmjpls/dldefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dccodec.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
@@ -319,6 +327,7 @@ djencode.o: djencode.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -327,6 +336,7 @@ djencode.o: djencode.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmjpls/dldefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -385,6 +395,7 @@ djrparam.o: djrparam.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -392,6 +403,7 @@ djrparam.o: djrparam.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -434,6 +446,7 @@ djutils.o: djutils.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -442,6 +455,7 @@ djutils.o: djutils.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmjpls/dldefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h
index f3c4fb7d34d9f3affb9cce784a35560ec30c48b7..3f0d85e1df2d479dd1f1a3c9a60e8d21a4d3f073 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2007-2017, OFFIS e.V.
+ *  Copyright (C) 2007-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -485,6 +485,20 @@ OFCondition DJLSDecoderBase::determineDecompressedColorModel(
   {
     // retrieve color model from given dataset
     result = dataset->findAndGetOFString(DCM_PhotometricInterpretation, decompressedColorModel);
+    if (result == EC_TagNotFound)
+    {
+        DCMJPLS_WARN("mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation << " is missing");
+        result = EC_MissingAttribute;
+    }
+    else if (result.bad())
+    {
+        DCMJPLS_WARN("cannot retrieve value of element PhotometricInterpretation " << DCM_PhotometricInterpretation << ": " << result.text());
+    }
+    else if (decompressedColorModel.empty())
+    {
+        DCMJPLS_WARN("no value for mandatory element PhotometricInterpretation " << DCM_PhotometricInterpretation);
+        result = EC_MissingValue;
+    }
   }
   return result;
 }
index d13da73cde3f6d7972e31988780b6688eea84fc5..34eb81023720ad7743585db1a1d297ef38554179 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2007-2017, OFFIS e.V.
+ *  Copyright (C) 2007-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -733,6 +733,23 @@ OFCondition DJLSEncoderBase::losslessCookedEncode(
     }
   }
 
+  // Check if image is 2..16 bits/sample, bail out otherwise.
+  // We check the value of BitsStored, which is not affected by any transformation such as MLUT.
+  Uint16 bitsStored = 0;
+  result = dataset->findAndGetUint16(DCM_BitsStored, bitsStored);
+  if (result.bad()) return result;
+
+  if (bitsStored > 16)
+  {
+    DCMJPLS_WARN("Cannot compress image with " << bitsStored << " bits/sample: JPEG-LS supports max. 16 bits.");
+    return EC_JLSUnsupportedBitDepth;
+  }
+  if (bitsStored < 2)
+  {
+    DCMJPLS_WARN("Cannot compress image with " << bitsStored << " bit/sample: JPEG-LS requires at least 2 bits.");
+    return EC_JLSUnsupportedBitDepth;
+  }
+
   DcmPixelSequence *pixelSequence = NULL;
   DcmPixelItem *offsetTable = NULL;
 
@@ -758,7 +775,6 @@ OFCondition DJLSEncoderBase::losslessCookedEncode(
 
   // determine number of bits per sample
   int bitsPerSample = dimage->getDepth();
-  if (result.good() && (bitsPerSample > 16)) result = EC_JLSUnsupportedBitDepth;
 
   // create initial pixel sequence
   if (result.good())
index 98730557c3f928269c270eefd6ec367773721bf2..4fb4d4ddd70898ff2f9f372aeac3715abf570186 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmnet)
+project(dcmnet)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmnet_SOURCE_DIR}/include" "${dcmtls_SOURCE_DIR}/include" ${OPENSSL_INCDIR} "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR})
+include_directories("${dcmnet_SOURCE_DIR}/include" "${dcmtls_SOURCE_DIR}/include" ${OPENSSL_INCDIR} "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc apps include docs etc tests)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc apps include docs etc tests)
+  add_subdirectory(${SUBDIR})
+endforeach()
index d35448abff668141c29b0541b7585bedd65820c3..aa0ff8b250c17949eadbde008002ad695ae4da0f 100644 (file)
@@ -1,37 +1,37 @@
 # declare additional include directories needed for compression support
-INCLUDE_DIRECTORIES("${dcmjpls_SOURCE_DIR}/include" "${dcmjpeg_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include")
+include_directories("${dcmjpls_SOURCE_DIR}/include" "${dcmjpeg_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include")
 
 # declare executables
-FOREACH(PROGRAM dcmrecv dcmsend echoscu findscu getscu movescu storescp storescu termscu)
+foreach(PROGRAM dcmrecv dcmsend echoscu findscu getscu movescu storescp storescu termscu)
   DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
-ENDFOREACH(PROGRAM)
+endforeach()
 
 # declare installation files
-IF(WITH_OPENSSL)
-  IF(WIN32)
-    INSTALL(DIRECTORY "${OPENSSL_BINDIR}/"
+if(WITH_OPENSSL)
+  if(WIN32)
+    install(DIRECTORY "${OPENSSL_BINDIR}/"
         DESTINATION "${CMAKE_INSTALL_BINDIR}"
         COMPONENT bin
         CONFIGURATIONS Release MinSizeRel
         FILES_MATCHING REGEX "dcmtk(eay|crypto|ssl).*\\.dll"
         REGEX "dcmtk(eay|crypto|ssl)_d.*\\.dll" EXCLUDE
     )
-    INSTALL(DIRECTORY "${OPENSSL_BINDIR}/"
+    install(DIRECTORY "${OPENSSL_BINDIR}/"
         DESTINATION "${CMAKE_INSTALL_BINDIR}"
         COMPONENT bin
         CONFIGURATIONS Debug RelWithDebInfo
         FILES_MATCHING REGEX "dcmtk(eay|crypto|ssl)_d.*\\.dll"
     )
-  ENDIF(WIN32)
-ENDIF(WITH_OPENSSL)
+  endif()
+endif()
 
 # make sure executables are linked to the corresponding libraries
-FOREACH(PROGRAM dcmrecv dcmsend echoscu findscu getscu movescu storescp storescu termscu)
+foreach(PROGRAM dcmrecv dcmsend echoscu findscu getscu movescu storescp storescu termscu)
   DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmnet dcmdata oflog ofstd)
-ENDFOREACH(PROGRAM)
-FOREACH(PROGRAM echoscu findscu storescp storescu)
+endforeach()
+foreach(PROGRAM echoscu findscu storescp storescu)
   DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmtls)
-ENDFOREACH(PROGRAM)
+endforeach()
 
 # uncomment the following line if "storescu" is compiled with ON_THE_FLY_COMPRESSION defined
 #DCMTK_TARGET_LINK_MODULES(storescu dcmjpls dcmjpeg dcmimage)
index 9093bbdcbb8b9543f72746b81124c2349e68a415..ae77c5cd1056d25d9ea7b2ce2148a1bf0b48ba04 100644 (file)
@@ -15,9 +15,11 @@ dcmrecv.o: dcmrecv.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \
  ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -143,9 +145,11 @@ dcmsend.o: dcmsend.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \
  ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -309,12 +313,14 @@ echoscu.o: echoscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -338,9 +344,10 @@ echoscu.o: echoscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \
  ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlstrans.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlsopt.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \
  ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h
+ ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h
 findscu.o: findscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmnet/dfindscu.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
@@ -380,6 +387,7 @@ findscu.o: findscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -388,6 +396,7 @@ findscu.o: findscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -414,11 +423,12 @@ findscu.o: findscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcostrmz.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \
- ../../ofstd/include/dcmtk/ofstd/ofchrenc.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlstrans.h \
- ../include/dcmtk/dcmnet/dcmtrans.h ../include/dcmtk/dcmnet/dcmlayer.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlsopt.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \
+ ../include/dcmtk/dcmnet/dcmlayer.h \
  ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h
+ ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofchrenc.h
 getscu.o: getscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
@@ -428,17 +438,19 @@ getscu.o: getscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h ../include/dcmtk/dcmnet/scu.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmnet/scu.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -563,9 +575,11 @@ movescu.o: movescu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h ../include/dcmtk/dcmnet/dicom.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmnet/dicom.h \
  ../include/dcmtk/dcmnet/cond.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -640,9 +654,11 @@ storescp.o: storescp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
  ../../ofstd/include/dcmtk/ofstd/oftime.h ../include/dcmtk/dcmnet/dicom.h \
@@ -708,9 +724,10 @@ storescp.o: storescp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcostrmz.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlstrans.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlsopt.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \
  ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h
+ ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h
 storescu.o: storescu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
@@ -728,9 +745,11 @@ storescu.o: storescu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h ../include/dcmtk/dcmnet/dicom.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h ../include/dcmtk/dcmnet/dicom.h \
  ../include/dcmtk/dcmnet/cond.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -793,9 +812,10 @@ storescu.o: storescu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcostrmz.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlstrans.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlsopt.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \
  ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h
+ ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h
 termscu.o: termscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
@@ -804,18 +824,20 @@ termscu.o: termscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \
index f281666c2a9fa2d94e8cdd945d2824c1260ab670..408581f80c91a8b7c1f245465995aa07a439e869 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2013-2014, OFFIS e.V.
+ *  Copyright (C) 2013-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -45,18 +45,7 @@ static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v"
 
 
 /* exit codes for this command line tool */
-/* (EXIT_SUCCESS and EXIT_FAILURE are standard codes) */
-
-// general
-#define EXITCODE_NO_ERROR                         0
-#define EXITCODE_COMMANDLINE_SYNTAX_ERROR         1      // this code is the default for printError()
-
-// input file errors
-#define EXITCODE_CANNOT_READ_INPUT_FILE          20      // placeholder, currently not used
-
-// output file errors
-#define EXITCODE_CANNOT_WRITE_OUTPUT_FILE        40      // placeholder, currently not used
-#define EXITCODE_INVALID_OUTPUT_DIRECTORY        45
+/* (common codes are defined in "ofexit.h" included from "ofconapp.h") */
 
 // network errors
 #define EXITCODE_CANNOT_INITIALIZE_NETWORK       60      // placeholder, currently not used
index 51a3d2de429793857faa3448593510a007dd938a..c52310275103ea7e33cd87a8ee39cc378a8651f4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2011-2014, OFFIS e.V.
+ *  Copyright (C) 2011-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -61,20 +61,9 @@ static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v"
 
 
 /* exit codes for this command line tool */
-/* (EXIT_SUCCESS and EXIT_FAILURE are standard codes) */
-
-// general
-#define EXITCODE_NO_ERROR                         0
-#define EXITCODE_COMMANDLINE_SYNTAX_ERROR         1      // this code is the default for printError()
-
-// input file errors
-#define EXITCODE_CANNOT_READ_INPUT_FILE          20      // placeholder, currently not used
-#define EXITCODE_NO_INPUT_FILES                  21
-#define EXITCODE_INVALID_INPUT_FILE              22
-#define EXITCODE_NO_VALID_INPUT_FILES            23
+/* (common codes are defined in "ofexit.h" included from "ofconapp.h") */
 
 // output file errors
-#define EXITCODE_CANNOT_WRITE_OUTPUT_FILE        40      // placeholder, currently not used
 #define EXITCODE_CANNOT_WRITE_REPORT_FILE        43
 
 // network errors
index 148bf4dd747ebcc6c68735760dddce37fc86654c..428bacded042b28f0170e638c51d2486e03bcd28 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 #include "dcmtk/dcmdata/cmdlnarg.h"
 #include "dcmtk/ofstd/ofconapp.h"
 #include "dcmtk/dcmdata/dcuid.h"      /* for dcmtk version name */
-
-#ifdef WITH_OPENSSL
-#include "dcmtk/dcmtls/tlstrans.h"
-#include "dcmtk/dcmtls/tlslayer.h"
-#endif
+#include "dcmtk/dcmtls/tlsopt.h"      /* for DcmTLSOptions */
 
 #ifdef WITH_ZLIB
 #include <zlib.h>                     /* for zlibVersion() */
@@ -61,6 +57,12 @@ static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v"
 #define APPLICATIONTITLE     "ECHOSCU"
 #define PEERAPPLICATIONTITLE "ANY-SCP"
 
+
+/* exit codes for this command line tool */
+/* (common codes are defined in "ofexit.h" included from "ofconapp.h") */
+// network errors
+#define EXITCODE_ASSOCIATION_ABORTED    70
+
 static T_DIMSE_BlockingMode opt_blockMode = DIMSE_BLOCKING;
 static int opt_dimse_timeout = 0;
 
@@ -124,6 +126,7 @@ int
 main(int argc, char *argv[])
 {
   OFOStringStream optStream;
+  int result = EXITCODE_NO_ERROR;
 
   const char *     opt_peer                = NULL;
   OFCmdUnsignedInt opt_port                = 104;
@@ -135,26 +138,9 @@ main(int argc, char *argv[])
   OFCmdUnsignedInt opt_numXferSyntaxes     = 1;
   OFCmdUnsignedInt opt_numPresentationCtx  = 1;
   OFCmdUnsignedInt maxXferSyntaxes         = OFstatic_cast(OFCmdUnsignedInt, (DIM_OF(transferSyntaxes)));
-  OFBool           opt_secureConnection    = OFFalse; /* default: no secure connection */
   int              opt_acse_timeout        = 30;
   OFCmdSignedInt   opt_socket_timeout      = 60;
-
-#ifdef WITH_OPENSSL
-  int         opt_keyFileFormat = SSL_FILETYPE_PEM;
-  OFBool      opt_doAuthenticate = OFFalse;
-  const char *opt_privateKeyFile = NULL;
-  const char *opt_certificateFile = NULL;
-  const char *opt_passwd = NULL;
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-  OFString    opt_ciphersuites(TLS1_TXT_RSA_WITH_AES_128_SHA ":" SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#else
-  OFString    opt_ciphersuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#endif
-  const char *opt_readSeedFile = NULL;
-  const char *opt_writeSeedFile = NULL;
-  DcmCertificateVerification opt_certVerification = DCV_requireCertificate;
-  const char *opt_dhparam = NULL;
-#endif
+  DcmTLSOptions    tlsOptions(NET_REQUESTOR);
 
   T_ASC_Network *net;
   T_ASC_Parameters *params;
@@ -163,6 +149,9 @@ main(int argc, char *argv[])
   OFString temp_str;
 
   OFStandard::initializeNetwork();
+#ifdef WITH_OPENSSL
+  DcmTLSTransportLayer::initializeOpenSSL();
+#endif
 
   char tempstr[20];
   OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "DICOM verification (C-ECHO) SCU", rcsid);
@@ -174,72 +163,38 @@ main(int argc, char *argv[])
 
   cmd.setOptionColumns(LONGCOL, SHORTCOL);
   cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2);
-   cmd.addOption("--help",                 "-h",      "print this help text and exit", OFCommandLine::AF_Exclusive);
-   cmd.addOption("--version",                         "print version information and exit", OFCommandLine::AF_Exclusive);
+   cmd.addOption("--help",              "-h",      "print this help text and exit", OFCommandLine::AF_Exclusive);
+   cmd.addOption("--version",                      "print version information and exit", OFCommandLine::AF_Exclusive);
    OFLog::addOptions(cmd);
 
   cmd.addGroup("network options:");
     cmd.addSubGroup("application entity titles:");
-      cmd.addOption("--aetitle",           "-aet", 1, "[a]etitle: string", "set my calling AE title (default: " APPLICATIONTITLE ")");
-      cmd.addOption("--call",              "-aec", 1, "[a]etitle: string", "set called AE title of peer (default: " PEERAPPLICATIONTITLE ")");
+      cmd.addOption("--aetitle",        "-aet", 1, "[a]etitle: string", "set my calling AE title (default: " APPLICATIONTITLE ")");
+      cmd.addOption("--call",           "-aec", 1, "[a]etitle: string", "set called AE title of peer (default: " PEERAPPLICATIONTITLE ")");
     cmd.addSubGroup("association negotiation debugging:");
       OFString opt5 = "[n]umber: integer (1..";
       sprintf(tempstr, "%ld", OFstatic_cast(long, maxXferSyntaxes));
       opt5 += tempstr;
       opt5 += ")";
-      cmd.addOption("--propose-ts",        "-pts", 1, opt5.c_str(), "propose n transfer syntaxes");
-      cmd.addOption("--propose-pc",        "-ppc", 1, "[n]umber: integer (1..128)", "propose n presentation contexts");
+      cmd.addOption("--propose-ts",     "-pts", 1, opt5.c_str(), "propose n transfer syntaxes");
+      cmd.addOption("--propose-pc",     "-ppc", 1, "[n]umber: integer (1..128)", "propose n presentation contexts");
 
     cmd.addSubGroup("other network options:");
-      cmd.addOption("--timeout",           "-to",  1, "[s]econds: integer (default: unlimited)", "timeout for connection requests");
+      cmd.addOption("--timeout",        "-to",  1, "[s]econds: integer (default: unlimited)", "timeout for connection requests");
       CONVERT_TO_STRING("[s]econds: integer (default: " << opt_socket_timeout << ")", optString1);
-      cmd.addOption("--socket-timeout",    "-ts",  1, optString1.c_str(), "timeout for network socket (0 for none)");
+      cmd.addOption("--socket-timeout", "-ts",  1, optString1.c_str(), "timeout for network socket (0 for none)");
       CONVERT_TO_STRING("[s]econds: integer (default: " << opt_acse_timeout << ")", optString2);
-      cmd.addOption("--acse-timeout",      "-ta",  1, optString2.c_str(), "timeout for ACSE messages");
-      cmd.addOption("--dimse-timeout",     "-td",  1, "[s]econds: integer (default: unlimited)", "timeout for DIMSE messages");
+      cmd.addOption("--acse-timeout",   "-ta",  1, optString2.c_str(), "timeout for ACSE messages");
+      cmd.addOption("--dimse-timeout",  "-td",  1, "[s]econds: integer (default: unlimited)", "timeout for DIMSE messages");
 
       CONVERT_TO_STRING("[n]umber of bytes: integer (" << ASC_MINIMUMPDUSIZE << ".." << ASC_MAXIMUMPDUSIZE << ")", optString3);
       CONVERT_TO_STRING("set max receive pdu to n bytes (default: " << opt_maxReceivePDULength << ")", optString4);
-      cmd.addOption("--max-pdu",           "-pdu", 1, optString3.c_str(), optString4.c_str());
-      cmd.addOption("--repeat",                    1, "[n]umber: integer", "repeat n times");
-      cmd.addOption("--abort",                        "abort association instead of releasing it");
+      cmd.addOption("--max-pdu",        "-pdu", 1, optString3.c_str(), optString4.c_str());
+      cmd.addOption("--repeat",                 1, "[n]umber: integer", "repeat n times");
+      cmd.addOption("--abort",                     "abort association instead of releasing it");
 
-#ifdef WITH_OPENSSL
-  cmd.addGroup("transport layer security (TLS) options:");
-    cmd.addSubGroup("transport protocol stack:");
-      cmd.addOption("--disable-tls",       "-tls",    "use normal TCP/IP connection (default)");
-      cmd.addOption("--enable-tls",        "+tls", 2, "[p]rivate key file, [c]ertificate file: string",
-                                                      "use authenticated secure TLS connection");
-      cmd.addOption("--anonymous-tls",     "+tla",    "use secure TLS connection without certificate");
-    cmd.addSubGroup("private key password (only with --enable-tls):");
-      cmd.addOption("--std-passwd",        "+ps",     "prompt user to type password on stdin (default)");
-      cmd.addOption("--use-passwd",        "+pw",  1, "[p]assword: string ",
-                                                      "use specified password");
-      cmd.addOption("--null-passwd",       "-pw",     "use empty string as password");
-    cmd.addSubGroup("key and certificate file format:");
-      cmd.addOption("--pem-keys",          "-pem",    "read keys and certificates as PEM file (default)");
-      cmd.addOption("--der-keys",          "-der",    "read keys and certificates as DER file");
-    cmd.addSubGroup("certification authority:");
-      cmd.addOption("--add-cert-file",     "+cf",  1, "[c]ertificate filename: string",
-                                                      "add certificate file to list of certificates", OFCommandLine::AF_NoWarning);
-      cmd.addOption("--add-cert-dir",      "+cd",  1, "[c]ertificate directory: string",
-                                                      "add certificates in d to list of certificates", OFCommandLine::AF_NoWarning);
-    cmd.addSubGroup("ciphersuite:");
-      cmd.addOption("--cipher",            "+cs",  1, "[c]iphersuite name: string",
-                                                      "add ciphersuite to list of negotiated suites");
-      cmd.addOption("--dhparam",           "+dp",  1, "[f]ilename: string",
-                                                      "read DH parameters for DH/DSS ciphersuites");
-    cmd.addSubGroup("pseudo random generator:");
-      cmd.addOption("--seed",              "+rs",  1, "[f]ilename: string",
-                                                      "seed random generator with contents of f");
-      cmd.addOption("--write-seed",        "+ws",     "write back modified seed (only with --seed)");
-      cmd.addOption("--write-seed-file",   "+wf",  1, "[f]ilename: string (only with --seed)",
-                                                      "write modified seed to file f");
-    cmd.addSubGroup("peer authentication:");
-      cmd.addOption("--require-peer-cert", "-rc",     "verify peer certificate, fail if absent (default)");
-      cmd.addOption("--verify-peer-cert",  "-vc",     "verify peer certificate if present");
-      cmd.addOption("--ignore-peer-cert",  "-ic",     "don't verify peer certificate");
-#endif
+    // add TLS specific command line options if (and only if) we are compiling with OpenSSL
+    tlsOptions.addTLSCommandlineOptions(cmd);
 
     /* evaluate command line */
     prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION);
@@ -260,10 +215,16 @@ main(int argc, char *argv[])
 #ifdef WITH_ZLIB
           COUT << "- ZLIB, Version " << zlibVersion() << OFendl;
 #endif
-#ifdef WITH_OPENSSL
-          COUT << "- " << OPENSSL_VERSION_TEXT << OFendl;
-#endif
-          return 0;
+          // print OpenSSL version if (and only if) we are compiling with OpenSSL
+          tlsOptions.printLibraryVersion();
+          return EXITCODE_NO_ERROR;
+        }
+
+        // check if the command line contains the --list-ciphers option
+        if (tlsOptions.listOfCiphersRequested(cmd))
+        {
+            tlsOptions.printSupportedCiphersuites(app, COUT);
+            return EXITCODE_NO_ERROR;
         }
       }
 
@@ -311,100 +272,9 @@ main(int argc, char *argv[])
       if (cmd.findOption("--propose-ts")) app.checkValue(cmd.getValueAndCheckMinMax(opt_numXferSyntaxes, 1, maxXferSyntaxes));
       if (cmd.findOption("--propose-pc")) app.checkValue(cmd.getValueAndCheckMinMax(opt_numPresentationCtx, 1, 128));
 
-#ifdef WITH_OPENSSL
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--disable-tls")) opt_secureConnection = OFFalse;
-      if (cmd.findOption("--enable-tls"))
-      {
-        opt_secureConnection = OFTrue;
-        opt_doAuthenticate = OFTrue;
-        app.checkValue(cmd.getValue(opt_privateKeyFile));
-        app.checkValue(cmd.getValue(opt_certificateFile));
-      }
-      if (cmd.findOption("--anonymous-tls"))
-      {
-        opt_secureConnection = OFTrue;
-      }
-      cmd.endOptionBlock();
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--std-passwd"))
-      {
-        app.checkDependence("--std-passwd", "--enable-tls", opt_doAuthenticate);
-        opt_passwd = NULL;
-      }
-      if (cmd.findOption("--use-passwd"))
-      {
-        app.checkDependence("--use-passwd", "--enable-tls", opt_doAuthenticate);
-        app.checkValue(cmd.getValue(opt_passwd));
-      }
-      if (cmd.findOption("--null-passwd"))
-      {
-        app.checkDependence("--null-passwd", "--enable-tls", opt_doAuthenticate);
-        opt_passwd = "";
-      }
-      cmd.endOptionBlock();
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--pem-keys")) opt_keyFileFormat = SSL_FILETYPE_PEM;
-      if (cmd.findOption("--der-keys")) opt_keyFileFormat = SSL_FILETYPE_ASN1;
-      cmd.endOptionBlock();
-
-      if (cmd.findOption("--dhparam"))
-      {
-        app.checkValue(cmd.getValue(opt_dhparam));
-      }
+      // evaluate (most of) the TLS command line options (if we are compiling with OpenSSL)
+      tlsOptions.parseArguments(app, cmd);
 
-      if (cmd.findOption("--seed"))
-      {
-        app.checkValue(cmd.getValue(opt_readSeedFile));
-      }
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--write-seed"))
-      {
-        app.checkDependence("--write-seed", "--seed", opt_readSeedFile != NULL);
-        opt_writeSeedFile = opt_readSeedFile;
-      }
-      if (cmd.findOption("--write-seed-file"))
-      {
-        app.checkDependence("--write-seed-file", "--seed", opt_readSeedFile != NULL);
-        app.checkValue(cmd.getValue(opt_writeSeedFile));
-      }
-      cmd.endOptionBlock();
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--require-peer-cert")) opt_certVerification = DCV_requireCertificate;
-      if (cmd.findOption("--verify-peer-cert"))  opt_certVerification = DCV_checkCertificate;
-      if (cmd.findOption("--ignore-peer-cert"))  opt_certVerification = DCV_ignoreCertificate;
-      cmd.endOptionBlock();
-
-      const char *current = NULL;
-      const char *currentOpenSSL;
-      if (cmd.findOption("--cipher", 0, OFCommandLine::FOM_First))
-      {
-        opt_ciphersuites.clear();
-        do
-        {
-          app.checkValue(cmd.getValue(current));
-          if (NULL == (currentOpenSSL = DcmTLSTransportLayer::findOpenSSLCipherSuiteName(current)))
-          {
-            OFLOG_FATAL(echoscuLogger, "ciphersuite '" << current << "' is unknown. Known ciphersuites are:");
-            unsigned long numSuites = DcmTLSTransportLayer::getNumberOfCipherSuites();
-            for (unsigned long cs=0; cs < numSuites; cs++)
-            {
-              OFLOG_FATAL(echoscuLogger, "    " << DcmTLSTransportLayer::getTLSCipherSuiteName(cs));
-            }
-            return 1;
-          } else {
-            if (!opt_ciphersuites.empty()) opt_ciphersuites += ":";
-            opt_ciphersuites += currentOpenSSL;
-          }
-        } while (cmd.findOption("--cipher", 0, OFCommandLine::FOM_Next));
-      }
-
-#endif
     }
 
     /* print resource identifier */
@@ -424,89 +294,6 @@ main(int argc, char *argv[])
         exit(1);
     }
 
-#ifdef WITH_OPENSSL
-
-    DcmTLSTransportLayer *tLayer = NULL;
-    if (opt_secureConnection)
-    {
-      tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_REQUESTOR, opt_readSeedFile);
-      if (tLayer == NULL)
-      {
-        OFLOG_FATAL(echoscuLogger, "unable to create TLS transport layer");
-        return 1;
-      }
-
-      if (cmd.findOption("--add-cert-file", 0, OFCommandLine::FOM_First))
-      {
-        const char *current = NULL;
-        do
-        {
-          app.checkValue(cmd.getValue(current));
-          if (TCS_ok != tLayer->addTrustedCertificateFile(current, opt_keyFileFormat))
-          {
-              OFLOG_WARN(echoscuLogger, "unable to load certificate file '" << current << "', ignoring");
-          }
-        } while (cmd.findOption("--add-cert-file", 0, OFCommandLine::FOM_Next));
-      }
-
-      if (cmd.findOption("--add-cert-dir", 0, OFCommandLine::FOM_First))
-      {
-        const char *current = NULL;
-        do
-        {
-          app.checkValue(cmd.getValue(current));
-          if (TCS_ok != tLayer->addTrustedCertificateDir(current, opt_keyFileFormat))
-          {
-            OFLOG_WARN(echoscuLogger, "unable to load certificates from directory '" << current << "', ignoring");
-          }
-        } while (cmd.findOption("--add-cert-dir", 0, OFCommandLine::FOM_Next));
-      }
-
-      if (opt_dhparam && ! (tLayer->setTempDHParameters(opt_dhparam)))
-      {
-        OFLOG_WARN(echoscuLogger, "unable to load temporary DH parameter file '" << opt_dhparam << "', ignoring");
-      }
-
-      if (opt_doAuthenticate)
-      {
-        if (opt_passwd) tLayer->setPrivateKeyPasswd(opt_passwd);
-
-        if (TCS_ok != tLayer->setPrivateKeyFile(opt_privateKeyFile, opt_keyFileFormat))
-        {
-          OFLOG_ERROR(echoscuLogger, "unable to load private TLS key from '" << opt_privateKeyFile << "'");
-          return 1;
-        }
-        if (TCS_ok != tLayer->setCertificateFile(opt_certificateFile, opt_keyFileFormat))
-        {
-          OFLOG_ERROR(echoscuLogger, "unable to load certificate from '" << opt_certificateFile << "'");
-          return 1;
-        }
-        if (! tLayer->checkPrivateKeyMatchesCertificate())
-        {
-          OFLOG_ERROR(echoscuLogger, "private key '" << opt_privateKeyFile << "' and certificate '" << opt_certificateFile << "' do not match");
-          return 1;
-        }
-      }
-
-      if (TCS_ok != tLayer->setCipherSuites(opt_ciphersuites.c_str()))
-      {
-        OFLOG_ERROR(echoscuLogger, "unable to set selected cipher suites");
-        return 1;
-      }
-
-      tLayer->setCertificateVerification(opt_certVerification);
-
-
-      cond = ASC_setTransportLayer(net, tLayer, 0);
-      if (cond.bad())
-      {
-          OFLOG_FATAL(echoscuLogger, DimseCondition::dump(temp_str, cond));
-          return 1;
-      }
-    }
-
-#endif
-
     /* initialize association parameters, i.e. create an instance of T_ASC_Parameters*. */
     cond = ASC_createAssociationParameters(&params, opt_maxReceivePDULength);
     if (cond.bad()) {
@@ -514,6 +301,13 @@ main(int argc, char *argv[])
         exit(1);
     }
 
+    /* create a secure transport layer if requested and OpenSSL is available */
+    cond = tlsOptions.createTransportLayer(net, params, app, cmd);
+    if (cond.bad()) {
+        OFLOG_FATAL(echoscuLogger, DimseCondition::dump(temp_str, cond));
+        exit(1);
+    }
+
 #ifdef PRIVATE_ECHOSCU_CODE
     PRIVATE_ECHOSCU_CODE
 #endif
@@ -522,15 +316,6 @@ main(int argc, char *argv[])
     /* structure. The default values to be set here are "STORESCU" and "ANY-SCP". */
     ASC_setAPTitles(params, opt_ourTitle, opt_peerTitle, NULL);
 
-    /* Set the transport layer type (type of network connection) in the params */
-    /* structure. The default is an insecure connection; where OpenSSL is  */
-    /* available the user is able to request an encrypted,secure connection. */
-    cond = ASC_setTransportLayerType(params, opt_secureConnection);
-    if (cond.bad()) {
-        OFLOG_FATAL(echoscuLogger, DimseCondition::dump(temp_str, cond));
-        return 1;
-    }
-
     /* Figure out the presentation addresses and copy the */
     /* corresponding values into the association parameters.*/
     sprintf(peerHost, "%s:%d", opt_peer, OFstatic_cast(int, opt_port));
@@ -616,6 +401,7 @@ main(int argc, char *argv[])
         OFLOG_FATAL(echoscuLogger, "Protocol Error: Peer requested release (Aborting)");
         OFLOG_INFO(echoscuLogger, "Aborting Association");
         cond = ASC_abortAssociation(assoc);
+        result = EXITCODE_ASSOCIATION_ABORTED;// return an error code at the end of main
         if (cond.bad()) {
             OFLOG_FATAL(echoscuLogger, "Association Abort Failed: " << DimseCondition::dump(temp_str, cond));
             exit(1);
@@ -630,6 +416,7 @@ main(int argc, char *argv[])
         OFLOG_ERROR(echoscuLogger, "Echo SCU Failed: " << DimseCondition::dump(temp_str, cond));
         OFLOG_INFO(echoscuLogger, "Aborting Association");
         cond = ASC_abortAssociation(assoc);
+        result = EXITCODE_ASSOCIATION_ABORTED; // return an error code at the end of main
         if (cond.bad()) {
             OFLOG_FATAL(echoscuLogger, "Association Abort Failed: " << DimseCondition::dump(temp_str, cond));
             exit(1);
@@ -654,23 +441,13 @@ main(int argc, char *argv[])
 
     OFStandard::shutdownNetwork();
 
-#ifdef WITH_OPENSSL
-    if (tLayer && opt_writeSeedFile)
-    {
-      if (tLayer->canWriteRandomSeed())
-      {
-        if (!tLayer->writeRandomSeed(opt_writeSeedFile))
-        {
-          OFLOG_ERROR(echoscuLogger, "cannot write random seed file '" << opt_writeSeedFile << "', ignoring");
-        }
-      } else {
-        OFLOG_ERROR(echoscuLogger, "cannot write random seed, ignoring");
-      }
+    cond = tlsOptions.writeRandomSeed();
+    if (cond.bad()) {
+        // failure to write back the random seed is a warning, not an error
+        OFLOG_WARN(echoscuLogger, DimseCondition::dump(temp_str, cond));
     }
-    delete tLayer;
-#endif
 
-    return 0;
+    return result;
 }
 
 static OFCondition
index 307e69ad66a922eceac2db211ec793816bbaa4bd..6194803d3e027a890186940a98c26965ac1f3be6 100644 (file)
@@ -27,6 +27,7 @@
 #include "dcmtk/ofstd/ofconapp.h"
 #include "dcmtk/dcmdata/dcdict.h"
 #include "dcmtk/dcmdata/dcostrmz.h"     /* for dcmZlibCompressionLevel */
+#include "dcmtk/dcmtls/tlsopt.h"        /* for DcmTLSOptions */
 
 #ifdef WITH_ZLIB
 #include <zlib.h>                       /* for zlibVersion() */
 #include "dcmtk/ofstd/ofchrenc.h"       /* for OFCharacterEncoding */
 #endif
 
-#ifdef WITH_OPENSSL
-#include "dcmtk/dcmtls/tlstrans.h"
-#include "dcmtk/dcmtls/tlslayer.h"
-#endif
-
 #define OFFIS_CONSOLE_APPLICATION "findscu"
 
 static OFLogger findscuLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION);
@@ -74,30 +70,13 @@ int main(int argc, char *argv[])
     const char *          opt_peerTitle = PEERAPPLICATIONTITLE;
     OFCmdUnsignedInt      opt_port = 104;
     OFCmdUnsignedInt      opt_repeatCount = 1;
-    OFBool                opt_secureConnection = OFFalse; /* default: no secure connection */
     OFList<OFString>      overrideKeys;
+    DcmTLSOptions         tlsOptions(NET_REQUESTOR);
 
 #ifdef WITH_ZLIB
     OFCmdUnsignedInt      opt_compressionLevel = 0;
 #endif
 
-#ifdef WITH_OPENSSL
-    const char *          opt_certificateFile = NULL;
-    OFBool                opt_doAuthenticate = OFFalse;
-    int                   opt_keyFileFormat = SSL_FILETYPE_PEM;
-    const char *          opt_passwd = NULL;
-    const char *          opt_privateKeyFile = NULL;
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-    OFString              opt_ciphersuites(TLS1_TXT_RSA_WITH_AES_128_SHA ":" SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#else
-    OFString              opt_ciphersuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#endif
-    const char *          opt_dhparam = NULL;
-    const char *          opt_readSeedFile = NULL;
-    const char *          opt_writeSeedFile = NULL;
-    DcmCertificateVerification  opt_certVerification = DCV_requireCertificate;
-#endif
-
     /*
     ** By default. don't let "dcmdata" remove trailing padding or
     ** perform other manipulations. We want to see the real data.
@@ -105,6 +84,9 @@ int main(int argc, char *argv[])
     OFBool                opt_automaticDataCorrection = OFFalse;
 
   OFStandard::initializeNetwork();
+#ifdef WITH_OPENSSL
+  DcmTLSTransportLayer::initializeOpenSSL();
+#endif
 
   char tempstr[20];
   OFString temp_str;
@@ -177,42 +159,8 @@ int main(int argc, char *argv[])
       cmd.addOption("--cancel",                     1, "[n]umber: integer",
                                                        "cancel after n responses (default: never)");
 
-#ifdef WITH_OPENSSL
-  cmd.addGroup("transport layer security (TLS) options:");
-    cmd.addSubGroup("transport protocol stack:");
-      cmd.addOption("--disable-tls",        "-tls",    "use normal TCP/IP connection (default)");
-      cmd.addOption("--enable-tls",         "+tls", 2, "[p]rivate key file, [c]ertificate file: string",
-                                                       "use authenticated secure TLS connection");
-      cmd.addOption("--anonymous-tls",      "+tla",    "use secure TLS connection without certificate");
-    cmd.addSubGroup("private key password (only with --enable-tls):");
-      cmd.addOption("--std-passwd",         "+ps",     "prompt user to type password on stdin (default)");
-      cmd.addOption("--use-passwd",         "+pw",  1, "[p]assword: string ",
-                                                       "use specified password");
-      cmd.addOption("--null-passwd",        "-pw",     "use empty string as password");
-    cmd.addSubGroup("key and certificate file format:");
-      cmd.addOption("--pem-keys",           "-pem",    "read keys and certificates as PEM file (default)");
-      cmd.addOption("--der-keys",           "-der",    "read keys and certificates as DER file");
-    cmd.addSubGroup("certification authority:");
-      cmd.addOption("--add-cert-file",      "+cf",  1, "[c]ertificate filename: string",
-                                                       "add certificate file to list of certificates", OFCommandLine::AF_NoWarning);
-      cmd.addOption("--add-cert-dir",       "+cd",  1, "[c]ertificate directory: string",
-                                                       "add certificates in d to list of certificates", OFCommandLine::AF_NoWarning);
-    cmd.addSubGroup("ciphersuite:");
-      cmd.addOption("--cipher",             "+cs",  1, "[c]iphersuite name: string",
-                                                       "add ciphersuite to list of negotiated suites");
-      cmd.addOption("--dhparam",            "+dp",  1, "[f]ilename: string",
-                                                       "read DH parameters for DH/DSS ciphersuites");
-    cmd.addSubGroup("pseudo random generator:");
-      cmd.addOption("--seed",               "+rs",  1, "[f]ilename: string",
-                                                       "seed random generator with contents of f");
-      cmd.addOption("--write-seed",         "+ws",     "write back modified seed (only with --seed)");
-      cmd.addOption("--write-seed-file",    "+wf",  1, "[f]ilename: string (only with --seed)",
-                                                       "write modified seed to file f");
-    cmd.addSubGroup("peer authentication:");
-      cmd.addOption("--require-peer-cert",  "-rc",     "verify peer certificate, fail if absent (def.)");
-      cmd.addOption("--verify-peer-cert",   "-vc",     "verify peer certificate if present");
-      cmd.addOption("--ignore-peer-cert",   "-ic",     "don't verify peer certificate");
-#endif
+  // add TLS specific command line options if (and only if) we are compiling with OpenSSL
+  tlsOptions.addTLSCommandlineOptions(cmd);
 
   cmd.addGroup("output options:");
     cmd.addSubGroup("general:");
@@ -248,14 +196,20 @@ int main(int argc, char *argv[])
 #ifdef WITH_ZLIB
           COUT << "- ZLIB, Version " << zlibVersion() << OFendl;
 #endif
-#ifdef WITH_OPENSSL
-          COUT << "- " << OPENSSL_VERSION_TEXT << OFendl;
-#endif
+          // print OpenSSL version if (and only if) we are compiling with OpenSSL
+          tlsOptions.printLibraryVersion();
 #ifdef DCMTK_ENABLE_CHARSET_CONVERSION
           COUT << "- " << OFCharacterEncoding::getLibraryVersionString() << OFendl;
 #endif
           return 0;
         }
+
+        // check if the command line contains the --list-ciphers option
+        if (tlsOptions.listOfCiphersRequested(cmd))
+        {
+            tlsOptions.printSupportedCiphersuites(app, COUT);
+            return 0;
+        }
       }
 
       /* command line parameters */
@@ -379,101 +333,8 @@ int main(int argc, char *argv[])
         app.printError("either query file or override keys (or both) must be specified");
       }
 
-#ifdef WITH_OPENSSL
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--disable-tls")) opt_secureConnection = OFFalse;
-      if (cmd.findOption("--enable-tls"))
-      {
-        opt_secureConnection = OFTrue;
-        opt_doAuthenticate = OFTrue;
-        app.checkValue(cmd.getValue(opt_privateKeyFile));
-        app.checkValue(cmd.getValue(opt_certificateFile));
-      }
-      if (cmd.findOption("--anonymous-tls"))
-      {
-        opt_secureConnection = OFTrue;
-      }
-      cmd.endOptionBlock();
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--std-passwd"))
-      {
-        app.checkDependence("--std-passwd", "--enable-tls", opt_doAuthenticate);
-        opt_passwd = NULL;
-      }
-      if (cmd.findOption("--use-passwd"))
-      {
-        app.checkDependence("--use-passwd", "--enable-tls", opt_doAuthenticate);
-        app.checkValue(cmd.getValue(opt_passwd));
-      }
-      if (cmd.findOption("--null-passwd"))
-      {
-        app.checkDependence("--null-passwd", "--enable-tls", opt_doAuthenticate);
-        opt_passwd = "";
-      }
-      cmd.endOptionBlock();
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--pem-keys")) opt_keyFileFormat = SSL_FILETYPE_PEM;
-      if (cmd.findOption("--der-keys")) opt_keyFileFormat = SSL_FILETYPE_ASN1;
-      cmd.endOptionBlock();
-
-      if (cmd.findOption("--dhparam"))
-      {
-        app.checkValue(cmd.getValue(opt_dhparam));
-      }
-
-      if (cmd.findOption("--seed"))
-      {
-        app.checkValue(cmd.getValue(opt_readSeedFile));
-      }
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--write-seed"))
-      {
-        app.checkDependence("--write-seed", "--seed", opt_readSeedFile != NULL);
-        opt_writeSeedFile = opt_readSeedFile;
-      }
-      if (cmd.findOption("--write-seed-file"))
-      {
-        app.checkDependence("--write-seed-file", "--seed", opt_readSeedFile != NULL);
-        app.checkValue(cmd.getValue(opt_writeSeedFile));
-      }
-      cmd.endOptionBlock();
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--require-peer-cert")) opt_certVerification = DCV_requireCertificate;
-      if (cmd.findOption("--verify-peer-cert"))  opt_certVerification = DCV_checkCertificate;
-      if (cmd.findOption("--ignore-peer-cert"))  opt_certVerification = DCV_ignoreCertificate;
-      cmd.endOptionBlock();
-
-      const char *current = NULL;
-      const char *currentOpenSSL;
-      if (cmd.findOption("--cipher", 0, OFCommandLine::FOM_First))
-      {
-        opt_ciphersuites.clear();
-        do
-        {
-          app.checkValue(cmd.getValue(current));
-          if (NULL == (currentOpenSSL = DcmTLSTransportLayer::findOpenSSLCipherSuiteName(current)))
-          {
-            OFLOG_FATAL(findscuLogger, "ciphersuite '" << current << "' is unknown. Known ciphersuites are:");
-            unsigned long numSuites = DcmTLSTransportLayer::getNumberOfCipherSuites();
-            for (unsigned long cs=0; cs < numSuites; cs++)
-            {
-              OFLOG_FATAL(findscuLogger, "    " << DcmTLSTransportLayer::getTLSCipherSuiteName(cs));
-            }
-            return 1;
-          } else {
-            if (!opt_ciphersuites.empty()) opt_ciphersuites += ":";
-            opt_ciphersuites += currentOpenSSL;
-          }
-        } while (cmd.findOption("--cipher", 0, OFCommandLine::FOM_Next));
-      }
-
-#endif
-
+      // evaluate (most of) the TLS command line options (if we are compiling with OpenSSL)
+      tlsOptions.parseArguments(app, cmd);
     }
 
     if (opt_outputResponsesToLogger == 0)
@@ -539,85 +400,24 @@ int main(int argc, char *argv[])
     }
 
 #ifdef WITH_OPENSSL
-
-    DcmTLSTransportLayer *tLayer = NULL;
-    if (opt_secureConnection)
+    if (tlsOptions.secureConnectionRequested())
     {
-      tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_REQUESTOR, opt_readSeedFile);
-      if (tLayer == NULL)
-      {
-        OFLOG_FATAL(findscuLogger, "unable to create TLS transport layer");
-        return 1;
-      }
-
-      if (cmd.findOption("--add-cert-file", 0, OFCommandLine::FOM_First))
-      {
-        const char *current = NULL;
-        do
-        {
-          app.checkValue(cmd.getValue(current));
-          if (TCS_ok != tLayer->addTrustedCertificateFile(current, opt_keyFileFormat))
-          {
-            OFLOG_WARN(findscuLogger, "unable to load certificate file '" << current << "', ignoring");
-          }
-        } while (cmd.findOption("--add-cert-file", 0, OFCommandLine::FOM_Next));
-      }
-
-      if (cmd.findOption("--add-cert-dir", 0, OFCommandLine::FOM_First))
-      {
-        const char *current = NULL;
-        do
-        {
-          app.checkValue(cmd.getValue(current));
-          if (TCS_ok != tLayer->addTrustedCertificateDir(current, opt_keyFileFormat))
-          {
-            OFLOG_WARN(findscuLogger, "unable to load certificates from directory '" << current << "', ignoring");
-          }
-        } while (cmd.findOption("--add-cert-dir", 0, OFCommandLine::FOM_Next));
-      }
-
-      if (opt_dhparam && ! (tLayer->setTempDHParameters(opt_dhparam)))
-      {
-        OFLOG_WARN(findscuLogger, "unable to load temporary DH parameter file '" << opt_dhparam << "', ignoring");
-      }
-
-      if (opt_doAuthenticate)
-      {
-        if (opt_passwd) tLayer->setPrivateKeyPasswd(opt_passwd);
-
-        if (TCS_ok != tLayer->setPrivateKeyFile(opt_privateKeyFile, opt_keyFileFormat))
-        {
-          OFLOG_FATAL(findscuLogger, "unable to load private TLS key from '" << opt_privateKeyFile << "'");
-          return 1;
-        }
-        if (TCS_ok != tLayer->setCertificateFile(opt_certificateFile, opt_keyFileFormat))
-        {
-          OFLOG_FATAL(findscuLogger, "unable to load certificate from '" << opt_certificateFile << "'");
-          return 1;
-        }
-        if (! tLayer->checkPrivateKeyMatchesCertificate())
-        {
-          OFLOG_FATAL(findscuLogger, "private key '" << opt_privateKeyFile << "' and certificate '" << opt_certificateFile << "' do not match");
-          return 1;
-        }
-      }
-
-      if (TCS_ok != tLayer->setCipherSuites(opt_ciphersuites.c_str()))
-      {
-        OFLOG_FATAL(findscuLogger, "unable to set selected cipher suites");
-        return 1;
-      }
-
-      tLayer->setCertificateVerification(opt_certVerification);
-
-      cond = findscu.setTransportLayer(tLayer);
-      if (cond.bad())
-      {
-          OFLOG_ERROR(findscuLogger, DimseCondition::dump(temp_str, cond));
-          return 1;
-      }
+       /* create a secure transport layer */
+       cond = tlsOptions.createTransportLayer(NULL, NULL, app, cmd);
+       if (cond.bad())
+       {
+           OFLOG_FATAL(findscuLogger, DimseCondition::dump(temp_str, cond));
+           return 1;
+       }
+
+       /* activate secure transport layer */
+       cond = findscu.setTransportLayer(tlsOptions.getTransportLayer());
+       if (cond.bad())
+       {
+           OFLOG_ERROR(findscuLogger, DimseCondition::dump(temp_str, cond));
+           return 1;
+       }
     }
-
 #endif
 
     // do the main work: negotiate network association, perform C-FIND transaction,
@@ -632,7 +432,7 @@ int main(int argc, char *argv[])
       opt_blockMode,
       opt_dimse_timeout,
       opt_maxReceivePDULength,
-      opt_secureConnection,
+      tlsOptions.secureConnectionRequested(),
       opt_abortAssociation,
       opt_repeatCount,
       opt_extractResponses,
@@ -649,22 +449,11 @@ int main(int argc, char *argv[])
 
     OFStandard::shutdownNetwork();
 
-#ifdef WITH_OPENSSL
-    if (tLayer && opt_writeSeedFile)
-    {
-      if (tLayer->canWriteRandomSeed())
-      {
-        if (!tLayer->writeRandomSeed(opt_writeSeedFile))
-        {
-          OFLOG_ERROR(findscuLogger, "cannot write random seed file '" << opt_writeSeedFile << "', ignoring");
-        }
-      } else {
-        OFLOG_ERROR(findscuLogger, "cannot write random seed, ignoring");
-      }
+    cond = tlsOptions.writeRandomSeed();
+    if (cond.bad()) {
+        // failure to write back the random seed is a warning, not an error
+        OFLOG_WARN(findscuLogger, DimseCondition::dump(temp_str, cond));
     }
-    delete tLayer;
-
-#endif
 
     return 0;
 }
index cf7864328a0d0bc2aaa879a95fe76cc70b7efc09..7c406046557768286a2ab0a6f8ac7b3c53c2744c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -57,15 +57,8 @@ static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v"
 #define APPLICATIONTITLE        "MOVESCU"
 #define PEERAPPLICATIONTITLE    "ANY-SCP"
 
-// general
-#define EXITCODE_NO_ERROR                        0
-#define EXITCODE_COMMANDLINE_SYNTAX_ERROR        1      // this code is the default for printError()
-#define EXITCODE_INSUFFICIENT_PRIVILEGES         2
-#define EXITCODE_SETUID_FAILED                   3
-
-// output file errors
-#define EXITCODE_CANNOT_WRITE_OUTPUT_FILE       40
-#define EXITCODE_INVALID_OUTPUT_DIRECTORY       45
+/* exit codes for this command line tool */
+/* (common codes are defined in "ofexit.h" included from "ofconapp.h") */
 
 // network errors
 #define EXITCODE_CANNOT_INITIALIZE_NETWORK      60
@@ -168,7 +161,7 @@ addOverrideKey(OFConsoleApplication& app, const char *s)
       DcmTagKey key(0xffff,0xffff);
       const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock();
       const DcmDictEntry *dicent = globalDataDict.findEntry(dicName.c_str());
-      dcmDataDict.unlock();
+      dcmDataDict.rdunlock();
       if (dicent!=NULL) {
         // found dictionary name, copy group and element number
         key = dicent->getKey();
@@ -513,7 +506,7 @@ main(int argc, char *argv[])
 
       cmd.beginOptionBlock();
       if (cmd.findOption("--port"))    app.checkValue(cmd.getValueAndCheckMinMax(opt_retrievePort, 1, 65535));
-      if (cmd.findOption("--no-port")) { /* do nothing */ }
+      if (cmd.findOption("--no-port")) opt_retrievePort = 0;
       cmd.endOptionBlock();
 
       cmd.beginOptionBlock();
@@ -529,7 +522,11 @@ main(int argc, char *argv[])
       if (cmd.findOption("--cancel"))  app.checkValue(cmd.getValueAndCheckMin(opt_cancelAfterNResponses, 0));
       if (cmd.findOption("--uid-padding")) opt_correctUIDPadding = OFTrue;
 
-      if (cmd.findOption("--output-directory")) app.checkValue(cmd.getValue(opt_outputDirectory));
+      if (cmd.findOption("--output-directory"))
+      {
+        app.checkDependence("--output-directory", "--port", opt_retrievePort > 0);
+        app.checkValue(cmd.getValue(opt_outputDirectory));
+      }
 
       cmd.beginOptionBlock();
       if (cmd.findOption("--normal")) opt_bitPreserving = OFFalse;
@@ -1394,7 +1391,7 @@ storeSCPCallback(
         if ((rsp->DimseStatus == STATUS_Success) && !opt_ignore)
         {
           /* which SOP class and SOP instance ? */
-          if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sopInstance, opt_correctUIDPadding))
+          if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), opt_correctUIDPadding))
           {
              OFLOG_FATAL(movescuLogger, "bad DICOM file: " << imageFileName);
              rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand;
@@ -1428,7 +1425,7 @@ static OFCondition storeSCP(
 #ifdef _WIN32
         tmpnam(imageFileName);
 #else
-        strcpy(imageFileName, NULL_DEVICE_NAME);
+        OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, 2048);
 #endif
     } else {
         sprintf(imageFileName, "%s.%s",
@@ -1653,14 +1650,14 @@ moveSCU(T_ASC_Association *assoc, const char *fname)
     callbackData.presId = presId;
 
     req.MessageID = msgId;
-    strcpy(req.AffectedSOPClassUID, sopClass);
+    OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, sizeof(req.AffectedSOPClassUID));
     req.Priority = DIMSE_PRIORITY_MEDIUM;
     req.DataSetType = DIMSE_DATASET_PRESENT;
     if (opt_moveDestination == NULL) {
         /* set the destination to be me */
-        ASC_getAPTitles(assoc->params, req.MoveDestination, NULL, NULL);
+        ASC_getAPTitles(assoc->params, req.MoveDestination, sizeof(req.MoveDestination), NULL, 0, NULL, 0);
     } else {
-        strcpy(req.MoveDestination, opt_moveDestination);
+        OFStandard::strlcpy(req.MoveDestination, opt_moveDestination, sizeof(req.MoveDestination));
     }
 
     if (movescuLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL))
index ce427fadc22618f7012acbcd21851ced86bf5edf..d818e52475e6162378fd632bf22506a67bdd11ec 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -62,11 +62,7 @@ END_EXTERN_C
 #include "dcmtk/dcmdata/dcuid.h"        /* for dcmtk version name */
 #include "dcmtk/dcmdata/dcdeftag.h"
 #include "dcmtk/dcmdata/dcostrmz.h"     /* for dcmZlibCompressionLevel */
-
-#ifdef WITH_OPENSSL
-#include "dcmtk/dcmtls/tlstrans.h"
-#include "dcmtk/dcmtls/tlslayer.h"
-#endif
+#include "dcmtk/dcmtls/tlsopt.h"      /* for DcmTLSOptions */
 
 #ifdef WITH_ZLIB
 #include <zlib.h>        /* for zlibVersion() */
@@ -97,7 +93,7 @@ static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" OFFIS_DCMTK_VERS
 #define CALLING_PRESENTATION_ADDRESS_PLACEHOLDER "#r"
 
 static OFCondition processCommands(T_ASC_Association *assoc);
-static OFCondition acceptAssociation(T_ASC_Network *net, DcmAssociationConfiguration& asccfg);
+static OFCondition acceptAssociation(T_ASC_Network *net, DcmAssociationConfiguration& asccfg, OFBool secureConnection);
 static OFCondition echoSCP(T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID);
 static OFCondition storeSCP(T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID);
 static void executeOnReception();
@@ -157,7 +153,6 @@ OFString           lastCalledAETitle;
 OFString           callingPresentationAddress;        // remote hostname or IP address will be stored here
 OFString           lastCallingPresentationAddress;
 const char *       opt_respondingAETitle = APPLICATIONTITLE;
-static OFBool      opt_secureConnection = OFFalse;    // default: no secure connection
 static OFString    opt_outputDirectory = ".";         // default: output directory equals "."
 E_SortStudyMode    opt_sortStudyMode = ESM_None;      // default: no sorting
 static const char *opt_sortStudyDirPrefix = NULL;     // default: no directory prefix
@@ -185,22 +180,6 @@ OFBool             opt_forkMode = OFFalse;
 OFBool             opt_forkedChild = OFFalse;
 OFBool             opt_execSync = OFFalse;            // default: execute in background
 
-#ifdef WITH_OPENSSL
-static int         opt_keyFileFormat = SSL_FILETYPE_PEM;
-static const char *opt_privateKeyFile = NULL;
-static const char *opt_certificateFile = NULL;
-static const char *opt_passwd = NULL;
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-static OFString    opt_ciphersuites(TLS1_TXT_RSA_WITH_AES_128_SHA ":" SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#else
-static OFString    opt_ciphersuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#endif
-static const char *opt_readSeedFile = NULL;
-static const char *opt_writeSeedFile = NULL;
-static DcmCertificateVerification opt_certVerification = DCV_requireCertificate;
-static const char *opt_dhparam = NULL;
-#endif
-
 
 #ifdef HAVE_WAITPID
 /** signal handler for SIGCHLD signals that immediately cleans up
@@ -233,8 +212,12 @@ int main(int argc, char *argv[])
 {
   T_ASC_Network *net;
   DcmAssociationConfiguration asccfg;
+  DcmTLSOptions tlsOptions(NET_ACCEPTOR);
 
   OFStandard::initializeNetwork();
+#ifdef WITH_OPENSSL
+  DcmTLSTransportLayer::initializeOpenSSL();
+#endif
 
   OFString temp_str;
   OFOStringStream optStream;
@@ -326,41 +309,8 @@ int main(int argc, char *argv[])
       cmd.addOption("--promiscuous",            "-pm",     "promiscuous mode, accept unknown SOP classes\n(not with --config-file)");
       cmd.addOption("--uid-padding",            "-up",     "silently correct space-padded UIDs");
 
-#ifdef WITH_OPENSSL
-  cmd.addGroup("transport layer security (TLS) options:");
-    cmd.addSubGroup("transport protocol stack:");
-      cmd.addOption("--disable-tls",            "-tls",    "use normal TCP/IP connection (default)");
-      cmd.addOption("--enable-tls",             "+tls", 2, "[p]rivate key file, [c]ertificate file: string",
-                                                           "use authenticated secure TLS connection");
-    cmd.addSubGroup("private key password (only with --enable-tls):");
-      cmd.addOption("--std-passwd",             "+ps",     "prompt user to type password on stdin (default)");
-      cmd.addOption("--use-passwd",             "+pw",  1, "[p]assword: string",
-                                                           "use specified password");
-      cmd.addOption("--null-passwd",            "-pw",     "use empty string as password");
-    cmd.addSubGroup("key and certificate file format:");
-      cmd.addOption("--pem-keys",               "-pem",    "read keys and certificates as PEM file (def.)");
-      cmd.addOption("--der-keys",               "-der",    "read keys and certificates as DER file");
-    cmd.addSubGroup("certification authority:");
-      cmd.addOption("--add-cert-file",          "+cf",  1, "[c]ertificate filename: string",
-                                                           "add certificate file to list of certificates", OFCommandLine::AF_NoWarning);
-      cmd.addOption("--add-cert-dir",           "+cd",  1, "[c]ertificate directory: string",
-                                                           "add certificates in d to list of certificates", OFCommandLine::AF_NoWarning);
-    cmd.addSubGroup("ciphersuite:");
-      cmd.addOption("--cipher",                 "+cs",  1, "[c]iphersuite name: string",
-                                                           "add ciphersuite to list of negotiated suites");
-      cmd.addOption("--dhparam",                "+dp",  1, "[f]ilename: string",
-                                                           "read DH parameters for DH/DSS ciphersuites");
-    cmd.addSubGroup("pseudo random generator:");
-      cmd.addOption("--seed",                   "+rs",  1, "[f]ilename: string",
-                                                           "seed random generator with contents of f");
-      cmd.addOption("--write-seed",             "+ws",     "write back modified seed (only with --seed)");
-      cmd.addOption("--write-seed-file",        "+wf",  1, "[f]ilename: string (only with --seed)",
-                                                           "write modified seed to file f");
-    cmd.addSubGroup("peer authentication");
-      cmd.addOption("--require-peer-cert",      "-rc",     "verify peer certificate, fail if absent (def.)");
-      cmd.addOption("--verify-peer-cert",       "-vc",     "verify peer certificate if present");
-      cmd.addOption("--ignore-peer-cert",       "-ic",     "don't verify peer certificate");
-#endif
+    // add TLS specific command line options if (and only if) we are compiling with OpenSSL
+    tlsOptions.addTLSCommandlineOptions(cmd);
 
   cmd.addGroup("output options:");
     cmd.addSubGroup("general:");
@@ -445,14 +395,20 @@ int main(int argc, char *argv[])
 #ifdef WITH_ZLIB
         COUT << "- ZLIB, Version " << zlibVersion() << OFendl;
 #endif
-#ifdef WITH_OPENSSL
-        COUT << "- " << OPENSSL_VERSION_TEXT << OFendl;
-#endif
+        // print OpenSSL version if (and only if) we are compiling with OpenSSL
+        tlsOptions.printLibraryVersion();
 #ifdef WITH_TCPWRAPPER
         COUT << "- LIBWRAP" << OFendl;
 #endif
         return 0;
       }
+
+      // check if the command line contains the --list-ciphers option
+      if (tlsOptions.listOfCiphersRequested(cmd))
+      {
+          tlsOptions.printSupportedCiphersuites(app, COUT);
+          return 0;
+      }
     }
 
 #ifdef INETD_AVAILABLE
@@ -906,97 +862,8 @@ int main(int argc, char *argv[])
   /* print resource identifier */
   OFLOG_DEBUG(storescpLogger, rcsid << OFendl);
 
-#ifdef WITH_OPENSSL
-
-  cmd.beginOptionBlock();
-  if (cmd.findOption("--disable-tls")) opt_secureConnection = OFFalse;
-  if (cmd.findOption("--enable-tls"))
-  {
-    opt_secureConnection = OFTrue;
-    app.checkValue(cmd.getValue(opt_privateKeyFile));
-    app.checkValue(cmd.getValue(opt_certificateFile));
-  }
-  cmd.endOptionBlock();
-
-  cmd.beginOptionBlock();
-  if (cmd.findOption("--std-passwd"))
-  {
-    app.checkDependence("--std-passwd", "--enable-tls", opt_secureConnection);
-    opt_passwd = NULL;
-  }
-  if (cmd.findOption("--use-passwd"))
-  {
-    app.checkDependence("--use-passwd", "--enable-tls", opt_secureConnection);
-    app.checkValue(cmd.getValue(opt_passwd));
-  }
-  if (cmd.findOption("--null-passwd"))
-  {
-    app.checkDependence("--null-passwd", "--enable-tls", opt_secureConnection);
-    opt_passwd = "";
-  }
-  cmd.endOptionBlock();
-
-  cmd.beginOptionBlock();
-  if (cmd.findOption("--pem-keys")) opt_keyFileFormat = SSL_FILETYPE_PEM;
-  if (cmd.findOption("--der-keys")) opt_keyFileFormat = SSL_FILETYPE_ASN1;
-  cmd.endOptionBlock();
-
-  if (cmd.findOption("--dhparam"))
-  {
-    app.checkValue(cmd.getValue(opt_dhparam));
-  }
-
-  if (cmd.findOption("--seed"))
-  {
-    app.checkValue(cmd.getValue(opt_readSeedFile));
-  }
-
-  cmd.beginOptionBlock();
-  if (cmd.findOption("--write-seed"))
-  {
-    app.checkDependence("--write-seed", "--seed", opt_readSeedFile != NULL);
-    opt_writeSeedFile = opt_readSeedFile;
-  }
-  if (cmd.findOption("--write-seed-file"))
-  {
-    app.checkDependence("--write-seed-file", "--seed", opt_readSeedFile != NULL);
-    app.checkValue(cmd.getValue(opt_writeSeedFile));
-  }
-  cmd.endOptionBlock();
-
-  cmd.beginOptionBlock();
-  if (cmd.findOption("--require-peer-cert")) opt_certVerification = DCV_requireCertificate;
-  if (cmd.findOption("--verify-peer-cert"))  opt_certVerification = DCV_checkCertificate;
-  if (cmd.findOption("--ignore-peer-cert"))  opt_certVerification = DCV_ignoreCertificate;
-  cmd.endOptionBlock();
-
-  const char *current = NULL;
-  const char *currentOpenSSL;
-  if (cmd.findOption("--cipher", 0, OFCommandLine::FOM_First))
-  {
-    opt_ciphersuites.clear();
-    do
-    {
-      app.checkValue(cmd.getValue(current));
-      if (NULL == (currentOpenSSL = DcmTLSTransportLayer::findOpenSSLCipherSuiteName(current)))
-      {
-        OFLOG_FATAL(storescpLogger, "ciphersuite '" << current << "' is unknown, known ciphersuites are:");
-        unsigned long numSuites = DcmTLSTransportLayer::getNumberOfCipherSuites();
-        for (unsigned long cs = 0; cs < numSuites; cs++)
-        {
-          OFLOG_FATAL(storescpLogger, "    " << DcmTLSTransportLayer::getTLSCipherSuiteName(cs));
-        }
-        return 1;
-      }
-      else
-      {
-        if (!opt_ciphersuites.empty()) opt_ciphersuites += ":";
-        opt_ciphersuites += currentOpenSSL;
-      }
-    } while (cmd.findOption("--cipher", 0, OFCommandLine::FOM_Next));
-  }
-
-#endif
+  // evaluate (most of) the TLS command line options (if we are compiling with OpenSSL)
+  tlsOptions.parseArguments(app, cmd);
 
 #ifndef DISABLE_PORT_PERMISSION_CHECK
 #ifdef HAVE_GETEUID
@@ -1073,80 +940,12 @@ int main(int argc, char *argv[])
       return 1;
   }
 
-#ifdef WITH_OPENSSL
-  DcmTLSTransportLayer *tLayer = NULL;
-  if (opt_secureConnection)
-  {
-    tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_ACCEPTOR, opt_readSeedFile);
-    if (tLayer == NULL)
-    {
-      OFLOG_FATAL(storescpLogger, "unable to create TLS transport layer");
-      return 1;
-    }
-
-    if (cmd.findOption("--add-cert-file", 0, OFCommandLine::FOM_First))
-    {
-      do
-      {
-        app.checkValue(cmd.getValue(current));
-        if (TCS_ok != tLayer->addTrustedCertificateFile(current, opt_keyFileFormat))
-        {
-          OFLOG_WARN(storescpLogger, "unable to load certificate file '" << current << "', ignoring");
-        }
-      } while (cmd.findOption("--add-cert-file", 0, OFCommandLine::FOM_Next));
-    }
-
-    if (cmd.findOption("--add-cert-dir", 0, OFCommandLine::FOM_First))
-    {
-      do
-      {
-        app.checkValue(cmd.getValue(current));
-        if (TCS_ok != tLayer->addTrustedCertificateDir(current, opt_keyFileFormat))
-        {
-          OFLOG_WARN(storescpLogger, "unable to load certificates from directory '" << current << "', ignoring");
-        }
-      } while (cmd.findOption("--add-cert-dir", 0, OFCommandLine::FOM_Next));
-    }
-
-    if (opt_dhparam && !(tLayer->setTempDHParameters(opt_dhparam)))
-    {
-      OFLOG_WARN(storescpLogger, "unable to load temporary DH parameter file '" << opt_dhparam << "', ignoring");
-    }
-
-    if (opt_passwd) tLayer->setPrivateKeyPasswd(opt_passwd);
-
-    if (TCS_ok != tLayer->setPrivateKeyFile(opt_privateKeyFile, opt_keyFileFormat))
-    {
-      OFLOG_WARN(storescpLogger, "unable to load private TLS key from '" << opt_privateKeyFile << "'");
-      return 1;
-    }
-    if (TCS_ok != tLayer->setCertificateFile(opt_certificateFile, opt_keyFileFormat))
-    {
-      OFLOG_WARN(storescpLogger, "unable to load certificate from '" << opt_certificateFile << "'");
-      return 1;
-    }
-    if (! tLayer->checkPrivateKeyMatchesCertificate())
-    {
-      OFLOG_WARN(storescpLogger, "private key '" << opt_privateKeyFile << "' and certificate '" << opt_certificateFile << "' do not match");
-      return 1;
-    }
-
-    if (TCS_ok != tLayer->setCipherSuites(opt_ciphersuites.c_str()))
-    {
-      OFLOG_WARN(storescpLogger, "unable to set selected cipher suites");
-      return 1;
-    }
-
-    tLayer->setCertificateVerification(opt_certVerification);
-
-    cond = ASC_setTransportLayer(net, tLayer, 0);
-    if (cond.bad())
-    {
-      OFLOG_ERROR(storescpLogger, DimseCondition::dump(temp_str, cond));
-      return 1;
-    }
+  /* create a secure transport layer if requested and OpenSSL is available */
+  cond = tlsOptions.createTransportLayer(net, NULL, app, cmd);
+  if (cond.bad()) {
+      OFLOG_FATAL(storescpLogger, DimseCondition::dump(temp_str, cond));
+      exit(1);
   }
-#endif
 
 #ifdef HAVE_WAITPID
   // register signal handler
@@ -1157,27 +956,20 @@ int main(int argc, char *argv[])
   {
     /* receive an association and acknowledge or reject it. If the association was */
     /* acknowledged, offer corresponding services and invoke one or more if required. */
-    cond = acceptAssociation(net, asccfg);
+    cond = acceptAssociation(net, asccfg, tlsOptions.secureConnectionRequested());
 
     /* remove zombie child processes */
     cleanChildren(-1, OFFalse);
-#ifdef WITH_OPENSSL
+
     /* since storescp is usually terminated with SIGTERM or the like,
      * we write back an updated random seed after every association handled.
      */
-    if (tLayer && opt_writeSeedFile)
-    {
-      if (tLayer->canWriteRandomSeed())
-      {
-        if (!tLayer->writeRandomSeed(opt_writeSeedFile))
-          OFLOG_WARN(storescpLogger, "cannot write random seed file '" << opt_writeSeedFile << "', ignoring");
-      }
-      else
-      {
-        OFLOG_WARN(storescpLogger, "cannot write random seed, ignoring");
-      }
+    cond = tlsOptions.writeRandomSeed();
+    if (cond.bad()) {
+        // failure to write back the random seed is a warning, not an error
+        OFLOG_WARN(storescpLogger, DimseCondition::dump(temp_str, cond));
     }
-#endif
+
     // if running in inetd mode, we always terminate after one association
     if (opt_inetd_mode) break;
 
@@ -1195,16 +987,11 @@ int main(int argc, char *argv[])
   }
 
   OFStandard::shutdownNetwork();
-
-#ifdef WITH_OPENSSL
-  delete tLayer;
-#endif
-
   return 0;
 }
 
 
-static OFCondition acceptAssociation(T_ASC_Network *net, DcmAssociationConfiguration& asccfg)
+static OFCondition acceptAssociation(T_ASC_Network *net, DcmAssociationConfiguration& asccfg, OFBool secureConnection)
 {
   char buf[BUFSIZ];
   T_ASC_Association *assoc;
@@ -1229,9 +1016,9 @@ static OFCondition acceptAssociation(T_ASC_Network *net, DcmAssociationConfigura
   // try to receive an association. Here we either want to use blocking or
   // non-blocking, depending on if the option --eostudy-timeout is set.
   if( opt_endOfStudyTimeout == -1 )
-    cond = ASC_receiveAssociation(net, &assoc, opt_maxPDU, NULL, NULL, opt_secureConnection);
+    cond = ASC_receiveAssociation(net, &assoc, opt_maxPDU, NULL, NULL, secureConnection);
   else
-    cond = ASC_receiveAssociation(net, &assoc, opt_maxPDU, NULL, NULL, opt_secureConnection, DUL_NOBLOCK, OFstatic_cast(int, opt_endOfStudyTimeout));
+    cond = ASC_receiveAssociation(net, &assoc, opt_maxPDU, NULL, NULL, secureConnection, DUL_NOBLOCK, OFstatic_cast(int, opt_endOfStudyTimeout));
 
   if (cond.code() == DULC_FORKEDCHILD)
   {
@@ -1593,7 +1380,7 @@ static OFCondition acceptAssociation(T_ASC_Network *net, DcmAssociationConfigura
   ASC_setAPTitles(assoc->params, NULL, NULL, opt_respondingAETitle);
 
   /* acknowledge or reject this association */
-  cond = ASC_getApplicationContextName(assoc->params, buf);
+  cond = ASC_getApplicationContextName(assoc->params, buf, sizeof(buf));
   if ((cond.bad()) || strcmp(buf, UID_StandardApplicationContext) != 0)
   {
     /* reject: the application context name is not supported */
@@ -1675,7 +1462,7 @@ static OFCondition acceptAssociation(T_ASC_Network *net, DcmAssociationConfigura
   // aetitles may contain space characters.
   DIC_AE callingTitle;
   DIC_AE calledTitle;
-  if (ASC_getAPTitles(assoc->params, callingTitle, calledTitle, NULL).good())
+  if (ASC_getAPTitles(assoc->params, callingTitle, sizeof(callingTitle), calledTitle,  sizeof(calledTitle), NULL, 0).good())
   {
     callingAETitle = "\"";
     callingAETitle += OFSTRING_GUARD(callingTitle);
@@ -2155,7 +1942,7 @@ storeSCPCallback(
       if (rsp->DimseStatus == STATUS_Success)
       {
         // which SOP class and SOP instance ?
-        if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sopInstance, opt_correctUIDPadding))
+        if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), opt_correctUIDPadding))
         {
            OFLOG_ERROR(storescpLogger, "bad DICOM file: " << fileName);
            rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand;
@@ -2213,7 +2000,7 @@ static OFCondition storeSCP(
 #ifdef _WIN32
     tmpnam(imageFileName);
 #else
-    strcpy(imageFileName, NULL_DEVICE_NAME);
+    OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, 2048);
 #endif
   }
   else
@@ -2470,7 +2257,7 @@ static void renameOnEndOfStudy()
     // determine the new file name: The first two characters of the old file name make up the [modality-prefix].
     // The value for [consecutive-numbering] will be determined using the counter variable.
     char modalityId[3];
-    char newFileName[9];
+    char newFileName[20];
     if (opt_timeNames)
     {
       // modality prefix are the first 2 characters after serial number (if present)
@@ -2644,7 +2431,7 @@ static void cleanChildren(pid_t pid, OFBool synch)
 {
 #ifdef HAVE_WAITPID
   int stat_loc;
-#elif HAVE_WAIT3
+#elif defined(HAVE_WAIT3)
   struct rusage rusage;
 #if defined(__NeXT__)
   /* some systems need a union wait as argument to wait3 */
index 8f7aba6fc8024557b5c48c3dfb0aec6809333e08..9e38e178f350c9cea80f29069e5b5d31e821429c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2017, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -52,6 +52,7 @@ END_EXTERN_C
 #include "dcmtk/dcmdata/cmdlnarg.h"
 #include "dcmtk/dcmdata/dcuid.h"     /* for dcmtk version name */
 #include "dcmtk/dcmdata/dcostrmz.h"  /* for dcmZlibCompressionLevel */
+#include "dcmtk/dcmtls/tlsopt.h"      /* for DcmTLSOptions */
 
 #ifdef ON_THE_FLY_COMPRESSION
 #include "dcmtk/dcmjpeg/djdecode.h"  /* for JPEG decoders */
@@ -63,11 +64,6 @@ END_EXTERN_C
 #include "dcmtk/dcmjpeg/dipijpeg.h"  /* for dcmimage JPEG plugin */
 #endif
 
-#ifdef WITH_OPENSSL
-#include "dcmtk/dcmtls/tlstrans.h"
-#include "dcmtk/dcmtls/tlslayer.h"
-#endif
-
 #ifdef WITH_ZLIB
 #include <zlib.h>          /* for zlibVersion() */
 #endif
@@ -115,7 +111,6 @@ static OFString patientNamePrefix("OFFIS^TEST_PN_");   // PatientName is PN (max
 static OFString patientIDPrefix("PID_"); // PatientID is LO (maximum 64 chars)
 static OFString studyIDPrefix("SID_");   // StudyID is SH (maximum 16 chars)
 static OFString accessionNumberPrefix;   // AccessionNumber is SH (maximum 16 chars)
-static OFBool opt_secureConnection = OFFalse; /* default: no secure connection */
 static const char *opt_configFile = NULL;
 static const char *opt_profileName = NULL;
 T_DIMSE_BlockingMode opt_blockMode = DIMSE_BLOCKING;
@@ -127,23 +122,6 @@ OFCmdSignedInt opt_socket_timeout = 60;
 static OFCmdUnsignedInt opt_compressionLevel = 0;
 #endif
 
-#ifdef WITH_OPENSSL
-static int         opt_keyFileFormat = SSL_FILETYPE_PEM;
-static OFBool      opt_doAuthenticate = OFFalse;
-static const char *opt_privateKeyFile = NULL;
-static const char *opt_certificateFile = NULL;
-static const char *opt_passwd = NULL;
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-static OFString    opt_ciphersuites(TLS1_TXT_RSA_WITH_AES_128_SHA ":" SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#else
-static OFString    opt_ciphersuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#endif
-static const char *opt_readSeedFile = NULL;
-static const char *opt_writeSeedFile = NULL;
-static DcmCertificateVerification opt_certVerification = DCV_requireCertificate;
-static const char *opt_dhparam = NULL;
-#endif
-
 // User Identity Negotiation
 static T_ASC_UserIdentityNegotiationMode opt_identMode = ASC_USER_IDENTITY_NONE;
 static OFString opt_user;
@@ -158,7 +136,12 @@ static OFCondition
 cstore(T_ASC_Association *assoc, const OFString &fname);
 
 static OFBool
-findSOPClassAndInstanceInFile(const char *fname, char *sopClass, char *sopInstance);
+findSOPClassAndInstanceInFile(
+  const char *fname,
+  char *sopClass,
+  size_t sopClassSize,
+  char *sopInstance,
+  size_t sopInstanceSize);
 
 static OFCondition
 configureUserIdentityRequest(T_ASC_Parameters *params);
@@ -194,8 +177,12 @@ int main(int argc, char *argv[])
   DIC_NODENAME peerHost;
   T_ASC_Association *assoc;
   DcmAssociationConfiguration asccfg;  // handler for association configuration profiles
+  DcmTLSOptions tlsOptions(NET_REQUESTOR);
 
   OFStandard::initializeNetwork();
+#ifdef WITH_OPENSSL
+  DcmTLSTransportLayer::initializeOpenSSL();
+#endif
 
   OFString temp_str;
   OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "DICOM storage (C-STORE) SCU", rcsid);
@@ -278,6 +265,8 @@ int main(int argc, char *argv[])
                                                          "read kerberos ticket from file f");
       cmd.addOption("--saml",                         1, "[f]ilename: string",
                                                          "read SAML request from file f");
+      cmd.addOption("--jwt",                          1, "[f]ilename: string",
+                                                         "read JWT data from file f");
       cmd.addOption("--pos-response",         "-rsp",    "expect positive response");
     cmd.addSubGroup("other network options:");
       cmd.addOption("--timeout",              "-to",  1, "[s]econds: integer (default: unlimited)", "timeout for connection requests");
@@ -303,42 +292,8 @@ int main(int argc, char *argv[])
       CONVERT_TO_STRING("invent a new patient ID and name after n studies" << OFendl << "have been sent (default: " << opt_inventPatientCount << ")", optString7);
       cmd.addOption("--invent-patient",       "+IP",  1, "[n]umber: integer (implies --invent-instance)", optString7.c_str());
 
-#ifdef WITH_OPENSSL
-  cmd.addGroup("transport layer security (TLS) options:");
-    cmd.addSubGroup("transport protocol stack:");
-      cmd.addOption("--disable-tls",          "-tls",    "use normal TCP/IP connection (default)");
-      cmd.addOption("--enable-tls",           "+tls", 2, "[p]rivate key file, [c]ertificate file: string",
-                                                         "use authenticated secure TLS connection");
-      cmd.addOption("--anonymous-tls",        "+tla",    "use secure TLS connection without certificate");
-    cmd.addSubGroup("private key password (only with --enable-tls):");
-      cmd.addOption("--std-passwd",           "+ps",     "prompt user to type password on stdin (default)");
-      cmd.addOption("--use-passwd",           "+pw",  1, "[p]assword: string ",
-                                                         "use specified password");
-      cmd.addOption("--null-passwd",          "-pw",     "use empty string as password");
-    cmd.addSubGroup("key and certificate file format:");
-      cmd.addOption("--pem-keys",             "-pem",    "read keys and certificates as PEM file (default)");
-      cmd.addOption("--der-keys",             "-der",    "read keys and certificates as DER file");
-    cmd.addSubGroup("certification authority:");
-      cmd.addOption("--add-cert-file",        "+cf",  1, "[c]ertificate filename: string",
-                                                         "add certificate file to list of certificates", OFCommandLine::AF_NoWarning);
-      cmd.addOption("--add-cert-dir",         "+cd",  1, "[c]ertificate directory: string",
-                                                         "add certificates in d to list of certificates", OFCommandLine::AF_NoWarning);
-    cmd.addSubGroup("ciphersuite:");
-      cmd.addOption("--cipher",               "+cs",  1, "[c]iphersuite name: string",
-                                                         "add ciphersuite to list of negotiated suites");
-      cmd.addOption("--dhparam",              "+dp",  1, "[f]ilename: string",
-                                                         "read DH parameters for DH/DSS ciphersuites");
-    cmd.addSubGroup("pseudo random generator:");
-      cmd.addOption("--seed",                 "+rs",  1, "[f]ilename: string",
-                                                         "seed random generator with contents of f");
-      cmd.addOption("--write-seed",           "+ws",     "write back modified seed (only with --seed)");
-      cmd.addOption("--write-seed-file",      "+wf",  1, "[f]ilename: string (only with --seed)",
-                                                         "write modified seed to file f");
-    cmd.addSubGroup("peer authentication:");
-      cmd.addOption("--require-peer-cert",    "-rc",     "verify peer certificate, fail if absent (default)");
-      cmd.addOption("--verify-peer-cert",     "-vc",     "verify peer certificate if present");
-      cmd.addOption("--ignore-peer-cert",     "-ic",     "don't verify peer certificate");
-#endif
+    // add TLS specific command line options if (and only if) we are compiling with OpenSSL
+    tlsOptions.addTLSCommandlineOptions(cmd);
 
     /* evaluate command line */
     prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION);
@@ -363,11 +318,17 @@ int main(int argc, char *argv[])
           COUT << "- " << DiJPEGPlugin::getLibraryVersionString() << OFendl;
           COUT << "- " << DJLSDecoderRegistration::getLibraryVersionString() << OFendl;
 #endif
-#ifdef WITH_OPENSSL
-          COUT << "- " << OPENSSL_VERSION_TEXT << OFendl;
-#endif
+          // print OpenSSL version if (and only if) we are compiling with OpenSSL
+          tlsOptions.printLibraryVersion();
           return 0;
         }
+
+        // check if the command line contains the --list-ciphers option
+        if (tlsOptions.listOfCiphersRequested(cmd))
+        {
+            tlsOptions.printSupportedCiphersuites(app, COUT);
+            return 0;
+        }
       }
 
       /* command line parameters */
@@ -553,98 +514,8 @@ int main(int argc, char *argv[])
         app.checkValue(cmd.getValueAndCheckMin(opt_inventPatientCount, 1));
       }
 
-#ifdef WITH_OPENSSL
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--disable-tls")) opt_secureConnection = OFFalse;
-      if (cmd.findOption("--enable-tls"))
-      {
-        opt_secureConnection = OFTrue;
-        opt_doAuthenticate = OFTrue;
-        app.checkValue(cmd.getValue(opt_privateKeyFile));
-        app.checkValue(cmd.getValue(opt_certificateFile));
-      }
-      if (cmd.findOption("--anonymous-tls"))
-      {
-        opt_secureConnection = OFTrue;
-      }
-      cmd.endOptionBlock();
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--std-passwd"))
-      {
-        app.checkDependence("--std-passwd", "--enable-tls", opt_doAuthenticate);
-        opt_passwd = NULL;
-      }
-      if (cmd.findOption("--use-passwd"))
-      {
-        app.checkDependence("--use-passwd", "--enable-tls", opt_doAuthenticate);
-        app.checkValue(cmd.getValue(opt_passwd));
-      }
-      if (cmd.findOption("--null-passwd"))
-      {
-        app.checkDependence("--null-passwd", "--enable-tls", opt_doAuthenticate);
-        opt_passwd = "";
-      }
-      cmd.endOptionBlock();
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--pem-keys")) opt_keyFileFormat = SSL_FILETYPE_PEM;
-      if (cmd.findOption("--der-keys")) opt_keyFileFormat = SSL_FILETYPE_ASN1;
-      cmd.endOptionBlock();
-
-      if (cmd.findOption("--dhparam"))
-      {
-        app.checkValue(cmd.getValue(opt_dhparam));
-      }
-
-      if (cmd.findOption("--seed"))
-      {
-        app.checkValue(cmd.getValue(opt_readSeedFile));
-      }
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--write-seed"))
-      {
-        app.checkDependence("--write-seed", "--seed", opt_readSeedFile != NULL);
-        opt_writeSeedFile = opt_readSeedFile;
-      }
-      if (cmd.findOption("--write-seed-file"))
-      {
-        app.checkDependence("--write-seed-file", "--seed", opt_readSeedFile != NULL);
-        app.checkValue(cmd.getValue(opt_writeSeedFile));
-      }
-      cmd.endOptionBlock();
-
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--require-peer-cert")) opt_certVerification = DCV_requireCertificate;
-      if (cmd.findOption("--verify-peer-cert"))  opt_certVerification = DCV_checkCertificate;
-      if (cmd.findOption("--ignore-peer-cert"))  opt_certVerification = DCV_ignoreCertificate;
-      cmd.endOptionBlock();
-
-      const char *current = NULL;
-      const char *currentOpenSSL;
-      if (cmd.findOption("--cipher", 0, OFCommandLine::FOM_First))
-      {
-        opt_ciphersuites.clear();
-        do
-        {
-          app.checkValue(cmd.getValue(current));
-          if (NULL == (currentOpenSSL = DcmTLSTransportLayer::findOpenSSLCipherSuiteName(current)))
-          {
-            OFLOG_ERROR(storescuLogger, "ciphersuite '" << current << "' is unknown. Known ciphersuites are:");
-            unsigned long numSuites = DcmTLSTransportLayer::getNumberOfCipherSuites();
-            for (unsigned long cs = 0; cs < numSuites; cs++)
-              OFLOG_ERROR(storescuLogger, "    " << DcmTLSTransportLayer::getTLSCipherSuiteName(cs));
-            return 1;
-          } else {
-            if (!opt_ciphersuites.empty()) opt_ciphersuites += ":";
-            opt_ciphersuites += currentOpenSSL;
-          }
-        } while (cmd.findOption("--cipher", 0, OFCommandLine::FOM_Next));
-      }
-
-#endif
+      // evaluate (most of) the TLS command line options (if we are compiling with OpenSSL)
+      tlsOptions.parseArguments(app, cmd);
 
       // User Identity Negotiation
       cmd.beginOptionBlock();
@@ -663,6 +534,11 @@ int main(int argc, char *argv[])
         app.checkValue(cmd.getValue(opt_identFile));
         opt_identMode = ASC_USER_IDENTITY_SAML;
       }
+      if (cmd.findOption("--jwt"))
+      {
+        app.checkValue(cmd.getValue(opt_identFile));
+        opt_identMode = ASC_USER_IDENTITY_JWT;
+      }
       cmd.endOptionBlock();
       cmd.beginOptionBlock();
       if (cmd.findOption("--password"))
@@ -741,7 +617,7 @@ int main(int argc, char *argv[])
       {
         if (opt_proposeOnlyRequiredPresentationContexts)
         {
-          if (!findSOPClassAndInstanceInFile(currentFilename, sopClassUID, sopInstanceUID))
+          if (!findSOPClassAndInstanceInFile(currentFilename, sopClassUID, sizeof(sopClassUID), sopInstanceUID, sizeof(sopInstanceUID)))
           {
             ignoreName = OFTrue;
             errormsg = "missing SOP class (or instance) in file: ";
@@ -819,102 +695,24 @@ int main(int argc, char *argv[])
       return 1;
     }
 
-#ifdef WITH_OPENSSL
-
-    DcmTLSTransportLayer *tLayer = NULL;
-    if (opt_secureConnection)
-    {
-      tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_REQUESTOR, opt_readSeedFile);
-      if (tLayer == NULL)
-      {
-        OFLOG_FATAL(storescuLogger, "unable to create TLS transport layer");
-        exit(1);
-      }
-
-      if (cmd.findOption("--add-cert-file", 0, OFCommandLine::FOM_First))
-      {
-        const char *current = NULL;
-        do
-        {
-          app.checkValue(cmd.getValue(current));
-          if (TCS_ok != tLayer->addTrustedCertificateFile(current, opt_keyFileFormat))
-            OFLOG_WARN(storescuLogger, "unable to load certificate file '" << current << "', ignoring");
-        } while (cmd.findOption("--add-cert-file", 0, OFCommandLine::FOM_Next));
-      }
-
-      if (cmd.findOption("--add-cert-dir", 0, OFCommandLine::FOM_First))
-      {
-        const char *current = NULL;
-        do
-        {
-          app.checkValue(cmd.getValue(current));
-          if (TCS_ok != tLayer->addTrustedCertificateDir(current, opt_keyFileFormat))
-            OFLOG_WARN(storescuLogger, "unable to load certificates from directory '" << current << "', ignoring");
-        } while (cmd.findOption("--add-cert-dir", 0, OFCommandLine::FOM_Next));
-      }
-
-      if (opt_dhparam && !(tLayer->setTempDHParameters(opt_dhparam)))
-        OFLOG_WARN(storescuLogger, "unable to load temporary DH parameter file '" << opt_dhparam << "', ignoring");
-
-      if (opt_doAuthenticate)
-      {
-        if (opt_passwd) tLayer->setPrivateKeyPasswd(opt_passwd);
-
-        if (TCS_ok != tLayer->setPrivateKeyFile(opt_privateKeyFile, opt_keyFileFormat))
-        {
-          OFLOG_ERROR(storescuLogger, "unable to load private TLS key from '" << opt_privateKeyFile << "'");
-          return 1;
-        }
-        if (TCS_ok != tLayer->setCertificateFile(opt_certificateFile, opt_keyFileFormat))
-        {
-          OFLOG_ERROR(storescuLogger, "unable to load certificate from '" << opt_certificateFile << "'");
-          return 1;
-        }
-        if (! tLayer->checkPrivateKeyMatchesCertificate())
-        {
-          OFLOG_ERROR(storescuLogger, "private key '" << opt_privateKeyFile << "' and certificate '" << opt_certificateFile << "' do not match");
-          return 1;
-        }
-      }
-
-      if (TCS_ok != tLayer->setCipherSuites(opt_ciphersuites.c_str()))
-      {
-        OFLOG_ERROR(storescuLogger, "unable to set selected cipher suites");
-        return 1;
-      }
-
-      tLayer->setCertificateVerification(opt_certVerification);
-
-
-      cond = ASC_setTransportLayer(net, tLayer, 0);
-      if (cond.bad())
-      {
-        OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond));
-        return 1;
-      }
-    }
-
-#endif
-
     /* initialize asscociation parameters, i.e. create an instance of T_ASC_Parameters*. */
     cond = ASC_createAssociationParameters(&params, opt_maxReceivePDULength);
     if (cond.bad()) {
       OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond));
       return 1;
     }
-    /* sets this application's title and the called application's title in the params */
-    /* structure. The default values to be set here are "STORESCU" and "ANY-SCP". */
-    ASC_setAPTitles(params, opt_ourTitle, opt_peerTitle, NULL);
 
-    /* Set the transport layer type (type of network connection) in the params */
-    /* strucutre. The default is an insecure connection; where OpenSSL is  */
-    /* available the user is able to request an encrypted,secure connection. */
-    cond = ASC_setTransportLayerType(params, opt_secureConnection);
+    /* create a secure transport layer if requested and OpenSSL is available */
+    cond = tlsOptions.createTransportLayer(net, params, app, cmd);
     if (cond.bad()) {
-      OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond));
-      return 1;
+        OFLOG_FATAL(storescuLogger, DimseCondition::dump(temp_str, cond));
+        return 1;
     }
 
+    /* sets this application's title and the called application's title in the params */
+    /* structure. The default values to be set here are "STORESCU" and "ANY-SCP". */
+    ASC_setAPTitles(params, opt_ourTitle, opt_peerTitle, NULL);
+
     /* Figure out the presentation addresses and copy the */
     /* corresponding values into the association parameters.*/
     sprintf(peerHost, "%s:%d", opt_peer, OFstatic_cast(int, opt_port));
@@ -1078,18 +876,11 @@ int main(int argc, char *argv[])
 
     OFStandard::shutdownNetwork();
 
-#ifdef WITH_OPENSSL
-    if (tLayer && opt_writeSeedFile)
-    {
-      if (tLayer->canWriteRandomSeed())
-      {
-        if (!tLayer->writeRandomSeed(opt_writeSeedFile))
-          OFLOG_WARN(storescuLogger, "cannot write random seed file '" << opt_writeSeedFile << "', ignoring");
-      } else
-        OFLOG_WARN(storescuLogger, "cannot write random seed, ignoring");
+    cond = tlsOptions.writeRandomSeed();
+    if (cond.bad()) {
+        // failure to write back the random seed is a warning, not an error
+        OFLOG_WARN(storescuLogger, DimseCondition::dump(temp_str, cond));
     }
-    delete tLayer;
-#endif
 
     int exitCode = 0;
     if (opt_haltOnUnsuccessfulStore && unsuccessfulStoreEncountered) {
@@ -1507,7 +1298,7 @@ storeSCU(T_ASC_Association *assoc, const char *fname)
 
   /* figure out which SOP class and SOP instance is encapsulated in the file */
   if (!DU_findSOPClassAndInstanceInDataSet(dcmff.getDataset(),
-    sopClass, sopInstance, opt_correctUIDPadding)) {
+    sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), opt_correctUIDPadding)) {
       OFLOG_ERROR(storescuLogger, "No SOP Class or Instance UID in file: " << fname);
       return DIMSE_BADDATA;
   }
@@ -1549,14 +1340,18 @@ storeSCU(T_ASC_Association *assoc, const char *fname)
   }
 
 #ifdef ON_THE_FLY_COMPRESSION
-  dcmff.getDataset()->chooseRepresentation(netTransfer.getXfer(), NULL);
+  cond = dcmff.getDataset()->chooseRepresentation(netTransfer.getXfer(), NULL);
+  if (cond.bad()) {
+    OFLOG_ERROR(storescuLogger, "No conversion to transfer syntax " << netTransfer.getXferName() << " possible!");
+    return cond;
+  }
 #endif
 
   /* prepare the transmission of data */
   bzero(OFreinterpret_cast(char *, &req), sizeof(req));
   req.MessageID = msgId;
-  strcpy(req.AffectedSOPClassUID, sopClass);
-  strcpy(req.AffectedSOPInstanceUID, sopInstance);
+  OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, sizeof(req.AffectedSOPClassUID));
+  OFStandard::strlcpy(req.AffectedSOPInstanceUID, sopInstance, sizeof(req.AffectedSOPInstanceUID));
   req.DataSetType = DIMSE_DATASET_PRESENT;
   req.Priority = DIMSE_PRIORITY_MEDIUM;
 
@@ -1647,17 +1442,19 @@ static OFBool
 findSOPClassAndInstanceInFile(
   const char *fname,
   char *sopClass,
-  char *sopInstance)
+  size_t sopClassSize,
+  char *sopInstance,
+  size_t sopInstanceSize)
 {
     DcmFileFormat ff;
     if (!ff.loadFile(fname, EXS_Unknown, EGL_noChange, DCM_MaxReadLength, opt_readMode).good())
         return OFFalse;
 
     /* look in the meta-header first */
-    OFBool found = DU_findSOPClassAndInstanceInDataSet(ff.getMetaInfo(), sopClass, sopInstance, opt_correctUIDPadding);
+    OFBool found = DU_findSOPClassAndInstanceInDataSet(ff.getMetaInfo(), sopClass, sopClassSize, sopInstance, sopInstanceSize, opt_correctUIDPadding);
 
     if (!found)
-      found = DU_findSOPClassAndInstanceInDataSet(ff.getDataset(), sopClass, sopInstance, opt_correctUIDPadding);
+      found = DU_findSOPClassAndInstanceInDataSet(ff.getDataset(), sopClass, sopClassSize, sopInstance, sopInstanceSize, opt_correctUIDPadding);
 
     return found;
 }
@@ -1681,13 +1478,14 @@ configureUserIdentityRequest(T_ASC_Parameters *params)
     }
     case ASC_USER_IDENTITY_KERBEROS:
     case ASC_USER_IDENTITY_SAML:
+    case ASC_USER_IDENTITY_JWT:
     {
       OFFile identFile;
       if (!identFile.fopen(opt_identFile.c_str(), "rb"))
       {
         OFString openerror;
         identFile.getLastErrorString(openerror);
-        OFLOG_ERROR(storescuLogger, "Unable to open Kerberos or SAML file: " << openerror);
+        OFLOG_ERROR(storescuLogger, "Unable to open Kerberos, SAML or JWT file: " << openerror);
         return EC_IllegalCall;
       }
       // determine file size
@@ -1698,7 +1496,7 @@ configureUserIdentityRequest(T_ASC_Parameters *params)
       identFile.rewind();
       if (filesize > 65535)
       {
-        OFLOG_INFO(storescuLogger, "Kerberos or SAML file is larger than 65535 bytes, bytes after that position are ignored");
+        OFLOG_INFO(storescuLogger, "Kerberos, SAML or JWT file is larger than 65535 bytes, bytes after that position are ignored");
         filesize = 65535;
       }
 
@@ -1707,7 +1505,7 @@ configureUserIdentityRequest(T_ASC_Parameters *params)
       identFile.fclose();
       if (bytesRead == 0)
       {
-        OFLOG_ERROR(storescuLogger, "Unable to read Kerberos or SAML info from file: File empty?");
+        OFLOG_ERROR(storescuLogger, "Unable to read Kerberos, SAML or JWT info from file: File empty?");
         delete[] buf;
         return EC_IllegalCall;
       }
@@ -1715,8 +1513,10 @@ configureUserIdentityRequest(T_ASC_Parameters *params)
       // size does not exceed 65535 bytes.
       if (opt_identMode == ASC_USER_IDENTITY_KERBEROS)
         cond = ASC_setIdentRQKerberos(params, buf, OFstatic_cast(Uint16,bytesRead), opt_identResponse);
-      else
+      else if (opt_identMode == ASC_USER_IDENTITY_SAML)
         cond = ASC_setIdentRQSaml(params, buf, OFstatic_cast(Uint16,bytesRead), opt_identResponse);
+      else // JWT
+        cond = ASC_setIdentRQJwt(params, buf, OFstatic_cast(Uint16,bytesRead), opt_identResponse);
       delete[] buf;
       break;
     }
index 3c49b4259fd955ff779c61ef6035982490eb7777..176ffbb05d9a89cfe7ce4292a3a9a1082266ee9d 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES asconfig.txt testing.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc)
+install(FILES asconfig.txt testing.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc)
index e4c7c296997fd32c74e6c7875af0e5345dae58ff..ff197e38ce7a6d511d057e12c6871aba0690dffe 100644 (file)
@@ -298,10 +298,12 @@ presentation contexts might be proposed to the SCP that are strictly speaking
 "illegal".  This is because, according to the DICOM standard, the SCU always
 has to propose the default transfer syntax in at least one presentation context
 associated with each abstract syntax (i.e. SOP class).  This requirement is
-waived when the SCU only has access to the SOP instance in lossy compressed
-form.  With option \e --no-illegal-proposal the strict DICOM-conformant
-behavior can be enforced, i.e. no possibly illegal presentation context will
-be proposed but the corresponding SOP instance will be rejected (if needed).
+waived if the SCU only has access to the SOP instance in lossy compressed form
+or if the decompressed pixel data would be too large to be encoded.  With
+option \e --no-illegal-proposal the strict DICOM-conformant behavior can be
+enforced, i.e. no possibly illegal presentation context will be proposed but
+the corresponding SOP instance will be rejected (if needed).  Please note,
+however, that the size of the decompressed pixel data is not checked.
 
 Please note, however, that the default transfer syntax for "Lossless JPEG
 Compression", "Lossy JPEG Compression" and so on are not always proposed as
@@ -407,6 +409,6 @@ It is an error if no data dictionary can be loaded.
 
 \section dcmsend_copyright COPYRIGHT
 
-Copyright (C) 2011-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2011-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index a296fd0b3564b24584c3e53311c41823cf975389..134dce7be89df3254e08f926f44c2586b5def0d6 100644 (file)
@@ -139,14 +139,32 @@ certification authority:
   +cd   --add-cert-dir  [c]ertificate directory: string
           add certificates in d to list of certificates
 
+security profile:
+
+  +px   --profile-bcp195
+          BCP 195 TLS Profile (default)
+
+  +py   --profile-bcp195-nd
+          Non-downgrading BCP 195 TLS Profile
+
+  +pb   --profile-basic
+          Basic TLS Secure Transport Connection Profile (retired)
+
+  +pa   --profile-aes
+          AES TLS Secure Transport Connection Profile (retired)
+
+  +pn   --profile-null
+          Authenticated unencrypted communication
+          (retired, was used in IHE ATNA)
+
 ciphersuite:
 
+  +cc   --list-ciphers
+          show list of supported TLS ciphersuites and exit
+
   +cs   --cipher  [c]iphersuite name: string
           add ciphersuite to list of negotiated suites
 
-  +dp   --dhparam  [f]ilename: string
-          read DH parameters for DH/DSS ciphersuites
-
 pseudo random generator:
 
   +rs   --seed  [f]ilename: string
@@ -163,9 +181,6 @@ peer authentication:
   -rc   --require-peer-cert
           verify peer certificate, fail if absent (default)
 
-  -vc   --verify-peer-cert
-          verify peer certificate if present
-
   -ic   --ignore-peer-cert
           don't verify peer certificate
 \endverbatim
@@ -228,6 +243,36 @@ allows one to summarize common combinations of options/parameters and avoids
 longish and confusing command lines (an example is provided in file
 <em>\<datadir\>/dumppat.txt</em>).
 
+\section echoscu_exit_codes EXIT CODES
+
+The \b echoscu utility uses the following exit codes when terminating.  This
+enables the user to check for the reason why the application terminated.
+
+\subsection echoscu_exit_codes_general general
+\verbatim
+EXITCODE_NO_ERROR                         0
+EXITCODE_COMMANDLINE_SYNTAX_ERROR         1
+\endverbatim
+
+\subsection echoscu_exit_codes_input_file_errors input file errors
+\verbatim
+EXITCODE_CANNOT_READ_INPUT_FILE          20 (*)
+\endverbatim
+
+\subsection echoscu_exit_codes_output_file_errors output file errors
+\verbatim
+EXITCODE_CANNOT_WRITE_OUTPUT_FILE        40 (*)
+\endverbatim
+
+\subsection echoscu_exit_codes_network_errors network errors
+\verbatim
+EXITCODE_CANNOT_INITIALIZE_NETWORK       60 (*)
+EXITCODE_ASSOCIATION_ABORTED             70
+\endverbatim
+
+(*) Actually, these codes are currently not used by \b echoscu but serve as a
+placeholder for the corresponding group of exit codes.
+
 \section echoscu_environment ENVIRONMENT
 
 The \b echoscu utility will attempt to load DICOM data dictionaries specified
@@ -246,6 +291,6 @@ It is an error if no data dictionary can be loaded.
 
 \section echoscu_copyright COPYRIGHT
 
-Copyright (C) 1994-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 1994-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index e46809cecb7f7bad6e71ac9f21cd5d36abc7fb8b..325b61632c6b64c7588fbc6b1e29cf8788993963 100644 (file)
@@ -187,14 +187,32 @@ certification authority:
   +cd   --add-cert-dir  [c]ertificate directory: string
           add certificates in d to list of certificates
 
+security profile:
+
+  +px   --profile-bcp195
+          BCP 195 TLS Profile (default)
+
+  +py   --profile-bcp195-nd
+          Non-downgrading BCP 195 TLS Profile
+
+  +pb   --profile-basic
+          Basic TLS Secure Transport Connection Profile (retired)
+
+  +pa   --profile-aes
+          AES TLS Secure Transport Connection Profile (retired)
+
+  +pn   --profile-null
+          Authenticated unencrypted communication
+          (retired, was used in IHE ATNA)
+
 ciphersuite:
 
+  +cc   --list-ciphers
+          show list of supported TLS ciphersuites and exit
+
   +cs   --cipher  [c]iphersuite name: string
           add ciphersuite to list of negotiated suites
 
-  +dp   --dhparam  [f]ilename: string
-          read DH parameters for DH/DSS ciphersuites
-
 pseudo random generator:
 
   +rs   --seed  [f]ilename: string
@@ -211,9 +229,6 @@ peer authentication:
   -rc   --require-peer-cert
           verify peer certificate, fail if absent (default)
 
-  -vc   --verify-peer-cert
-          verify peer certificate if present
-
   -ic   --ignore-peer-cert
           don't verify peer certificate
 \endverbatim
index 75f362cb5189709636e569efaad12404ea8ac2bc..b2a82129e644b6f6a9606abe9028e0b100d2c07c 100644 (file)
@@ -159,7 +159,7 @@ preferred storage transfer syntaxes (incoming associations):
   +xi   --implicit
           accept implicit VR little endian TS only
 
- proposed retrieve transfer syntaxes (outgoing associations):
+proposed retrieve transfer syntaxes (outgoing associations):
 
   -x=   --propose-uncompr
           propose all uncompressed TS, explicit VR
@@ -384,7 +384,7 @@ OphthalmicPhotography16BitImageStorage               1.2.840.10008.5.1.4.1.1.77.
 StereometricRelationshipStorage                      1.2.840.10008.5.1.4.1.1.77.1.5.3
 OphthalmicTomographyImageStorage                     1.2.840.10008.5.1.4.1.1.77.1.5.4
 VLWholeSlideMicroscopyImageStorage                   1.2.840.10008.5.1.4.1.1.77.1.6
-RETIRED_VLMultiFrameImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
+RETIRED_VLMultiframeImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
 LensometryMeasurementsStorage                        1.2.840.10008.5.1.4.1.1.78.1
 AutorefractionMeasurementsStorage                    1.2.840.10008.5.1.4.1.1.78.2
 KeratometryMeasurementsStorage                       1.2.840.10008.5.1.4.1.1.78.3
@@ -551,6 +551,6 @@ It is an error if no data dictionary can be loaded.
 
 \section getscu_copyright COPYRIGHT
 
-Copyright (C) 2011-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2011-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index e90de31a7ddc585ef9aafef4478515ab101590cc..8c5557df2360853464890af99e6c7ea8e066a38b 100644 (file)
@@ -526,7 +526,7 @@ WideFieldOphthalmicPhotogr.3DCoordinatesImageStorage 1.2.840.10008.5.1.4.1.1.77.
 OphthalmicOpticalCoherenceTomogr.EnFaceImageStorage  1.2.840.10008.5.1.4.1.1.77.1.5.7
 OphthalmicOpticalCoh.Tomogr.BscanVolumeAnalysisStor. 1.2.840.10008.5.1.4.1.1.77.1.5.8
 VLWholeSlideMicroscopyImageStorage                   1.2.840.10008.5.1.4.1.1.77.1.6
-RETIRED_VLMultiFrameImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
+RETIRED_VLMultiframeImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
 LensometryMeasurementsStorage                        1.2.840.10008.5.1.4.1.1.78.1
 AutorefractionMeasurementsStorage                    1.2.840.10008.5.1.4.1.1.78.2
 KeratometryMeasurementsStorage                       1.2.840.10008.5.1.4.1.1.78.3
@@ -562,6 +562,7 @@ PatientRadiationDoseSRStorage                        1.2.840.10008.5.1.4.1.1.88.
 ContentAssessmentResultsStorage                      1.2.840.10008.5.1.4.1.1.90.1
 EncapsulatedPDFStorage                               1.2.840.10008.5.1.4.1.1.104.1
 EncapsulatedCDAStorage                               1.2.840.10008.5.1.4.1.1.104.2
+EncapsulatedSTLStorage                               1.2.840.10008.5.1.4.1.1.104.3
 PositronEmissionTomographyImageStorage               1.2.840.10008.5.1.4.1.1.128
 LegacyConvertedEnhancedPETImageStorage               1.2.840.10008.5.1.4.1.1.128.1
 RETIRED_StandalonePETCurveStorage                    1.2.840.10008.5.1.4.1.1.129
@@ -758,6 +759,6 @@ It is an error if no data dictionary can be loaded.
 
 \section movescu_copyright COPYRIGHT
 
-Copyright (C) 1994-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 1994-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index a15598126f1d740393bb65f45c054127c2d3a602..f27a1fe5b1283976bea2738f9f1b690129d70362 100644 (file)
@@ -247,8 +247,29 @@ certification authority:
   +cd   --add-cert-dir  [c]ertificate directory: string
           add certificates in d to list of certificates
 
+security profile:
+
+  +px   --profile-bcp195
+          BCP 195 TLS Profile (default)
+
+  +py   --profile-bcp195-nd
+          Non-downgrading BCP 195 TLS Profile
+
+  +pb   --profile-basic
+          Basic TLS Secure Transport Connection Profile (retired)
+
+  +pa   --profile-aes
+          AES TLS Secure Transport Connection Profile (retired)
+
+  +pn   --profile-null
+          Authenticated unencrypted communication
+          (retired, was used in IHE ATNA)
+
 ciphersuite:
 
+  +cc   --list-ciphers
+          show list of supported TLS ciphersuites and exit
+
   +cs   --cipher  [c]iphersuite name: string
           add ciphersuite to list of negotiated suites
 
@@ -658,7 +679,7 @@ WideFieldOphthalmicPhotogr.3DCoordinatesImageStorage 1.2.840.10008.5.1.4.1.1.77.
 OphthalmicOpticalCoherenceTomogr.EnFaceImageStorage  1.2.840.10008.5.1.4.1.1.77.1.5.7
 OphthalmicOpticalCoh.Tomogr.BscanVolumeAnalysisStor. 1.2.840.10008.5.1.4.1.1.77.1.5.8
 VLWholeSlideMicroscopyImageStorage                   1.2.840.10008.5.1.4.1.1.77.1.6
-RETIRED_VLMultiFrameImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
+RETIRED_VLMultiframeImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
 LensometryMeasurementsStorage                        1.2.840.10008.5.1.4.1.1.78.1
 AutorefractionMeasurementsStorage                    1.2.840.10008.5.1.4.1.1.78.2
 KeratometryMeasurementsStorage                       1.2.840.10008.5.1.4.1.1.78.3
@@ -881,6 +902,6 @@ It is an error if no data dictionary can be loaded.
 
 \section storescp_copyright COPYRIGHT
 
-Copyright (C) 1996-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 1996-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index 218f83c776319e6fe98c8517c3c77124c9775df1..72add6e5d87122bdb00bf8b80c5e966fd6ab7c62 100644 (file)
@@ -190,6 +190,10 @@ proposed transmission transfer syntaxes (not with --config-file):
           propose only required presentation contexts
           (default: propose all supported)
 
+          # This will also work with storage SOP classes that are
+          # supported by DCMTK but are not in the list of SOP classes
+          # proposed by default.
+
   +C    --combine
           combine proposed transfer syntaxes
           (default: separate presentation context for each TS)
@@ -224,6 +228,9 @@ user identity negotiation:
         --saml  [f]ilename: string
           read SAML request from file f
 
+        --jwt  [f]ilename: string
+          read JWT data from file f
+
   -rsp  --pos-response
           expect positive response
 
@@ -316,14 +323,32 @@ certification authority:
   +cd   --add-cert-dir  [c]ertificate directory: string
           add certificates in d to list of certificates
 
+security profile:
+
+  +px   --profile-bcp195
+          BCP 195 TLS Profile (default)
+
+  +py   --profile-bcp195-nd
+          Non-downgrading BCP 195 TLS Profile
+
+  +pb   --profile-basic
+          Basic TLS Secure Transport Connection Profile (retired)
+
+  +pa   --profile-aes
+          AES TLS Secure Transport Connection Profile (retired)
+
+  +pn   --profile-null
+          Authenticated unencrypted communication
+          (retired, was used in IHE ATNA)
+
 ciphersuite:
 
+  +cc   --list-ciphers
+          show list of supported TLS ciphersuites and exit
+
   +cs   --cipher  [c]iphersuite name: string
           add ciphersuite to list of negotiated suites
 
-  +dp   --dhparam  [f]ilename: string
-          read DH parameters for DH/DSS ciphersuites
-
 pseudo random generator:
 
   +rs   --seed  [f]ilename: string
@@ -340,9 +365,6 @@ peer authentication:
   -rc   --require-peer-cert
           verify peer certificate, fail if absent (default)
 
-  -vc   --verify-peer-cert
-          verify peer certificate if present
-
   -ic   --ignore-peer-cert
           don't verify peer certificate
 \endverbatim
@@ -549,6 +571,6 @@ It is an error if no data dictionary can be loaded.
 
 \section storescu_copyright COPYRIGHT
 
-Copyright (C) 1996-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 1996-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index a46bec8f008c23fbfd28dbdf82cbee7aec8f7109..29335c45881d1332b5cdcf8fd5a03ec3e7ddfa12 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES storescp.cfg storescu.cfg DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/dcmtk" COMPONENT etc)
+install(FILES storescp.cfg storescu.cfg DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/dcmtk" COMPONENT etc)
index 84fd1663cbb7df42d9f3ded1102c9d03680bbb0f..6430990311ebfcf28ef821c499e0f313d5ab924b 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2003-2017, OFFIS e.V.
+#  Copyright (C) 2003-2018, OFFIS e.V.
 #  All rights reserved.  See COPYRIGHT file for details.
 #
 #  This software and supporting documentation were developed by
@@ -120,7 +120,7 @@ PresentationContext50  = RETIRED_NuclearMedicineImageStorage\AnyTransferSyntax
 PresentationContext51  = RETIRED_UltrasoundImageStorage\AnyTransferSyntax
 PresentationContext52  = RETIRED_UltrasoundMultiframeImageStorage\AnyTransferSyntax
 PresentationContext53  = RETIRED_VLImageStorage\AnyTransferSyntax
-PresentationContext54  = RETIRED_VLMultiFrameImageStorage\AnyTransferSyntax
+PresentationContext54  = RETIRED_VLMultiframeImageStorage\AnyTransferSyntax
 PresentationContext55  = RETIRED_XRayAngiographicBiPlaneImageStorage\AnyTransferSyntax
 #
 # the following presentation contexts are for non-image SOP classes
@@ -212,6 +212,7 @@ PresentationContext128 = DRAFT_WaveformStorage\UncompressedOrZlib
 # - ContentAssessmentResultsStorage
 # - CTDefinedProcedureProtocolStorage
 # - CTPerformedProcedureProtocolStorage
+# - EncapsulatedSTLStorage
 # - ExtensibleSRStorage
 # - GrayscalePlanarMPRVolumetricPresentationStateStorage
 # - HangingProtocolStorage
@@ -392,6 +393,7 @@ PresentationContext128 = XRayRadiationDoseSRStorage\UncompressedOrZlib
 #
 # - AdvancedBlendingPresentationStateStorage
 # - ColorPaletteStorage
+# - EncapsulatedSTLStorage
 # - MultipleVolumeRenderingVolumetricPresentationStateStorage
 # - OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage
 # - OphthalmicOpticalCoherenceTomographyEnFaceImageStorage
@@ -406,7 +408,7 @@ PresentationContext128 = XRayRadiationDoseSRStorage\UncompressedOrZlib
 # - RETIRED_UltrasoundImageStorage
 # - RETIRED_UltrasoundMultiframeImageStorage
 # - RETIRED_VLImageStorage
-# - RETIRED_VLMultiFrameImageStorage
+# - RETIRED_VLMultiframeImageStorage
 # - RETIRED_XRayAngiographicBiPlaneImageStorage
 #
 # - RETIRED_StandaloneCurveStorage
index efd16da46213a228b9f5222c5a6536eabff56a31..8d6bc3be4f77cb5769ec7b7ea06ab5689327cbf2 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2003-2017, OFFIS e.V.
+#  Copyright (C) 2003-2018, OFFIS e.V.
 #  All rights reserved.  See COPYRIGHT file for details.
 #
 #  This software and supporting documentation were developed by
@@ -216,6 +216,7 @@ PresentationContext128 = VideoPhotographicImageStorage\MPEG2
 # - CTPerformedProcedureProtocolStorage
 # - DeformableSpatialRegistrationStorage
 # - EncapsulatedCDAStorage
+# - EncapsulatedSTLStorage
 # - EnhancedMRColorImageStorage
 # - EnhancedPETImageStorage
 # - EnhancedUSVolumeStorage
index d5b2295ebf6a8b17e6e0e1a19a9ecdf306476299..2b0d1c4c0932b94068467400fb386386589b155c 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmnet DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmnet DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 78f003c9e65455bd840d2dcefcabcaf6d85f8dee..8025b8948a779ab424f128ec112ea4e303da73de 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were partly developed by
@@ -254,6 +254,12 @@ struct DCMTK_DCMNET_EXPORT T_ASC_Association
 ** Public Function Prototypes
 */
 
+/*
+ * Network creation/destroy wrappers.
+ * The T_ASC_Network structure will be allocated/freed by
+ * these routines.
+ */
+
 /** network instance creation function (constructor)
  *  @param role association acceptor, requestor or both
  *  @param acceptorPort acceptor port for incoming connections.
@@ -281,11 +287,18 @@ DCMTK_DCMNET_EXPORT OFCondition ASC_dropNetwork(T_ASC_Network ** network);
  * Building Association parameters
  */
 
+/* create association parameters and initialize with default values */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_createAssociationParameters(
     T_ASC_Parameters ** params,
     long maxReceivePDUSize);
 
+ /*
+  * Free an association parameters structure and embedded information.
+  * You do not usually need to do this since the parameters structure will
+  * be noted in the association structure and automatically freed when an
+  * association terminates.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_destroyAssociationParameters(
     T_ASC_Parameters ** params);
@@ -296,6 +309,9 @@ ASC_setTransportLayerType(
     T_ASC_Parameters * params,
     OFBool useSecureLayer);
 
+ /*
+  * Copies the provided Application Titles in the association parameters.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_setAPTitles(
     T_ASC_Parameters * params,
@@ -303,30 +319,59 @@ ASC_setAPTitles(
     const char* calledAPTitle,
     const char* respondingAPTitle);
 
+ /*
+  * Copies the Application Titles stored in the association parameters
+  * into the supplied string variables.  You must provide storage to copy
+  * into.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_getAPTitles(
     T_ASC_Parameters * params,
     char* callingAPTitle,
+    size_t callingAPTitleSize,
     char* calledAPTitle,
-    char* respondingAPTitle);
-
+    size_t calledAPTitleSize,
+    char* respondingAPTitle,
+    size_t respondingAPTitleSize);
+
+ /*
+  * Copies the Application Context Name stored in the association parameters
+  * into the supplied string variable.  You must provide storage to copy
+  * into.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_getApplicationContextName(
     T_ASC_Parameters * params,
-    char* applicationContextName);
+    char* applicationContextName,
+    size_t applicationContextNameSize);
 
+ /*
+  * Copies the provided Presentation Addresses into the association
+  * parameters.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_setPresentationAddresses(
     T_ASC_Parameters * params,
     const char* callingPresentationAddress,
     const char* calledPresentationAddress);
 
+/*
+  * Copies the Presentation Addresses stored in the association parameters
+  * into the supplied string variables.  You must provide storage to copy
+  * into.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_getPresentationAddresses(
     T_ASC_Parameters * params,
     char* callingPresentationAddress,
-    char* calledPresentationAddress);
-
+    size_t callingPresentationAddressSize,
+    char* calledPresentationAddress,
+    size_t calledPresentationAddressSize);
+
+ /*
+  * Copies the Rejection Parameters stored in the association parameters into
+  * the supplied structure.  You must provide storage to copy into.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_getRejectParameters(
     T_ASC_Parameters * params,
@@ -335,8 +380,11 @@ ASC_getRejectParameters(
 DCMTK_DCMNET_EXPORT OFString&
 ASC_printRejectParameters(
     OFString& str,
-    T_ASC_RejectParameters *rej);
+    const T_ASC_RejectParameters *rej);
 
+ /*
+  * Adds a presentation context entry to the presentation context list.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_addPresentationContext(
     T_ASC_Parameters * params,
@@ -346,6 +394,10 @@ ASC_addPresentationContext(
     int transferSyntaxListCount,
     T_ASC_SC_ROLE proposedRole = ASC_SC_ROLE_DEFAULT);
 
+ /*
+  * Returns the number of presentation contexts contained in the presentation
+  * context list.
+  */
 DCMTK_DCMNET_EXPORT int
 ASC_countPresentationContexts(
     T_ASC_Parameters * params);
@@ -354,12 +406,21 @@ DCMTK_DCMNET_EXPORT int
 ASC_countAcceptedPresentationContexts(
     T_ASC_Parameters * params);
 
+ /*
+  * You must supply the memory for presentationContext, the values stored in
+  * the presentation context list position indicated will be copied into the
+  * memory structure.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_getPresentationContext(
     T_ASC_Parameters * params,
     int listPosition,
     T_ASC_PresentationContext * presentationContext);
 
+ /*
+  * The presentation context will be marked as accepted and the provided
+  * transfer syntax name chosen.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_acceptPresentationContext(
     T_ASC_Parameters * params,
@@ -375,6 +436,12 @@ ASC_acceptContextsWithPreferredTransferSyntaxes(
     const char* transferSyntaxes[], int transferSyntaxCount,
     T_ASC_SC_ROLE acceptedRole = ASC_SC_ROLE_DEFAULT);
 
+/*
+  * Any proposed presentation contexts which are found abstractSyntaxes[]
+  * which also have proposed a transfer syntax of transferSyntax, will be
+  * accepted.  Any presentation contexts already marked as accepted will be
+  * left alone but any remaining presentation contexts will be refused.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_acceptContextsWithTransferSyntax(
     T_ASC_Parameters * params,
@@ -382,23 +449,47 @@ ASC_acceptContextsWithTransferSyntax(
     const char* abstractSyntaxes[],
     T_ASC_SC_ROLE acceptedRole = ASC_SC_ROLE_DEFAULT);
 
+ /*
+  * The presentation context will be marked as refused.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_refusePresentationContext(
     T_ASC_Parameters * params,
     T_ASC_PresentationContextID presentationContextID,
     T_ASC_P_ResultReason resultReason);
 
+ /*
+  * ASC_findAcceptedPresentationContext: You must supply the memory for
+  * presentationContext, the values stored in the accepted presentation
+  * context list with given ID will be copied into the memory structure.
+  * Returns EC_Normal if found, or ASC_BADPRESENTATIONCONTEXTID if not
+  * found.
+  */
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_findAcceptedPresentationContext(
     T_ASC_Parameters * params,
     T_ASC_PresentationContextID presentationContextID,
     T_ASC_PresentationContext * presentationContext);
 
+/* ASC_findAcceptedPresentationContextID:
+ * Searches in the accepted presentation context list for the given
+ * abstract syntax.  If found returns its PresentationContextID, otherwise
+ * returns 0 (which is not a valid ID).
+ */
 DCMTK_DCMNET_EXPORT T_ASC_PresentationContextID
 ASC_findAcceptedPresentationContextID(
     T_ASC_Association *assoc,
     const char* abstractSyntax);
 
+/* transfer syntax aware version of T_ASC_PresentationContextID.
+ * Tries to find a presentation context that matches the characteristics
+ * of the given DICOM dataset best
+ * - if possible finds a presentation context with matching TS
+ * - then tries to find an explicit VR uncompressed TS presentation ctx
+ * - then tries to find an implicit VR uncompressed TS presentation ctx
+ * - finally accepts each matching presentation ctx independent of TS.
+ * Returns 0 if no appropriate presentation context could be found at all.
+ */
 DCMTK_DCMNET_EXPORT T_ASC_PresentationContextID
 ASC_findAcceptedPresentationContextID(
     T_ASC_Association *assoc,
@@ -481,6 +572,19 @@ ASC_setIdentRQSaml(
     const Uint16 length,
     const OFBool requestRsp = OFTrue);
 
+/** Sets JSON Web Token (JWT) authentication for User Identity Negotiation
+ *  request.
+ *  @param params - [in/out] The association parameters to be filled
+ *  @param jwt    - [in]  The JWT information to send (will be copied)
+ *  @param length - [in] Length of JWT information
+ *  @return EC_Normal if JWT info could be set, error otherwise
+ */
+DCMTK_DCMNET_EXPORT OFCondition
+ASC_setIdentRQJwt(
+    T_ASC_Parameters * params,
+    const char* jwt,
+    const Uint16 length,
+    const OFBool requestRsp = OFTrue);
 
 /** Acknowledges a User Identity Negotiation request.
  *  @param params - [in/out] The association parameters to be filled
@@ -584,7 +688,7 @@ ASC_acknowledgeAssociation(
 DCMTK_DCMNET_EXPORT OFCondition
 ASC_rejectAssociation(
     T_ASC_Association * association,
-    T_ASC_RejectParameters * rejectParameters,
+    const T_ASC_RejectParameters * rejectParameters,
     void **associatePDU=NULL,
     unsigned long *associatePDUlength=NULL);
 
@@ -610,14 +714,17 @@ ASC_destroyAssociation(T_ASC_Association ** association);
 DCMTK_DCMNET_EXPORT void
 ASC_printRejectParameters(
     FILE *f,
-    T_ASC_RejectParameters *rej);
+    const T_ASC_RejectParameters *rej);
 
 /// @deprecated Please use OFString& ASC_printRejectParameters(OFString&, T_ASC_RejectParameters*) instead.
 DCMTK_DCMNET_EXPORT void
 ASC_printRejectParameters(
     STD_NAMESPACE ostream& out,
-    T_ASC_RejectParameters *rej);
+    const T_ASC_RejectParameters *rej);
 
+ /*
+  * Write parameters in textual form to stdout (debugging aid)
+  */
 /**
  * @deprecated Please use OFString& ASC_dumpParameters(OFString&, T_ASC_Parameters *,
  *             ASC_associateType) instead.
@@ -625,6 +732,10 @@ ASC_printRejectParameters(
 DCMTK_DCMNET_EXPORT void
 ASC_dumpParameters(T_ASC_Parameters * params, STD_NAMESPACE ostream& outstream);
 
+ /*
+  * Write presentation context structure in textual form to stdout.
+  * (debugging aid)
+  */
 /// @deprecated You should dump the complete T_ASC_Parameters with ASC_dumpParameters() instead.
 DCMTK_DCMNET_EXPORT void
 ASC_dumpPresentationContext(T_ASC_PresentationContext * presentationContext, STD_NAMESPACE ostream& outstream);
index a4a3d9c0bdad9580e14ccbb4c40427fe8feed0a9..a7412c6c391a78046660897d4672fbd9a7eaa0f9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -198,6 +198,7 @@ extern DCMTK_DCMNET_EXPORT const OFConditionConst NET_EC_CannotStartSCPThread;
 extern DCMTK_DCMNET_EXPORT const OFConditionConst NET_EC_StopAfterAssociation;             /* Stop after current association (as requested) */
 extern DCMTK_DCMNET_EXPORT const OFConditionConst NET_EC_StopAfterConnectionTimeout;       /* Stop after TCP connection timeout (as requested) */
 extern DCMTK_DCMNET_EXPORT const OFConditionConst NET_EC_InvalidSCPAssociationProfile;     /* Invalid or non-existing SCP Association Profile */
+extern DCMTK_DCMNET_EXPORT const OFConditionConst NET_EC_AssociatePDUTooLarge;             /* A-ASSOCIATE PDU too large */
 
 // This macro creates a condition with given code, severity and text.
 // Making this a macro instead of a function saves the creation of a temporary.
index 59854fb2e9519335375193f2c1744d836a51e1e6..72445cba3d0e7ebae336da3dc310e3083d20d291 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 #include "dcmtk/dcmnet/dndefine.h"
 #include "dcmtk/dcmnet/dntypes.h"
 
+/** @file dcmlayer.h
+ *  @brief type definitions and classes for transport connections
+ */
+
 /** this enum represents the result of a transport layer operation
  *  which may be a transparent TCP/IP or a secure TLS operation.
  */
@@ -68,7 +72,6 @@ class DcmTransportConnection;
  *  Base class only supports transparent TCP connections, subclasses
  *  may also support secure transport layer connections.
  */
-
 class DCMTK_DCMNET_EXPORT DcmTransportLayer
 {
 public:
@@ -77,12 +80,6 @@ public:
    */
   DcmTransportLayer() { /* empty */ }
 
-  /** constructor.
-   *  #param networkRole network role to be used by the application, influences
-   *    the choice of the secure transport layer code.
-   */
-  DcmTransportLayer(int /* networkRole */ ) { /* empty */ }
-
   /** move constructor.
    *  @param rhs an rvalue reference to another DcmTransportLayer object that
    *    will be moved.
@@ -104,7 +101,7 @@ public:
    *  or a secure connection is established.  If the object cannot be created
    *  (e. g. because no secure layer is available), returns NULL.
    *  @param openSocket TCP/IP socket to be used for the transport connection.
-   *    the connection must already be establised on socket level. If a non-null
+   *    the connection must already be established on socket level. If a non-null
    *    pointer is returned, the new connection object takes over control of the socket.
    *  @param useSecureLayer if true, a secure layer is used. If false, a
    *    transparent layer is used.
index 75bdc55e8f6f311216f19a03a88c3a8138aea82b..3871654afd1fd719ee42fd0c15f8367883ffbb7b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 #define INCLUDE_UNISTD
 #include "dcmtk/ofstd/ofstdinc.h"
 
+// include this file in doxygen documentation
+
+/** @file dcmtrans.h
+ *  @brief global variables and classes for transport connections
+ */
+
 /** Global timeout in seconds for sending data on a socket to a remote host.
  *  The default value is 60, which is useful in cases where the sender (e.g.
  *  storescu) looses the connection to the receiver because the network cable
@@ -221,7 +227,7 @@ private:
    *  reading. If none of the specified transport connections is ready
    *  for reading, this method blocks up to the specified timeout interval
    *  or until one of the connections becomes readable, whatever occurs
-   *  first. This method uses the select() system call. It may only be used
+   *  first. This method uses the poll() or select() system call. It may only be used
    *  with an array of transparent TCP transport connections. This precondition
    *  must be assured by the caller.
    *  @param connections list of transport connections. May contain NULL entries.
index 54619528c61497de0d72480944462c1c86f11280..4363e29d9bf5a457f3d539bd83a4cafea32b4018 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2008-2017, OFFIS e.V.
+ *  Copyright (C) 2008-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 #include "dcmtk/ofstd/ofcond.h"
 #include "dcmtk/dcmnet/dndefine.h"
 
+// include this file in doxygen documentation
+
+/** @file dcuserid.h
+ *  @brief type definitions, constants and classes for User Identity Negotiation
+ */
+
 /// User Identity Negotiation request always identifies with 0x58
 #define DUL_TYPENEGOTIATIONOFUSERIDENTITY_REQ (unsigned char)0x58
 /// User Identity Negotiation acknowledge identifies with 0x59
 #define DUL_TYPENEGOTIATIONOFUSERIDENTITY_ACK (unsigned char)0x59
 
-/// Mode of User Identity Negotiation
+/// Mode of User Identity Negotiation. In case of update, don't forget to
+/// also update ASC_USER_IDENTITY_MAX_VALUE accordingly.
 enum T_ASC_UserIdentityNegotiationMode
 {
     ASC_USER_IDENTITY_NONE            = 0,
@@ -40,9 +47,14 @@ enum T_ASC_UserIdentityNegotiationMode
     ASC_USER_IDENTITY_USER_PASSWORD   = 2,
     ASC_USER_IDENTITY_KERBEROS        = 3,
     ASC_USER_IDENTITY_SAML            = 4,
+    ASC_USER_IDENTITY_JWT             = 5,
+    /// entry always pointing to last valid entry, i.e. max valid number
+    ASC_USER_IDENTITY_MAX_VALUE       = ASC_USER_IDENTITY_JWT,
     ASC_USER_IDENTITY_UNKNOWN
 };
 
+/// Number of valid User Identity Negotiaton Modes.
+#define numUserIDModes 5
 
 /** Abstract base class for User Identity Negotiation user items
  */
index 02bfad97686b9ab180707aa69e893866d8ecf86a..088aa072ad938552a881688836e71ab89be713f8 100644 (file)
@@ -40,17 +40,17 @@ struct T_DIMSE_C_FindRSP;
 // include this file in doxygen documentation
 
 /** @file dfindscu.h
- *  @brief Service Class User (SCU) for C-FIND
+ *  @brief Service Class User (SCU) for C-FIND.
  */
 
 
-/** mode specifying whether and how to extract C-FIND responses
+/** mode specifying whether and how to extract C-FIND responses.
  */
 enum DcmFindSCUExtractMode
 {
-  /// do not extract C-FIND responses to file
+  /// do not extract C-FIND responses to file.
   FEM_none,
-  /// extract each C-FIND-RSP dataset to a DICOM file
+  /// extract each C-FIND-RSP dataset to a DICOM file.
   FEM_dicomFile,
   /// extract each C-FIND-RSP dataset to an XML file.
   /// See "dcm2xml.dtd" for XML format (starts with top-level element "data-set").
@@ -88,14 +88,14 @@ public:
   virtual ~DcmFindSCUCallback() {}
 
   /** callback method that is called once for each incoming C-FIND-RSP message.
-   *  @param request DIMSE command of the original C-FIND request
-   *  @param responseCount number of current response
-   *  @param rsp DIMSE command of incoming C-FIND response
-   *  @param responseIdentifiers dataset of incoming C-FIND response
+   *  @param request DIMSE command of the original C-FIND request.
+   *  @param responseCount number of current response.
+   *  @param rsp DIMSE command of incoming C-FIND response.
+   *  @param responseIdentifiers dataset of incoming C-FIND response.
    */
   virtual void callback(
         T_DIMSE_C_FindRQ *request,
-        int responseCount,
+        int &responseCount,
         T_DIMSE_C_FindRSP *rsp,
         DcmDataset *responseIdentifiers) = 0;
 
@@ -123,10 +123,10 @@ protected: /* the two member variables are protected and can be accessed from de
 
 private:
 
-  /// private undefined copy constructor
+  /// private undefined copy constructor.
   DcmFindSCUCallback(const DcmFindSCUCallback& other);
 
-  /// private undefined assignment operator
+  /// private undefined assignment operator.
   DcmFindSCUCallback& operator=(const DcmFindSCUCallback& other);
 
 };
@@ -140,13 +140,13 @@ class DCMTK_DCMNET_EXPORT DcmFindSCUDefaultCallback: public DcmFindSCUCallback
 public:
 
   /** constructor
-   *  @param extractResponses mode specifying whether and how to extract C-FIND responses
+   *  @param extractResponses mode specifying whether and how to extract C-FIND responses.
    *  @param cancelAfterNResponses if non-negative, a C-FIND-CANCEL will be issued after the
-   *    given number of incoming C-FIND-RSP messages
+   *    given number of incoming C-FIND-RSP messages.
    *  @param outputDirectory directory used to store the output files (e.g. response datasets).
    *    If NULL, the current directory is used.
    *  @param outputStream pointer to output stream that is used when extractResponses is set
-   *    to FEM_singleXMLFile
+   *    to FEM_singleXMLFile.
    */
   DcmFindSCUDefaultCallback(
     DcmFindSCUExtractMode extractResponses,
@@ -158,29 +158,29 @@ public:
   virtual ~DcmFindSCUDefaultCallback() {}
 
   /** callback method that is called once for each incoming C-FIND-RSP message.
-   *  @param request DIMSE command of the original C-FIND request
-   *  @param responseCount number of current response
-   *  @param rsp DIMSE command of incoming C-FIND response
-   *  @param responseIdentifiers dataset of incoming C-FIND response
+   *  @param request DIMSE command of the original C-FIND request.
+   *  @param responseCount a reference to the integer indicating the count of received responses.
+   *  @param rsp DIMSE command of incoming C-FIND response.
+   *  @param responseIdentifiers dataset of incoming C-FIND response.
    */
   virtual void callback(
         T_DIMSE_C_FindRQ *request,
-        int responseCount,
+        int &responseCount,
         T_DIMSE_C_FindRSP *rsp,
         DcmDataset *responseIdentifiers);
 
 private:
 
-   /// mode specifying whether and how to extract C-FIND responses
+   /// mode specifying whether and how to extract C-FIND responses.
    DcmFindSCUExtractMode extractResponses_;
 
-   /// if non-negative, a C-FIND-CANCEL will be issued after the given number of incoming C-FIND-RSP messages
+   /// if non-negative, a C-FIND-CANCEL will be issued after the given number of incoming C-FIND-RSP messages.
    int cancelAfterNResponses_;
 
-   /// directory used to store the output files (e.g. response datasets)
+   /// directory used to store the output files (e.g. response datasets).
    OFString outputDirectory_;
 
-   /// pointer to output stream that is used when extractResponses_ is FEM_singleXMLFile
+   /// pointer to output stream that is used when extractResponses_ is FEM_singleXMLFile.
    STD_NAMESPACE ofstream *outputStream_;
 };
 
@@ -194,7 +194,7 @@ class DCMTK_DCMNET_EXPORT DcmFindSCU
 {
 public:
 
-  /// constructor, does not execute any network-related code
+  /// constructor, does not execute any network-related code.
   DcmFindSCU();
 
   /// destructor. Destroys network structure if not done already.
@@ -202,7 +202,7 @@ public:
 
   /** initialize the network structure. This should be done only once.
    *  @param acse_timeout timeout for ACSE operations, in seconds
-   *  @return EC_Normal if successful, an error code otherwise
+   *  @return EC_Normal if successful, an error code otherwise.
    */
   OFCondition initializeNetwork(int acse_timeout);
 
@@ -214,45 +214,46 @@ public:
    *  The transport layer object will not be deleted by this class and
    *  must remain alive until this object is deleted or a new transport
    *  layer is set.
-   *  @param tLayer pointer to transport layer object
-   *  @return EC_Normal if successful, an error code otherwise
+   *  @param tLayer pointer to transport layer object.
+   *  @return EC_Normal if successful, an error code otherwise.
    */
   OFCondition setTransportLayer(DcmTransportLayer *tLayer);
 
   /** destroy network struct. This should be done only once.
-   *  @return EC_Normal if successful, an error code otherwise
+   *  @return EC_Normal if successful, an error code otherwise.
    */
   OFCondition dropNetwork();
 
   /** main worker method that negotiates an association, executes one or more
    *  C-FIND-RQ transactions, processes the responses and closes the association
    *  once everything is finished (or an error has occurred).
-   *  @param peer hostname or IP address of peer SCP host
-   *  @param port TCP port number of peer SCP host
-   *  @param ourTitle calling AE title
-   *  @param peerTitle called AE title
-   *  @param abstractSyntax SOP Class UID or Meta SOP Class UID of service
+   *  @param peer hostname or IP address of peer SCP host.
+   *  @param port TCP port number of peer SCP host.
+   *  @param ourTitle calling AE title.
+   *  @param peerTitle called AE title.
+   *  @param abstractSyntax SOP Class UID or Meta SOP Class UID of service.
    *  @param preferredTransferSyntax May be Unknown, Implicit Little Endian, or any of the
    *    two uncompressed explicit VR transfer syntaxes. By default (unknown), local endian
    *    explicit VR is proposed first, followed by opposite endian explicit VR, followed by
    *    implicit VR. This behavior can be modified by explicitly specifying the preferred
    *    explicit VR transfer syntax. With Little Endian Implicit, only Implicit VR is proposed.
-   *  @param blockMode DIMSE blocking mode
-   *  @param dimse_timeout timeout for DIMSE operations (in seconds)
+   *  @param blockMode DIMSE blocking mode.
+   *  @param dimse_timeout timeout for DIMSE operations (in seconds).
    *  @param maxReceivePDULength limit the maximum PDU size for incoming PDUs to the given value.
    *    This value should be less than or equal to ASC_DEFAULTMAXPDU, and is usually identical
    *    to ASC_DEFAULTMAXPDU (other values are only useful for debugging purposes).
    *  @param secureConnection this flag, if true, requests a secure TLS connection to be used
-   *    instead of a normal connection. This will only work if DCMTK has been compiled with
-   *    OpenSSL support (WITH_OPENSSL) and if a transport layer object supporting secure
-   *    connections has been set with setTransportLayer() prior to this call.
+   *    instead of a normal connection. A transport layer object supporting secure
+   *    connections must set with setTransportLayer() prior to this call.
+   *    @remark this parameter is only functional if DCMTK is compiled with
+   *      OpenSSL support enabled. Otherwise the method will return an error.
    *  @param abortAssociation abort association instead of releasing it (for debugging purposes)
    *  @param repeatCount number of times this query should be repeated
-   *    (for debugging purposes, works only with default callback)
+   *    (for debugging purposes, works only with default callback).
    *  @param extractResponses mode specifying whether and how to extract C-FIND responses
-   *    (works only with default callback)
+   *    (works only with default callback).
    *  @param cancelAfterNResponses issue C-FIND-CANCEL after given number of responses
-   *    (works only with default callback)
+   *    (works only with default callback).
    *  @param overrideKeys list of keys/paths that override those in the query files, if any.
    *    Either the list of query files or override keys or both should be non-empty, because the
    *    query dataset will be empty otherwise. For path syntax see DcmPath.
@@ -264,8 +265,8 @@ public:
    *  @param outputDirectory directory used to store the output files (e.g. response datasets).
    *    If NULL, the current directory is used.
    *  @param extractFilename filename used to store the response datasets when extractResponses is
-   *    set to FEM_singleXMLFile
-   *  @return EC_Normal if successful, an error code otherwise
+   *    set to FEM_singleXMLFile.
+   *  @return EC_Normal if successful, an error code otherwise.
    */
   OFCondition performQuery(
     const char *peer,
@@ -292,18 +293,18 @@ public:
    *  into a DICOM file (using the DICOM file format with metaheader).
    *  This method produces a temporary copy of the dataset and should, therefore,
    *  not be used with very large datasets.
-   *  @param ofname filename to write
-   *  @param dataset dataset to store in file
-   *  @return EC_Normal if successful, an error code otherwise
+   *  @param ofname filename to write.
+   *  @param dataset dataset to store in file.
+   *  @return EC_Normal if successful, an error code otherwise.
    */
   static OFBool writeToFile(const char* ofname, DcmDataset *dataset);
 
   /** static helper function that writes the content of the given dataset into
    *  an XML file (see "dcm2xml.dtd", starts with top-level element "data-set").
    *  This method also tries to determine the character encoding of the dataset.
-   *  @param ofname filename to write
-   *  @param dataset dataset to store in file
-   *  @return EC_Normal if successful, an error code otherwise
+   *  @param ofname filename to write.
+   *  @param dataset dataset to store in file.
+   *  @return EC_Normal if successful, an error code otherwise.
    */
   static OFBool writeToXMLFile(const char* ofname, DcmDataset *dataset);
 
@@ -311,14 +312,14 @@ private:
 
   /** add presentation context for given abstract syntax and given preferred transfer syntax
    *  to the ACSE parameter struct.
-   *  @param params ACSE parameter struct to be modified
-   *  @param abstractSyntax SOP Class UID or Meta SOP Class UID of service
+   *  @param params ACSE parameter struct to be modified.
+   *  @param abstractSyntax SOP Class UID or Meta SOP Class UID of service.
    *  @param preferredTransferSyntax May be Unknown, Implicit Little Endian, or any of the
    *    two uncompressed explicit VR transfer syntaxes. By default (unknown), local endian
    *    explicit VR is proposed first, followed by opposite endian explicit VR, followed by
    *    implicit VR. This behavior can be modified by explicitly specifying the preferred
    *    explicit VR transfer syntax. With Little Endian Implicit, only Implicit VR is proposed.
-   *  @return EC_Normal if successful, an error code otherwise
+   *  @return EC_Normal if successful, an error code otherwise.
    */
   OFCondition addPresentationContext(
     T_ASC_Parameters *params,
@@ -329,14 +330,15 @@ private:
    *  @param assoc DIMSE association
    *  @param fname file name for the query file to be used with this query. May be NULL.
    *  @param repeatCount number of times this query should be repeated
-   *    (for debugging purposes, works only with default callback)
-   *  @param abstractSyntax SOP Class UID or Meta SOP Class UID of service
-   *  @param blockMode DIMSE blocking mode
-   *  @param dimse_timeout timeout for DIMSE operations (in seconds)
+   *    (for debugging purposes, works only with default callback).
+   *  @param responseCount a reference to the integer indicating the count of received responses.
+   *  @param abstractSyntax SOP Class UID or Meta SOP Class UID of service.
+   *  @param blockMode DIMSE blocking mode.
+   *  @param dimse_timeout timeout for DIMSE operations (in seconds).
    *  @param extractResponses mode specifying whether and how to extract C-FIND responses
-   *    (works only with default callback)
+   *    (works only with default callback).
    *  @param cancelAfterNResponses issue C-FIND-CANCEL after given number of responses
-   *    (works only with default callback)
+   *    (works only with default callback).
    *  @param overrideKeys list of keys/paths that override those in the query files, if any.
    *    Either the list of query files or override keys or both should be non-empty, because
    *    the query dataset will be empty otherwise. For path syntax see DcmPath.
@@ -345,13 +347,14 @@ private:
    *  @param outputDirectory directory used to store the output files (e.g. response datasets).
    *    If NULL, the current directory is used.
    *  @param outputStream pointer to output stream that is used when extractResponses is set
-   *    to FEM_singleXMLFile
-   *  @return EC_Normal if successful, an error code otherwise
+   *    to FEM_singleXMLFile.
+   *  @return EC_Normal if successful, an error code otherwise.
    */
   OFCondition findSCU(
     T_ASC_Association * assoc,
     const char *fname,
     int repeatCount,
+    int &responseCount,
     const char *abstractSyntax,
     T_DIMSE_BlockingMode blockMode,
     int dimse_timeout,
index be7d580f53a921899ef44831fcacd1ac0f345efb..158061b44212e10fee3816b68cfdff692c637e41 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2016, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were partly developed by
@@ -133,7 +133,11 @@ typedef Uint32     MASK_32;        /* for bit masks */
 #define DIC_DS_LEN             16
 #define DIC_IS_LEN             12
 #define DIC_AT_LEN             (2*sizeof(DIC_US))
-#define DIC_NODENAME_LEN       128
+
+/* a valid DNS name can be up to 253 characters, and we need to add
+ * a port number. This should be sufficient.
+ */
+#define DIC_NODENAME_LEN       270
 
 #define DICOM_UI_LENGTH DIC_UI_LEN
 
index 59c199d2f490804d9c45c879685440f9baaade60..eff6eaa2b8b29475c404bf56abbeb6c84ac4a667 100644 (file)
@@ -80,7 +80,7 @@
 #define DIMSE_H
 
 /*
- * Required Include Files
+ * Required Include Files.
  */
 
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 
 class DcmOutputFileStream;
 
+// include this file in doxygen documentation
+
+/** @file dimse.h
+ *  @brief type definitions, constants, global variables and functions for the dcmnet/dimse module
+ */
+
 /** Global flag to enable/disable workaround code for some buggy Store SCUs
  * in DIMSE_storeProvider().  If enabled, an illegal space-padding in the
  * Affected SOP Instance UID field of the C-STORE-RQ message is retained
  * in the corresponding C-STORE-RSP message.
  * To enable the workaround, this flag must be set to OFTrue and
- * dcmEnableAutomaticInputDataCorrection must be set to OFFalse.
- * (see declaration in dcmdata/include/dcobject.h)
+ * dcmEnableAutomaticInputDataCorrection must be set to OFFalse
+ * (see declaration in dcmdata/include/dcobject.h).
  */
 extern DCMTK_DCMNET_EXPORT OFGlobal<OFBool> dcmPeerRequiresExactUIDCopy; /* default OFFalse */
 
@@ -115,7 +121,7 @@ extern DCMTK_DCMNET_EXPORT OFGlobal<Uint32> dcmMaxOutgoingPDUSize; /* default 2^
 
 
 /*
- * General Status Codes
+ * General Status Codes.
  */
 #define STATUS_Success  0x0000
 #define STATUS_Pending  0xff00
@@ -124,7 +130,7 @@ extern DCMTK_DCMNET_EXPORT OFGlobal<Uint32> dcmMaxOutgoingPDUSize; /* default 2^
 #define DICOM_WARNING_STATUS(status) ((((status) & 0xf000) == 0xb000) || ((status) == 0x0107) || ((status) == 0x0116))
 
 /*
- * Service Class Specific Status Codes
+ * Service Class Specific Status Codes.
  * NOTE: some codes are only significant in the high byte
  * or high nibble (4 bits).
  */
@@ -204,12 +210,12 @@ extern DCMTK_DCMNET_EXPORT OFGlobal<Uint32> dcmMaxOutgoingPDUSize; /* default 2^
 
 
 /*
- * Type Definitions
+ * Type Definitions.
  */
 
 
 /*
- * DIMSE Command Codes (Request and Response)
+ * DIMSE Command Codes (Request and Response).
  */
 typedef enum {                  /* DIC_US */
     DIMSE_NOTHING = 0x0000,     /* none of the rest !! */
@@ -241,7 +247,7 @@ typedef enum {                  /* DIC_US */
 } T_DIMSE_Command;
 
 /*
- * DIMSE Data Set Type Codes
+ * DIMSE Data Set Type Codes.
  */
 
 typedef enum {                  /* DIC_US */
@@ -250,7 +256,7 @@ typedef enum {                  /* DIC_US */
 } T_DIMSE_DataSetType;
 
 /*
- * DIMSE Priority Codes
+ * DIMSE Priority Codes.
  */
 
 typedef enum {                  /* DIC_US */
@@ -260,7 +266,7 @@ typedef enum {                  /* DIC_US */
 } T_DIMSE_Priority;
 
 /*
- * DIMSE Blocking Modes (reading)
+ * DIMSE Blocking Modes (reading).
  */
 
 typedef enum {
@@ -270,7 +276,7 @@ typedef enum {
 
 
 /*
- * DIMSE Messages
+ * DIMSE Messages.
  *
  */
 
@@ -756,7 +762,7 @@ typedef void (*DIMSE_FindUserCallback)(
         /* in */
         void *callbackData,
         T_DIMSE_C_FindRQ *request,      /* original find request */
-        int responseCount,
+        int responseCount,                             /* number of responses so far*/
         T_DIMSE_C_FindRSP *response,    /* pending response received */
         DcmDataset *responseIdentifiers /* pending response identifiers */
         );
@@ -767,6 +773,7 @@ DIMSE_findUser(
         T_ASC_Association *assoc,
         T_ASC_PresentationContextID presID,
         T_DIMSE_C_FindRQ *request, DcmDataset *requestIdentifiers,
+        int &responseCount,
         DIMSE_FindUserCallback callback, void *callbackData,
         /* blocking info for response */
         T_DIMSE_BlockingMode blockMode, int timeout,
index 101affe95802e8662004892c942d179ab58f8e9b..dd1eb355ad9050de9d630bfb201fff7893831d3f 100644 (file)
@@ -102,7 +102,7 @@ DCMTK_DCMNET_EXPORT void DU_stripTrailingSpaces(char *s);
 DCMTK_DCMNET_EXPORT void DU_stripLeadingSpaces(char *s);
 DCMTK_DCMNET_EXPORT void DU_stripLeadingAndTrailingSpaces(char *s);
 
-DCMTK_DCMNET_EXPORT OFBool DU_getStringDOElement(DcmItem *obj, DcmTagKey t, char *s);
+DCMTK_DCMNET_EXPORT OFBool DU_getStringDOElement(DcmItem *obj, DcmTagKey t, char *s, size_t bufsize);
 DCMTK_DCMNET_EXPORT OFBool DU_putStringDOElement(DcmItem *obj, DcmTagKey t, const char *s);
 DCMTK_DCMNET_EXPORT OFBool DU_getShortDOElement(DcmItem *obj, DcmTagKey t, Uint16 *us);
 DCMTK_DCMNET_EXPORT OFBool DU_putShortDOElement(DcmItem *obj, DcmTagKey t, Uint16 us);
@@ -110,13 +110,17 @@ DCMTK_DCMNET_EXPORT OFBool DU_putShortDOElement(DcmItem *obj, DcmTagKey t, Uint1
 DCMTK_DCMNET_EXPORT OFBool DU_findSOPClassAndInstanceInDataSet(
   DcmItem *obj,
   char* sopClass,
+  size_t sopClassSize,
   char* sopInstance,
+  size_t sopInstanceSize,
   OFBool tolerateSpacePaddedUIDs = OFFalse);
 
 DCMTK_DCMNET_EXPORT OFBool DU_findSOPClassAndInstanceInFile(
   const char *fname,
   char* sopClass,
+  size_t sopClassSize,
   char* sopInstance,
+  size_t sopInstanceSize,
   OFBool tolerateSpacePaddedUIDs = OFFalse);
 
 DCMTK_DCMNET_EXPORT const char *DU_cechoStatusString(Uint16 statusCode);
index 8737e8713b58292e01cca49f96734e666350706b..0aa10662ab6043e46a2a19de69b3b3357d682080 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2011-2016, OFFIS e.V.
+ *  Copyright (C) 2011-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -187,6 +187,9 @@ class DCMTK_DCMNET_EXPORT DcmStorageSCU
      *  of the DICOM standard.  For example, if a lossless compressed SOP instance is to be
      *  sent, there should be at least one presentation context for this SOP class that also
      *  proposes the default transfer syntax (Implicit VR Little Endian).
+     *  @note Please note that support for CP-1704 has not been implemented yet, i.e. it is
+     *    not checked whether the decompressed data cannot be encoded in the default transfer
+     *    syntax because it would be too large, which would also waive this requirement.
      *  @param  allowMode  mode indicating whether illegal proposals are allowed or not
      *                     (default: OFTrue, i.e.\ allowed)
      */
@@ -300,9 +303,9 @@ class DCMTK_DCMNET_EXPORT DcmStorageSCU
      *  contexts, which can be negotiated during a single association, is reached, this method
      *  returns and any subsequent call adds the next bunch of presentation contexts needed.
      *  @return status, EC_Normal if successful, an error code otherwise.  If no presentation
-     *     contexts have been added, NET_EC_NoPresentationContextsDefined is returned.  This
-     *     code can, therefore, be used to check that all SOP instances from the transfer list
-     *     have been negotiated and sent in previous calls.
+     *    contexts have been added, NET_EC_NoPresentationContextsDefined is returned.  This
+     *    code can, therefore, be used to check that all SOP instances from the transfer list
+     *    have been negotiated and sent in previous calls.
      */
     OFCondition addPresentationContexts();
 
index 271b990b4f81f4231d625869cc26282240d6b3d6..6144410539b7d0b8a5be2a0297540b7c3de4a54e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were partly developed by
@@ -77,6 +77,12 @@ class DcmTransportConnection;
 class DcmTransportLayer;
 class LST_HEAD;
 
+// include this file in doxygen documentation
+
+/** @file dul.h
+ *  @brief type definitions, constants, global variables and functions for the dcmnet/dul module
+ */
+
 /** Global flag to enable/disable reverse DNS lookup when accepting associations.
  *  If disabled, the numerical IP address instead of the symbolic hostname is
  *  stored in the callingPresentationAddress field of the association parameters
@@ -109,6 +115,18 @@ extern DCMTK_DCMNET_EXPORT OFGlobal<const char *> dcmTCPWrapperDaemonName;   /*
  */
 extern DCMTK_DCMNET_EXPORT OFGlobal<unsigned long> dcmEnableBackwardCompatibility;
 
+/** Maximum size (in bytes) of incoming A-ASSOCIATE-RQ or A-ASSOCIATE-AC PDUs
+ *  that we are willing to accept. Under normal conditions, valid A-ASSOCIATE PDUs
+ *  will never be larger than 64 kBytes, so the default of 1 MByte should be safe.
+ *  We should limit the maximum accepted PDU size to avoid denial of service
+ *  attacks through faulty PDUs that cause the network layer to allocate up
+ *  to 4 GByte of memory for one PDU.
+ *
+ *  Note: This limit can be disabled by setting a value of zero, which
+ *  causes the behaviour to revert to that of DCMTK releases up to 3.6.3.
+ */
+extern DCMTK_DCMNET_EXPORT OFGlobal<size_t> dcmAssociatePDUSizeLimit;   /* default: 1 MB */
+
 typedef void DUL_NETWORKKEY;
 typedef void DUL_ASSOCIATIONKEY;
 typedef unsigned char DUL_PRESENTATIONCONTEXTID;
@@ -384,7 +402,7 @@ typedef enum {
 */
 
 #define DUL_DULCOMPAT     2768240730UL
-#define DUL_DIMSECOMPAT   851968UL
+#define DUL_DIMSECOMPAT   917504UL
 #define DUL_MAXPDUCOMPAT  4278190335UL
 
 /* Define the function prototypes for this facility.
index fcb80ffcccf52d8984086e6327fb50c9bce7dfb9..de7ec18744eaff5c4febb83e4d62b9017e2de92e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2009-2017, OFFIS e.V.
+ *  Copyright (C) 2009-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 #include "dcmtk/dcmnet/scpcfg.h"
 #include "dcmtk/dcmnet/diutil.h"    /* for DCMNET_WARN() */
 
-#ifdef WITH_ZLIB
-#include <zlib.h>     /* for zlibVersion() */
-#endif
-
 
 // include this file in doxygen documentation
 
index f3127979aa071c176e34a6e69a9143bff3d32eac..7f9e6ca019c1ce0adf54d7e2be354ac8b7517abf 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2012-2014, OFFIS e.V.
+ *  Copyright (C) 2012-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -38,6 +38,8 @@
  *  incoming TCP/IP connections and spawning a number of SCP worker threads
  *  that handle the incoming DICOM association on that connection. This base
  *  class is abstract.
+ *  @remark This class is only available if DCMTK is compiled with thread
+ *  support enabled.
  */
 class DCMTK_DCMNET_EXPORT DcmBaseSCPPool
 {
index 9b66650022b3fa9dae23f15f8e1a3afccb6c95b2..fdc2a0429fd50b9138de2376bcf1575d1bc6aeba 100644 (file)
@@ -43,12 +43,14 @@ assoc.o: assoc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -128,12 +130,14 @@ dcasccff.o: dcasccff.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -191,12 +195,14 @@ dcasccfg.o: dcasccfg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -310,11 +316,13 @@ dccfrsmp.o: dccfrsmp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -379,6 +387,7 @@ dccfuidh.o: dccfuidh.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -388,6 +397,7 @@ dccfuidh.o: dccfuidh.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h
 dcmlayer.o: dcmlayer.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -455,12 +465,14 @@ dcmtrans.o: dcmtrans.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -521,12 +533,14 @@ dcompat.o: dcompat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/diutil.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
@@ -593,11 +607,13 @@ dcuserid.o: dcuserid.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/dntypes.h dulstruc.h
 dfindscu.o: dfindscu.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -639,6 +655,7 @@ dfindscu.o: dfindscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -647,6 +664,7 @@ dfindscu.o: dfindscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -721,12 +739,14 @@ dimcancl.o: dimcancl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -788,8 +808,10 @@ dimcmd.o: dimcmd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -857,12 +879,14 @@ dimdump.o: dimdump.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -924,12 +948,14 @@ dimecho.o: dimecho.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -991,12 +1017,14 @@ dimfind.o: dimfind.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -1058,12 +1086,14 @@ dimget.o: dimget.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -1126,12 +1156,14 @@ dimmove.o: dimmove.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -1193,12 +1225,14 @@ dimse.o: dimse.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -1282,12 +1316,14 @@ dimstore.o: dimstore.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -1356,7 +1392,9 @@ diutil.o: diutil.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -1416,6 +1454,7 @@ dstorscp.o: dstorscp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1425,6 +1464,7 @@ dstorscp.o: dstorscp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -1548,6 +1588,7 @@ dstorscu.o: dstorscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1556,6 +1597,7 @@ dstorscu.o: dstorscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -1681,12 +1723,14 @@ dul.o: dul.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -1748,12 +1792,14 @@ dulconst.o: dulconst.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/diutil.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
@@ -1815,12 +1861,14 @@ dulextra.o: dulextra.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1883,12 +1931,14 @@ dulfsm.o: dulfsm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1957,7 +2007,9 @@ dulparse.o: dulparse.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2019,12 +2071,14 @@ dulpres.o: dulpres.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2087,6 +2141,7 @@ scp.o: scp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2096,6 +2151,7 @@ scp.o: scp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2226,12 +2282,14 @@ scpcfg.o: scpcfg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmnet/lst.h ../include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2290,6 +2348,7 @@ scppool.o: scppool.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2298,6 +2357,7 @@ scppool.o: scppool.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2416,6 +2476,7 @@ scpthrd.o: scpthrd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2425,6 +2486,7 @@ scpthrd.o: scpthrd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2544,6 +2606,7 @@ scu.o: scu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2553,6 +2616,7 @@ scu.o: scu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
index daba0b836d928bb7e1d2f84cdf1857a909f76b11..d5741a6910eb03df348c2a42bc1cdf012eccce0b 100644 (file)
@@ -219,11 +219,6 @@ typedef struct {
 ** Function Bodies
 */
 
-/*
- * Network creation/destroy wrappers.
- * The T_ASC_Network structure will be allocated/freed by
- * these routines.
- */
 
 OFCondition
 ASC_initializeNetwork(T_ASC_NetworkRole role,
@@ -282,7 +277,6 @@ ASC_dropNetwork(T_ASC_Network ** network)
  * Building Association parameters
  */
 
-/* create association parameters and initialize with default values */
 OFCondition
 ASC_createAssociationParameters(T_ASC_Parameters ** params,
         long maxReceivePDUSize)
@@ -371,12 +365,6 @@ destroyPresentationContextList(LST_HEAD ** lst)
 
 OFCondition
 ASC_destroyAssociationParameters(T_ASC_Parameters ** params)
- /*
-  * Free an association parameters structure and embedded information.
-  * You do not usually need to do this since the parameters structure will
-  * be noted in the association structure and automatically freed when an
-  * association terminates.
-  */
 {
 
     /* free the elements in the requested presentation context list */
@@ -401,9 +389,6 @@ ASC_setAPTitles(T_ASC_Parameters * params,
                 const char* callingAPTitle,
                 const char* calledAPTitle,
                 const char* respondingAPTitle)
- /*
-  * Copies the provided Application Titles in the association parameters.
-  */
 {
     if (callingAPTitle)
         strncpy(params->DULparams.callingAPTitle, callingAPTitle,
@@ -420,37 +405,32 @@ ASC_setAPTitles(T_ASC_Parameters * params,
 
 OFCondition
 ASC_getAPTitles(T_ASC_Parameters * params,
-                char* callingAPTitle,
-                char* calledAPTitle,
-                char* respondingAPTitle)
- /*
-  * Copies the Application Titles stored in the association parameters
-  * into the supplied string variables.  You must provide storage to copy
-  * into.
-  */
+    char* callingAPTitle,
+    size_t callingAPTitleSize,
+    char* calledAPTitle,
+    size_t calledAPTitleSize,
+    char* respondingAPTitle,
+    size_t respondingAPTitleSize)
 {
     if (callingAPTitle)
-        strcpy(callingAPTitle, params->DULparams.callingAPTitle);
+        OFStandard::strlcpy(callingAPTitle, params->DULparams.callingAPTitle, callingAPTitleSize);
     if (calledAPTitle)
-        strcpy(calledAPTitle, params->DULparams.calledAPTitle);
+        OFStandard::strlcpy(calledAPTitle, params->DULparams.calledAPTitle, calledAPTitleSize);
     if (respondingAPTitle)
-        strcpy(respondingAPTitle, params->DULparams.respondingAPTitle);
+        OFStandard::strlcpy(respondingAPTitle, params->DULparams.respondingAPTitle, respondingAPTitleSize);
 
     return EC_Normal;
 }
 
 OFCondition
 ASC_getApplicationContextName(T_ASC_Parameters * params,
-                              char* applicationContextName)
- /*
-  * Copies the Application Context Name stored in the association parameters
-  * into the supplied string variable.  You must provide storage to copy
-  * into.
-  */
+                              char* applicationContextName,
+                              size_t applicationContextNameSize)
 {
     if (applicationContextName)
-        strcpy(applicationContextName,
-               params->DULparams.applicationContextName);
+        OFStandard::strlcpy(applicationContextName,
+            params->DULparams.applicationContextName,
+            applicationContextNameSize);
     return EC_Normal;
 }
 
@@ -458,10 +438,6 @@ OFCondition
 ASC_setPresentationAddresses(T_ASC_Parameters * params,
                              const char* callingPresentationAddress,
                              const char* calledPresentationAddress)
- /*
-  * Copies the provided Presentation Addresses into the association
-  * parameters.
-  */
 {
     if (callingPresentationAddress)
         strncpy(params->DULparams.callingPresentationAddress,
@@ -478,19 +454,16 @@ ASC_setPresentationAddresses(T_ASC_Parameters * params,
 OFCondition
 ASC_getPresentationAddresses(T_ASC_Parameters * params,
                              char* callingPresentationAddress,
-                             char* calledPresentationAddress)
- /*
-  * Copies the Presentation Addresses stored in the association parameters
-  * into the supplied string variables.  You must provide storage to copy
-  * into.
-  */
+                             size_t callingPresentationAddressSize,
+                             char* calledPresentationAddress,
+                             size_t calledPresentationAddressSize)
 {
     if (callingPresentationAddress)
-        strcpy(callingPresentationAddress,
-               params->DULparams.callingPresentationAddress);
+        OFStandard::strlcpy(callingPresentationAddress,
+               params->DULparams.callingPresentationAddress, callingPresentationAddressSize);
     if (calledPresentationAddress)
-        strcpy(calledPresentationAddress,
-               params->DULparams.calledPresentationAddress);
+        OFStandard::strlcpy(calledPresentationAddress,
+               params->DULparams.calledPresentationAddress, calledPresentationAddressSize);
 
     return EC_Normal;
 }
@@ -498,10 +471,6 @@ ASC_getPresentationAddresses(T_ASC_Parameters * params,
 OFCondition
 ASC_getRejectParameters(T_ASC_Parameters * params,
                         T_ASC_RejectParameters * rejectParameters)
- /*
-  * Copies the Rejection Parameters stored in the association parameters into
-  * the supplied structure.  You must provide storage to copy into.
-  */
 {
     int reason;
     if (rejectParameters) {
@@ -518,7 +487,7 @@ ASC_getRejectParameters(T_ASC_Parameters * params,
 }
 
 OFString&
-ASC_printRejectParameters(OFString& str, T_ASC_RejectParameters *rej)
+ASC_printRejectParameters(OFString& str, const T_ASC_RejectParameters *rej)
 {
     const char *result;
     const char *source;
@@ -648,9 +617,6 @@ ASC_addPresentationContext(
     const char* transferSyntaxList[],
     int transferSyntaxListCount,
     T_ASC_SC_ROLE proposedRole)
- /*
-  * Adds a presentation context entry to the presentation context list.
-  */
 {
     DUL_PRESENTATIONCONTEXT *pc;
     LST_HEAD *lst;
@@ -687,7 +653,7 @@ ASC_addPresentationContext(
         return EC_MemoryExhausted;
     }
     pc->presentationContextID = presentationContextID;
-    strcpy(pc->abstractSyntax, abstractSyntax);
+    OFStandard::strlcpy(pc->abstractSyntax, abstractSyntax, sizeof(pc->abstractSyntax));
     pc->result = ASC_P_NOTYETNEGOTIATED;
     pc->proposedSCRole = ascRole2dulRole(proposedRole);
     pc->acceptedSCRole = ascRole2dulRole(ASC_SC_ROLE_DEFAULT);
@@ -704,7 +670,7 @@ ASC_addPresentationContext(
     {
         transfer = (DUL_TRANSFERSYNTAX*)malloc(sizeof(DUL_TRANSFERSYNTAX));
         if (transfer == NULL) return EC_MemoryExhausted;
-        strcpy(transfer->transferSyntax, transferSyntaxList[i]);
+        OFStandard::strlcpy(transfer->transferSyntax, transferSyntaxList[i], sizeof(transfer->transferSyntax));
         LST_Enqueue(&lst, (LST_NODE*)transfer);
     }
     pc->proposedTransferSyntax = lst;
@@ -728,10 +694,6 @@ ASC_addPresentationContext(
 
 int
 ASC_countPresentationContexts(T_ASC_Parameters * params)
- /*
-  * Returns the number of presentation contexts contained in the presentation
-  * context list.
-  */
 {
     LST_HEAD **l;
 
@@ -774,11 +736,6 @@ OFCondition
 ASC_getPresentationContext(T_ASC_Parameters * params,
                            int listPosition,
                            T_ASC_PresentationContext * presentationContext)
- /*
-  * You must supply the memory for presentationContext, the values stored in
-  * the presentation context list position indicated will be copied into the
-  * memory structure.
-  */
 {
     DUL_PRESENTATIONCONTEXT *pc;
     DUL_TRANSFERSYNTAX *transfer;
@@ -820,11 +777,11 @@ ASC_getPresentationContext(T_ASC_Parameters * params,
     presentationContext->resultReason = (T_ASC_P_ResultReason) pc->result;
     presentationContext->proposedRole = dulRole2ascRole(pc->proposedSCRole);
     presentationContext->acceptedRole = dulRole2ascRole(pc->acceptedSCRole);
-    strcpy(presentationContext->abstractSyntax,
-           pc->abstractSyntax);
+    OFStandard::strlcpy(presentationContext->abstractSyntax,
+           pc->abstractSyntax, sizeof(presentationContext->abstractSyntax));
     if (presentationContext->resultReason == ASC_P_ACCEPTANCE) {
-        strcpy(presentationContext->acceptedTransferSyntax,
-            pc->acceptedTransferSyntax);
+        OFStandard::strlcpy(presentationContext->acceptedTransferSyntax,
+            pc->acceptedTransferSyntax, sizeof(presentationContext->acceptedTransferSyntax));
     } else {
         presentationContext->acceptedTransferSyntax[0] = '\0';
     }
@@ -841,8 +798,8 @@ ASC_getPresentationContext(T_ASC_Parameters * params,
         {
           return makeDcmnetCondition(ASCC_CODINGERROR, OF_error, "ASC Coding error in ASC_getPresentationContext: too many transfer syntaxes");
         }
-        strcpy(presentationContext->proposedTransferSyntaxes[count],
-               transfer->transferSyntax);
+        OFStandard::strlcpy(presentationContext->proposedTransferSyntaxes[count],
+               transfer->transferSyntax, sizeof(presentationContext->proposedTransferSyntaxes[count]));
         count++;
         transfer = (DUL_TRANSFERSYNTAX*) LST_Next(l);
     }
@@ -859,10 +816,6 @@ ASC_acceptPresentationContext(
     const char* transferSyntax,
     T_ASC_SC_ROLE acceptedRole,
     const OFBool alwaysAcceptDefaultRole)
- /*
-  * The presentation context will be marked as accepted and the provided
-  * transfer syntax name chosen.
-  */
 {
     DUL_PRESENTATIONCONTEXT *proposedContext, *acceptedContext;
     OFCondition cond = EC_Normal;
@@ -872,7 +825,7 @@ ASC_acceptPresentationContext(
                               params->DULparams.requestedPresentationContext,
                                                 presentationContextID);
     if (proposedContext == NULL) return ASC_BADPRESENTATIONCONTEXTID;
-    strcpy(proposedContext->acceptedTransferSyntax, transferSyntax);
+    OFStandard::strlcpy(proposedContext->acceptedTransferSyntax, transferSyntax, sizeof(proposedContext->acceptedTransferSyntax));
 
     /* we want to mark this proposed context as being ok */
     proposedContext->result = ASC_P_ACCEPTANCE;
@@ -882,7 +835,7 @@ ASC_acceptPresentationContext(
      * proposed presentation context: If the requestor connects with default role but the
      * acceptor explicitly requires the SCP role (only) then the presentation context
      * will be rejected. All other cases do not lead to rejection but to actual "negotiation".
-     * DCMTK's behaviour can be seen in the delaration of enum DUL_SC_ROLE (see dul.h).
+     * DCMTK's behaviour can be seen in the declaration of enum DUL_SC_ROLE (see dul.h).
      * The logic of the role negotiation is implemented in constructSCUSCPRoles() (see dulconst.cc).
      */
     if ( (proposedContext->proposedSCRole == DUL_SC_ROLE_DEFAULT)
@@ -910,9 +863,9 @@ ASC_acceptPresentationContext(
     if (acceptedContext != NULL) {
         /* it is already in the list, mark it as accepted */
         acceptedContext->result = ASC_P_ACCEPTANCE;
-        strcpy(acceptedContext->abstractSyntax,
-               proposedContext->abstractSyntax);
-        strcpy(acceptedContext->acceptedTransferSyntax, transferSyntax);
+        OFStandard::strlcpy(acceptedContext->abstractSyntax,
+               proposedContext->abstractSyntax, sizeof(acceptedContext->abstractSyntax));
+        OFStandard::strlcpy(acceptedContext->acceptedTransferSyntax, transferSyntax, sizeof(acceptedContext->acceptedTransferSyntax));
         acceptedContext->proposedSCRole = proposedContext->proposedSCRole;
         acceptedContext->acceptedSCRole = ascRole2dulRole(acceptedRole);
     } else {
@@ -947,9 +900,6 @@ ASC_refusePresentationContext(
     T_ASC_Parameters * params,
     T_ASC_PresentationContextID presentationContextID,
     T_ASC_P_ResultReason resultReason)
- /*
-  * The presentation context will be marked as refused.
-  */
 {
     DUL_PRESENTATIONCONTEXT *proposedContext, *acceptedContext;
     OFCondition cond = EC_Normal;
@@ -970,14 +920,14 @@ ASC_refusePresentationContext(
     if (acceptedContext != NULL) {
         /* it is already in the list, mark it as refused */
         acceptedContext->result = resultReason;
-        strcpy(acceptedContext->abstractSyntax,
-               proposedContext->abstractSyntax);
+        OFStandard::strlcpy(acceptedContext->abstractSyntax,
+               proposedContext->abstractSyntax, sizeof(acceptedContext->abstractSyntax));
         /* we must send back a transfer syntax even though this
          * presentation context is refused.  Some software implementations
          * seem to get confused if we don't.
          */
-        strcpy(acceptedContext->acceptedTransferSyntax,
-                UID_LittleEndianImplicitTransferSyntax);
+        OFStandard::strlcpy(acceptedContext->acceptedTransferSyntax,
+                UID_LittleEndianImplicitTransferSyntax, sizeof(acceptedContext->acceptedTransferSyntax));
     } else {
 
         /*
@@ -1015,13 +965,6 @@ ASC_findAcceptedPresentationContext(
     T_ASC_Parameters * params,
     T_ASC_PresentationContextID presentationContextID,
     T_ASC_PresentationContext * presentationContext)
- /*
-  * ASC_findAcceptedPresentationContext: You must supply the memory for
-  * presentationContext, the values stored in the accepted presentation
-  * context list with given ID will be copied into the memory structure.
-  * Returns EC_Normal if found, or ASC_BADPRESENTATIONCONTEXTID if not
-  * found.
-  */
 {
     DUL_PRESENTATIONCONTEXT *pc;
     DUL_TRANSFERSYNTAX *transfer;
@@ -1070,11 +1013,6 @@ ASC_findAcceptedPresentationContextID(
     T_ASC_Association *assoc,
     const char* abstractSyntax)
 {
-    /* ASC_findAcceptedPresentationContextID:
-     * Searches in the accepted presentation context list for the given
-     * abstract syntax.  If found returns its PresentationContextID, otherwise
-     * returns 0 (which is not a valid ID).
-     */
     DUL_PRESENTATIONCONTEXT *pc;
     LST_HEAD **l;
     OFBool found = OFFalse;
@@ -1095,15 +1033,7 @@ ASC_findAcceptedPresentationContextID(
 }
 
 
-/* transfer syntax aware version of T_ASC_PresentationContextID.
- * Tries to find a presentation context that matches the characteristics
- * of the given DICOM dataset best
- * - if possible finds a presentation context with matching TS
- * - then tries to find an explicit VR uncompressed TS presentation ctx
- * - then tries to find an implicit VR uncompressed TS presentation ctx
- * - finally accepts each matching presentation ctx independent of TS.
- * Returns 0 if no appropriate presentation context could be found at all.
- */
+
 T_ASC_PresentationContextID
 ASC_findAcceptedPresentationContextID(
     T_ASC_Association *assoc,
@@ -1172,12 +1102,6 @@ ASC_acceptContextsWithTransferSyntax(
     const char* transferSyntax,
     int abstractSyntaxCount, const char* abstractSyntaxes[],
     T_ASC_SC_ROLE acceptedRole)
-/*
-  * Any proposed presentation contexts which are found abstractSyntaxes[]
-  * which also have proposed a transfer syntax of transferSyntax, will be
-  * accepted.  Any presentation contexts already marked as accepted will be
-  * left alone but any remaining presentation contexts will be refused.
-  */
 {
     OFCondition cond = EC_Normal;
     int n, i, j, k;
@@ -1400,6 +1324,27 @@ OFCondition ASC_setIdentRQSaml(
 }
 
 
+OFCondition ASC_setIdentRQJwt(
+    T_ASC_Parameters * params,
+    const char* jwt,
+    const Uint16 length,
+    const OFBool requestRsp)
+{
+  if (params == NULL)
+    return ASC_NULLKEY;
+  UserIdentityNegotiationSubItemRQ* rq = params->DULparams.reqUserIdentNeg;
+  if (rq == NULL)
+    rq = new UserIdentityNegotiationSubItemRQ();
+  else
+    rq->clear();
+  rq->setIdentityType(ASC_USER_IDENTITY_JWT);
+  rq->setPrimField(jwt, length);
+  rq->setReqPosResponse(requestRsp);
+  params->DULparams.reqUserIdentNeg = rq;
+  return EC_Normal;
+}
+
+
 void ASC_getCopyOfIdentResponse(T_ASC_Parameters * params,
                                 char*& buffer,
                                 unsigned short& bufferLen)
@@ -1443,10 +1388,6 @@ OFCondition ASC_setIdentAC(
 
 static OFString
 ASC_dumpPresentationContext(T_ASC_PresentationContext * p)
- /*
-  * Write presentation context structure in textual form to stdout.
-  * (debugging aid)
-  */
 {
     int i = 0;
     OFOStringStream outstream;
@@ -1520,9 +1461,6 @@ ASC_dumpPresentationContext(T_ASC_PresentationContext * p)
 
 OFString&
 ASC_dumpParameters(OFString& str, T_ASC_Parameters * params, ASC_associateType dir)
- /*
-  * Write parameters in textual form to stdout (debugging aid)
-  */
 {
     int i;
     T_ASC_PresentationContext pc;
@@ -1730,7 +1668,7 @@ ASC_associationWaiting(T_ASC_Network * network, int timeout)
     t.tv_usec = 0;
 
 #ifdef DCMTK_HAVE_POLL
-    struct pollfd pfd[] = 
+    struct pollfd pfd[] =
     {
         { s, POLLIN, 0 }
     };
@@ -1891,7 +1829,7 @@ updateRequestedPCFromAcceptedPC(
 
     rpc->result = apc->result;
     if (apc->result == ASC_P_ACCEPTANCE) {
-        strcpy(rpc->acceptedTransferSyntax, apc->acceptedTransferSyntax);
+        OFStandard::strlcpy(rpc->acceptedTransferSyntax, apc->acceptedTransferSyntax, sizeof(rpc->acceptedTransferSyntax));
     } else {
         rpc->acceptedTransferSyntax[0] = '\0';
     }
@@ -2029,10 +1967,10 @@ ASC_requestAssociation(T_ASC_Network * network,
         (*assoc)->sendPDVLength = sendLen;
         (*assoc)->sendPDVBuffer = (unsigned char*)malloc(size_t(sendLen));
         if ((*assoc)->sendPDVBuffer == NULL) return EC_MemoryExhausted;
-        strcpy(params->theirImplementationClassUID,
-           params->DULparams.calledImplementationClassUID);
-        strcpy(params->theirImplementationVersionName,
-           params->DULparams.calledImplementationVersionName);
+        OFStandard::strlcpy(params->theirImplementationClassUID,
+           params->DULparams.calledImplementationClassUID, sizeof(params->theirImplementationClassUID));
+        OFStandard::strlcpy(params->theirImplementationVersionName,
+           params->DULparams.calledImplementationVersionName, sizeof(params->theirImplementationVersionName));
 
         /* make sure accepted PCs are marked as such in the requested PC list */
         cond = updateRequestedPCListFromAcceptedPCList(&params->DULparams);
@@ -2060,10 +1998,10 @@ ASC_acknowledgeAssociation(
       assoc->params->DULparams.maxPDU = dcmEnableBackwardCompatibility.get() | DUL_DULCOMPAT | DUL_DIMSECOMPAT;
     }
 
-    strcpy(assoc->params->DULparams.calledImplementationClassUID,
-        assoc->params->ourImplementationClassUID);
-    strcpy(assoc->params->DULparams.calledImplementationVersionName,
-        assoc->params->ourImplementationVersionName);
+    OFStandard::strlcpy(assoc->params->DULparams.calledImplementationClassUID,
+        assoc->params->ourImplementationClassUID, sizeof(assoc->params->DULparams.calledImplementationClassUID));
+    OFStandard::strlcpy(assoc->params->DULparams.calledImplementationVersionName,
+        assoc->params->ourImplementationVersionName, sizeof(assoc->params->DULparams.calledImplementationVersionName));
 
     OFCondition cond = DUL_AcknowledgeAssociationRQ(&assoc->DULassociation,
                                         &assoc->params->DULparams,
@@ -2119,7 +2057,7 @@ ASC_acknowledgeAssociation(
 OFCondition
 ASC_rejectAssociation(
     T_ASC_Association * association,
-    T_ASC_RejectParameters * rejectParameters,
+    const T_ASC_RejectParameters * rejectParameters,
     void **associatePDU,
     unsigned long *associatePDUlength)
 {
@@ -2244,14 +2182,14 @@ void ASC_activateCallback(T_ASC_Parameters *params, DUL_ModeCallback *cb)
 
 
 // Deprecated wrapper functions follow
-void ASC_printRejectParameters(FILE *f, T_ASC_RejectParameters *rej)
+void ASC_printRejectParameters(FILE *f, const T_ASC_RejectParameters *rej)
 {
     OFString str;
     ASC_printRejectParameters(str, rej);
     fprintf(f, "%s\n", str.c_str());
 }
 
-void ASC_printRejectParameters(STD_NAMESPACE ostream& out, T_ASC_RejectParameters *rej)
+void ASC_printRejectParameters(STD_NAMESPACE ostream& out, const T_ASC_RejectParameters *rej)
 {
     OFString str;
     ASC_printRejectParameters(str, rej);
index 437d2627c3f31223ae3f8f08ee6f462794ab245d..1376c10bba5967c53e1e89255c5910c7658822cf 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -91,6 +91,7 @@ makeOFConditionConst(NET_EC_CannotStartSCPThread,            OFM_dcmnet, 1075, O
 makeOFConditionConst(NET_EC_StopAfterAssociation,            OFM_dcmnet, 1076, OF_ok, "Stop after current association (as requested)");
 makeOFConditionConst(NET_EC_StopAfterConnectionTimeout,      OFM_dcmnet, 1077, OF_ok, "Stop after TCP connection timeout (as requested)");
 makeOFConditionConst(NET_EC_InvalidSCPAssociationProfile,    OFM_dcmnet, 1078, OF_error, "Invalid or non-existing SCP Association Profile");
+makeOFConditionConst(NET_EC_AssociatePDUTooLarge,            OFM_dcmnet, 1079, OF_error, "A-ASSOCIATE PDU too large");
 
 
 OFString& DimseCondition::dump(OFString& str, OFCondition cond)
index c78b61836da0ce83fd2f7b4ffb9d47dc75bd37f4..3e90d4ff039da853b47f3307fb7ebc0bafe6b38a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2003-2015, OFFIS e.V.
+ *  Copyright (C) 2003-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -108,7 +108,6 @@ OFCondition DcmTransferSyntaxMap::add(
     return makeOFCondition(OFM_dcmnet, 1024, OF_error, s.c_str());
   }
 
-  DcmTransferSyntaxList * const *value = NULL;
   OFString skey(key);
   OFMap<OFString, DcmTransferSyntaxList*>::iterator it = map_.find(skey);
 
@@ -116,13 +115,11 @@ OFCondition DcmTransferSyntaxMap::add(
   {
     DcmTransferSyntaxList *newentry = new DcmTransferSyntaxList();
     map_.insert(OFPair<OFString, DcmTransferSyntaxList*>(skey, newentry));
-    value = &newentry;
+    newentry->push_back(uid);
   }
   else
-    value = & ((*it).second);
+    (*it).second->push_back(uid);
 
-  // insert UID into list.
-  (*value)->push_back(uid);
   return EC_Normal;
 }
 
index 3ea7f676cc7ac7bd59578775d6713051f4065292..ce0762e9f318d73efd0b6e0171a83843723f2c58 100644 (file)
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 #include "dcmtk/dcmnet/dcmlayer.h"
 #include "dcmtk/dcmnet/dcmtrans.h"
+#include "dcmtk/dcmnet/dndefine.h"
+
+#ifdef WITH_TCPWRAPPER
+BEGIN_EXTERN_C
+#include <syslog.h>
+END_EXTERN_C
+#endif
 
 DcmTransportLayer::~DcmTransportLayer()
 {
@@ -33,3 +40,16 @@ DcmTransportConnection * DcmTransportLayer::createConnection(DcmNativeSocketType
   if (useSecureLayer) return NULL;  /* secure layer connections not supported */
   else return new DcmTCPConnection(openSocket);
 }
+
+#ifdef WITH_TCPWRAPPER
+#ifndef TCPWRAPPER_SEVERITY_EXTERN
+
+/* libwrap expects that two global flags, deny_severity and allow_severity,
+ * are defined and initialized by user code. If these flags are already present
+ * somewhere else, compile DCMTK with TCPWRAPPER_SEVERITY_EXTERN defined
+ * to avoid linker errors due to duplicate symbols.
+ */
+int DCMTK_DCMNET_EXPORT deny_severity = LOG_WARNING;
+int DCMTK_DCMNET_EXPORT allow_severity = LOG_INFO;
+#endif
+#endif
index 128aba1c198779aed502edad78aa9b3dc0a35821..0c8b2b4ea6fab463d2f31c4395f92fdf2ba279e4 100644 (file)
@@ -30,6 +30,7 @@
 #include "dcmtk/dcmnet/dcmtrans.h"
 #include "dcmtk/dcmnet/dcompat.h"     /* compatibility code for certain Unix dialects such as SunOS */
 #include "dcmtk/dcmnet/diutil.h"
+#include "dcmtk/ofstd/ofvector.h"
 
 #define INCLUDE_CSTDLIB
 #define INCLUDE_CSTDIO
@@ -189,18 +190,26 @@ OFBool DcmTransportConnection::fastSelectReadableAssociation(DcmTransportConnect
 
 #ifdef _WIN32
   SOCKET socketfd = INVALID_SOCKET;
-  SOCKET maxsocketfd = INVALID_SOCKET;
-#else
+#else /* _WIN32 */
   int socketfd = -1;
+#endif /* _WIN32 */
+
+#ifdef DCMTK_HAVE_POLL
+  OFVector<struct pollfd> pfd;
+  pfd.reserve(connCount);
+  struct pollfd pfd1 = {0, POLLIN, 0};
+#else /* DCMTK_HAVE_POLL */
+  fd_set fdset;
+  FD_ZERO(&fdset);
+#ifdef _WIN32
+  SOCKET maxsocketfd = INVALID_SOCKET;
+#else /* _WIN32 */
   int maxsocketfd = -1;
-#endif
+#endif /* _WIN32 */
+#endif /* DCMTK_HAVE_POLL */
 
   int i=0;
   struct timeval t;
-#ifndef DCMTK_HAVE_POLL
-  fd_set fdset;
-  FD_ZERO(&fdset);
-#endif
   OFTimer timer;
   int lTimeout = timeout;
 
@@ -209,24 +218,21 @@ OFBool DcmTransportConnection::fastSelectReadableAssociation(DcmTransportConnect
     if (connections[i])
     {
       socketfd = connections[i]->getSocket();
-#ifndef DCMTK_HAVE_POLL
+#ifdef DCMTK_HAVE_POLL
+      pfd1.fd = socketfd;
+      pfd.push_back(pfd1);
+#else /* DCMTK_HAVE_POLL */
 #ifdef __MINGW32__
       /* on MinGW, FD_SET expects an unsigned first argument */
       FD_SET((unsigned int)socketfd, &fdset);
-#else
+#else /* __MINGW32__ */
       FD_SET(socketfd, &fdset);
 #endif /* __MINGW32__ */
-#endif /* DCMTK_HAVE_POLL */
       if (socketfd > maxsocketfd) maxsocketfd = socketfd;
+#endif /* DCMTK_HAVE_POLL */
     }
   }
 
-#ifdef DCMTK_HAVE_POLL
-  struct pollfd pfd[] = {
-    { maxsocketfd, POLLIN, 0 }
-  };
-#endif
-
   OFBool done = OFFalse;
   while (!done)
   {
@@ -236,7 +242,7 @@ OFBool DcmTransportConnection::fastSelectReadableAssociation(DcmTransportConnect
     t.tv_usec = 0;
 
 #ifdef DCMTK_HAVE_POLL
-    int nfound = poll(pfd, 1, t.tv_sec*1000+(t.tv_usec/1000));
+    int nfound = poll(&pfd[0], pfd.size(), t.tv_sec*1000+(t.tv_usec/1000));
 #else /* DCMTK_HAVE_POLL */
 #ifdef HAVE_INTP_SELECT
     int nfound = select(OFstatic_cast(int, maxsocketfd + 1), (int *)(&fdset), NULL, NULL, &t);
@@ -272,15 +278,11 @@ OFBool DcmTransportConnection::fastSelectReadableAssociation(DcmTransportConnect
   {
     if (connections[i])
     {
-      socketfd = connections[i]->getSocket();
+      /* if not available, set entry in array to NULL */
 #ifdef DCMTK_HAVE_POLL
-      pfd[0].fd = socketfd;
-      pfd[0].events = POLLIN;
-      pfd[0].revents = 0;
-      poll(pfd, 1, 0);
-      if(!(pfd[0].revents & POLLIN)) connections[i] = NULL;
+      if(!(pfd[i].revents & POLLIN)) connections[i] = NULL;
 #else
-      /* if not available, set entry in array to NULL */
+      socketfd = connections[i]->getSocket();
       if (!FD_ISSET(socketfd, &fdset)) connections[i] = NULL;
 #endif
     }
index 69c0a7d3cc1086be6bf2fdf0fe13f867b4db24d3..e235b9f745a87f04d1608b441346007e059d5f64 100644 (file)
@@ -301,7 +301,7 @@ int dcmtk_flock(int fd, int operation)
 ** Use the SYSV uname function (if we have it)
 */
 #ifdef HAVE_UNAME
-int gethostname(char* name, int namelen);
+int gethostname(char* name, int namelen)
 {
     struct utsname uts;
     int rc;
index 39d095e7e77d88b840870c65d3ead06ad79e6e07..6a2d72a20dd2a197965a35330ab45f8ba479dd15 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -268,7 +268,7 @@ OFCondition UserIdentityNegotiationSubItemRQ::parseFromBuffer(unsigned char *rea
 
   // Parse user identity type
   const unsigned char identType = *readBuffer;
-  if ((identType < 1) || (identType > 4))
+  if ((identType < 1) || (identType > ASC_USER_IDENTITY_MAX_VALUE))
     m_userIdentityType = ASC_USER_IDENTITY_UNKNOWN;
   else
     m_userIdentityType = OFstatic_cast(T_ASC_UserIdentityNegotiationMode, identType);
@@ -379,6 +379,10 @@ void UserIdentityNegotiationSubItemRQ::dump(STD_NAMESPACE ostream& outstream) co
       outstream << "  Authentication mode 4: SAML" << OFendl <<
         "  SAML Assertion (not dumped) length: " << m_primFieldLength << OFendl;
       break;
+    case ASC_USER_IDENTITY_JWT:
+      outstream << "  Authentication mode 5: JWT" << OFendl <<
+        "  JSON Web Token (not dumped) length: " << m_primFieldLength << OFendl;
+      break;
     default:
       outstream << "  Authentication mode: Unknown " << OFendl <<
         "  First value (not dumped), length: " << m_primFieldLength << OFendl <<
index 9616448561d38f84e0dfd945c827e0f0ece9d490..9a4305c59e7e13a820fcdb067b569d24e828b62a 100644 (file)
@@ -88,10 +88,10 @@ DcmFindSCUDefaultCallback::DcmFindSCUDefaultCallback(
 
 void DcmFindSCUDefaultCallback::callback(
     T_DIMSE_C_FindRQ *request,
-    int responseCount,
+    int &responseCount,
     T_DIMSE_C_FindRSP *rsp,
     DcmDataset *responseIdentifiers)
- {
+{
     OFLogger rspLogger = OFLog::getLogger(DCMNET_LOGGER_NAME ".responses");
     /* check whether debug mode is enabled */
     if (DCM_dcmnetLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL))
@@ -117,7 +117,7 @@ void DcmFindSCUDefaultCallback::callback(
     if (extractResponses_ == FEM_dicomFile)
     {
         OFString outputFilename;
-        char rspIdsFileName[16];
+        char rspIdsFileName[32];
         sprintf(rspIdsFileName, "rsp%04d.dcm", responseCount);
         OFStandard::combineDirAndFilename(outputFilename, outputDirectory_, rspIdsFileName, OFTrue /*allowEmptyDirName*/);
         DCMNET_INFO("Writing response dataset to file: " << outputFilename);
@@ -127,7 +127,7 @@ void DcmFindSCUDefaultCallback::callback(
     else if (extractResponses_ == FEM_xmlFile)
     {
         OFString outputFilename;
-        char rspIdsFileName[16];
+        char rspIdsFileName[32];
         sprintf(rspIdsFileName, "rsp%04d.xml", responseCount);
         OFStandard::combineDirAndFilename(outputFilename, outputDirectory_, rspIdsFileName, OFTrue /*allowEmptyDirName*/);
         DCMNET_INFO("Writing response dataset to file: " << outputFilename);
@@ -235,6 +235,7 @@ OFCondition DcmFindSCU::performQuery(
     OFString temp_str;
     OFString outputFilename;
     STD_NAMESPACE ofstream outputStream;
+    int responseCount = 0;
 
     /* check input parameters first */
     if (extractResponses == FEM_singleXMLFile)
@@ -334,13 +335,13 @@ OFCondition DcmFindSCU::performQuery(
     if ((fileNameList == NULL) || fileNameList->empty())
     {
         /* no files provided on command line */
-        cond = findSCU(assoc, NULL, repeatCount, abstractSyntax, blockMode, dimse_timeout, extractResponses, cancelAfterNResponses, overrideKeys, callback, outputDirectory, &outputStream);
+        cond = findSCU(assoc, NULL, repeatCount, responseCount, abstractSyntax, blockMode, dimse_timeout, extractResponses, cancelAfterNResponses, overrideKeys, callback, outputDirectory, &outputStream);
     } else {
         OFListIterator(OFString) iter = fileNameList->begin();
         OFListIterator(OFString) enditer = fileNameList->end();
         while ((iter != enditer) && cond.good())
         {
-            cond = findSCU(assoc, (*iter).c_str(), repeatCount, abstractSyntax, blockMode, dimse_timeout, extractResponses, cancelAfterNResponses, overrideKeys, callback, outputDirectory, &outputStream);
+            cond = findSCU(assoc, (*iter).c_str(), repeatCount, responseCount, abstractSyntax, blockMode, dimse_timeout, extractResponses, cancelAfterNResponses, overrideKeys, callback, outputDirectory, &outputStream);
             ++iter;
         }
     }
@@ -585,6 +586,7 @@ OFCondition DcmFindSCU::findSCU(
     T_ASC_Association * assoc,
     const char *fname,
     int repeatCount,
+    int &responseCount,
     const char *abstractSyntax,
     T_DIMSE_BlockingMode blockMode,
     int dimse_timeout,
@@ -665,7 +667,7 @@ OFCondition DcmFindSCU::findSCU(
 
     /* prepare C-FIND-RQ message */
     bzero(OFreinterpret_cast(char*, &req), sizeof(req));
-    strcpy(req.AffectedSOPClassUID, abstractSyntax);
+    OFStandard::strlcpy(req.AffectedSOPClassUID, abstractSyntax, sizeof(req.AffectedSOPClassUID));
     req.DataSetType = DIMSE_DATASET_PRESENT;
     req.Priority = DIMSE_PRIORITY_MEDIUM;
 
@@ -695,7 +697,7 @@ OFCondition DcmFindSCU::findSCU(
         DCMNET_INFO("Request Identifiers:" << OFendl << DcmObject::PrintHelper(*dset));
 
         /* finally conduct transmission of data */
-        cond = DIMSE_findUser(assoc, presId, &req, dset,
+        cond = DIMSE_findUser(assoc, presId, &req, dset, responseCount,
             progressCallback, callback, blockMode, dimse_timeout,
             &rsp, &statusDetail);
 
index 9a291786850c3105d42a346719747f202a2a7898..06312d3e8b40d586455c1718a0431e32522bb8a0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were partly developed by
@@ -97,6 +97,7 @@
 #include "dcmtk/dcmdata/dcelem.h"
 #include "dcmtk/dcmnet/diutil.h"
 #include "dcmtk/dcmnet/dimse.h"
+#include "dcmtk/ofstd/ofstd.h"
 #include "dimcmd.h"
 
 /*
@@ -207,7 +208,7 @@ getString(DcmDataset *obj, DcmTagKey t, char *s, int maxlen, OFBool *spacePadded
     if (ec == EC_Normal && elem != NULL) {
         if (elem->getLength() == 0) {
             s[0] = '\0';
-        } else if ((int)elem->getLength() > maxlen) {
+        } else if (elem->getLength() > (Uint32)maxlen) {
             return parseErrorWithMsg("dimcmd:getString: string too small", t);
         } else {
             ec =  elem->getString(aString);
@@ -655,12 +656,12 @@ buildCStoreRSP(T_DIMSE_C_StoreRSP * e, DcmDataset * obj)
     if (e->opts & O_STORE_AFFECTEDSOPINSTANCEUID)
     {
         char instanceuid[DIC_UI_LEN + 10];
-        strcpy(instanceuid, e->AffectedSOPInstanceUID);
+        OFStandard::strlcpy(instanceuid, e->AffectedSOPInstanceUID, DIC_UI_LEN + 10);
         if ((e->opts & O_STORE_PEER_REQUIRES_EXACT_UID_COPY) &&
             (e->opts & O_STORE_RSP_BLANK_PADDING))
         {
             // restore illegal space padding.
-            strcat(instanceuid, " ");
+            OFStandard::strlcat(instanceuid, " ", DIC_UI_LEN + 10);
         }
         cond = addString(obj, DCM_AffectedSOPInstanceUID, instanceuid, OFTrue); RET(cond);
     }
index 4440bece4a98da3539924a4747cec873656231c6..5fde574eb6ae6803d5687a59e86631c22e71fae8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2010, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were partly developed by
 #include "dcmtk/ofstd/ofstdinc.h"
 
 #include "dcmtk/dcmnet/diutil.h"
-#include "dcmtk/dcmnet/dimse.h"                /* always include the module header */
+#include "dcmtk/dcmnet/dimse.h"     /* always include the module header */
 #include "dcmtk/dcmnet/cond.h"
 
 
 OFCondition
 DIMSE_echoUser(
-       /* in */
-       T_ASC_Association *assoc, DIC_US msgId,
-       /* blocking info for response */
-       T_DIMSE_BlockingMode blockMode, int timeout,
-       /* out */
-       DIC_US *status, DcmDataset **statusDetail)
+    /* in */
+    T_ASC_Association *assoc, DIC_US msgId,
+    /* blocking info for response */
+    T_DIMSE_BlockingMode blockMode, int timeout,
+    /* out */
+    DIC_US *status, DcmDataset **statusDetail)
 {
     T_DIMSE_Message req, rsp;
     T_ASC_PresentationContextID presID;
@@ -122,8 +122,8 @@ DIMSE_echoUser(
 
     req.CommandField = DIMSE_C_ECHO_RQ;
     req.msg.CEchoRQ.MessageID = msgId;
-    strcpy(req.msg.CEchoRQ.AffectedSOPClassUID,
-          sopClass);
+    OFStandard::strlcpy(req.msg.CEchoRQ.AffectedSOPClassUID,
+       sopClass, sizeof(req.msg.CEchoRQ.AffectedSOPClassUID));
     req.msg.CEchoRQ.DataSetType = DIMSE_DATASET_NULL;
 
     OFCondition cond = DIMSE_sendMessageUsingMemoryData(assoc, presID, &req, NULL, NULL, NULL, NULL);
@@ -154,7 +154,7 @@ DIMSE_echoUser(
 
 OFCondition
 DIMSE_sendEchoResponse(T_ASC_Association * assoc,
-       T_ASC_PresentationContextID presID,
+    T_ASC_PresentationContextID presID,
     const T_DIMSE_C_EchoRQ *req, DIC_US status, DcmDataset *statusDetail)
 {
     T_DIMSE_Message rsp;
@@ -163,8 +163,8 @@ DIMSE_sendEchoResponse(T_ASC_Association * assoc,
 
     rsp.CommandField = DIMSE_C_ECHO_RSP;
     rsp.msg.CEchoRSP.MessageIDBeingRespondedTo = req->MessageID;
-    strcpy(rsp.msg.CEchoRSP.AffectedSOPClassUID,
-       req->AffectedSOPClassUID);
+    OFStandard::strlcpy(rsp.msg.CEchoRSP.AffectedSOPClassUID,
+        req->AffectedSOPClassUID, sizeof(rsp.msg.CEchoRSP.AffectedSOPClassUID));
     rsp.msg.CEchoRSP.opts = O_ECHO_AFFECTEDSOPCLASSUID;
     rsp.msg.CEchoRSP.DataSetType = DIMSE_DATASET_NULL;
     rsp.msg.CEchoRSP.DimseStatus = status;
index 179f5bdbe5b1c14e9e56c70da2faa1a2e43f8323..235dd378e656f95eae3ef156cea904c9450528e2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2010, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were partly developed by
@@ -105,6 +105,7 @@ DIMSE_findUser(
         T_ASC_Association *assoc,
         T_ASC_PresentationContextID presID,
         T_DIMSE_C_FindRQ *request, DcmDataset *requestIdentifiers,
+        int &responseCount,
         DIMSE_FindUserCallback callback, void *callbackData,
         T_DIMSE_BlockingMode blockMode, int timeout,
         T_DIMSE_C_FindRSP *response, DcmDataset **statusDetail)
@@ -142,7 +143,6 @@ DIMSE_findUser(
 {
     T_DIMSE_Message req, rsp;
     DIC_US msgId;
-    int responseCount = 0;
     DcmDataset *rspIds = NULL;
     DIC_US status = STATUS_Pending;
 
@@ -301,8 +301,8 @@ DIMSE_sendFindResponse(T_ASC_Association * assoc,
     rsp.CommandField = DIMSE_C_FIND_RSP;
     rsp.msg.CFindRSP = *response;
     rsp.msg.CFindRSP.MessageIDBeingRespondedTo = request->MessageID;
-    strcpy(rsp.msg.CFindRSP.AffectedSOPClassUID,
-            request->AffectedSOPClassUID);
+    OFStandard::strlcpy(rsp.msg.CFindRSP.AffectedSOPClassUID,
+            request->AffectedSOPClassUID, sizeof(rsp.msg.CFindRSP.AffectedSOPClassUID));
     rsp.msg.CFindRSP.opts = O_FIND_AFFECTEDSOPCLASSUID;
 
     /* specify if the response message will contain a search result or if it will not contain one, */
index e1adac36df60ba23c4ce0d97ecb44d3635545cb2..e3c2249504231abbbac41308f708f29908af9d49 100644 (file)
@@ -1,20 +1,26 @@
 /*
-**
-** Author: Andrew Hewett                Created: 1998.09.03
-** 
-** Module: dimget
-**
-** Purpose: 
-**      This file contains the routines which help with
-**      query/retrieve services using the C-GET operation.
-**
-**      Module Prefix: DIMSE_
-**
-*/
-
-/* 
-** Include Files
-*/
+ *
+ *  Copyright (C) 1998-2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were partly developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ * Author: Andrew Hewett
+ *
+ * Module: dimget
+ *
+ * Purpose:
+ *      This file contains the routines which help with
+ *      query/retrieve services using the C-GET operation.
+ *
+ *      Module Prefix: DIMSE_
+ *
+ */
 
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 
 #include "dcmtk/dcmnet/dimse.h"              /* always include the module header */
 #include "dcmtk/dcmnet/cond.h"
 
-/*
-**
-*/
-
 static int
-selectReadable(T_ASC_Association *assoc, 
+selectReadable(T_ASC_Association *assoc,
     T_ASC_Network *net, T_ASC_Association *subAssoc,
     T_DIMSE_BlockingMode blockMode, int timeout)
 {
     T_ASC_Association *assocList[2];
     int assocCount = 0;
-    
+
     if (net != NULL && subAssoc == NULL) {
         if (ASC_associationWaiting(net, 0)) {
             /* association request waiting on network */
             return 2;
         }
-    } 
-    assocList[0] = assoc; 
+    }
+    assocList[0] = assoc;
     assocCount = 1;
     assocList[1] = subAssoc;
     if (subAssoc != NULL) assocCount++;
@@ -80,7 +82,7 @@ selectReadable(T_ASC_Association *assoc,
 OFCondition
 DIMSE_getUser(
         /* in */
-        T_ASC_Association *assoc, 
+        T_ASC_Association *assoc,
         T_ASC_PresentationContextID presID,
         T_DIMSE_C_GetRQ *request,
         DcmDataset *requestIdentifiers,
@@ -104,7 +106,7 @@ DIMSE_getUser(
 
     bzero((char*)&req, sizeof(req));
     bzero((char*)&rsp, sizeof(rsp));
-    
+
     req.CommandField = DIMSE_C_GET_RQ;
     request->DataSetType = DIMSE_DATASET_PRESENT;
     req.msg.CGetRQ = *request;
@@ -112,7 +114,7 @@ DIMSE_getUser(
     msgId = request->MessageID;
 
     OFCondition cond = DIMSE_sendMessageUsingMemoryData(assoc, presID, &req,
-                                          NULL, requestIdentifiers, 
+                                          NULL, requestIdentifiers,
                                           NULL, NULL);
     if (cond != EC_Normal) {
         return cond;
@@ -131,7 +133,7 @@ DIMSE_getUser(
 
     while (cond == EC_Normal && status == STATUS_Pending) {
 
-        /* if user wants, multiplex between net/subAssoc 
+        /* if user wants, multiplex between net/subAssoc
          * and responses over main assoc.
          */
         switch (selectReadable(assoc, net, subAssoc, blockMode, timeout)) {
@@ -157,7 +159,7 @@ DIMSE_getUser(
 
         bzero((char*)&rsp, sizeof(rsp));
 
-        cond = DIMSE_receiveCommand(assoc, blockMode, timeout, &presID, 
+        cond = DIMSE_receiveCommand(assoc, blockMode, timeout, &presID,
                 &rsp, statusDetail);
         if (cond != EC_Normal) {
             return cond;
@@ -168,9 +170,9 @@ DIMSE_getUser(
           sprintf(buf1, "DIMSE: Unexpected Response Command Field: 0x%x", (unsigned)rsp.CommandField);
           return makeDcmnetCondition(DIMSEC_UNEXPECTEDRESPONSE, OF_error, buf1);
         }
-    
+
         *response = rsp.msg.CGetRSP;
-        
+
         if (response->MessageIDBeingRespondedTo != msgId)
         {
           char buf2[256];
@@ -223,9 +225,9 @@ DIMSE_getUser(
 }
 
 OFCondition
-DIMSE_sendGetResponse(T_ASC_Association * assoc, 
+DIMSE_sendGetResponse(T_ASC_Association * assoc,
         T_ASC_PresentationContextID presID, const T_DIMSE_C_GetRQ *request,
-        T_DIMSE_C_GetRSP *response, DcmDataset *rspIds, 
+        T_DIMSE_C_GetRSP *response, DcmDataset *rspIds,
         DcmDataset *statusDetail)
 {
     T_DIMSE_Message rsp;
@@ -237,15 +239,16 @@ DIMSE_sendGetResponse(T_ASC_Association * assoc,
     /* copy over stuff from request */
     rsp.msg.CGetRSP.MessageIDBeingRespondedTo = request->MessageID;
     /* always send afected sop class uid */
-    strcpy(rsp.msg.CGetRSP.AffectedSOPClassUID, request->AffectedSOPClassUID);
+    OFStandard::strlcpy(rsp.msg.CGetRSP.AffectedSOPClassUID, request->AffectedSOPClassUID,
+        sizeof(rsp.msg.CGetRSP.AffectedSOPClassUID));
     rsp.msg.CGetRSP.opts = O_GET_AFFECTEDSOPCLASSUID;
-    
+
     switch (response->DimseStatus) {
     case STATUS_Success:
     case STATUS_Pending:
         /* Success cannot have a Failed SOP Instance UID list (no failures).
          * Pending may not send such a list.
-         */ 
+         */
         rsp.msg.CGetRSP.DataSetType = DIMSE_DATASET_NULL;
         rspIds = NULL;  /* zero our local pointer */
         break;
@@ -256,7 +259,7 @@ DIMSE_sendGetResponse(T_ASC_Association * assoc,
         break;
     }
 
-    /* 
+    /*
      * Make sure the numberOf fields are conformant with
      * the status (see Part 4, C.4.2.1.6-9)
      */
@@ -264,13 +267,13 @@ DIMSE_sendGetResponse(T_ASC_Association * assoc,
         O_GET_NUMBEROFCOMPLETEDSUBOPERATIONS |
         O_GET_NUMBEROFFAILEDSUBOPERATIONS |
         O_GET_NUMBEROFWARNINGSUBOPERATIONS);
-        
+
     switch (response->DimseStatus) {
     case STATUS_Pending:
     case STATUS_GET_Cancel_SubOperationsTerminatedDueToCancelIndication:
         break;
     default:
-        /* Remaining sub-operations may not be in responses 
+        /* Remaining sub-operations may not be in responses
          * with a status of Warning, Failed, Refused or Successful
          */
         opts &= (~ O_GET_NUMBEROFREMAININGSUBOPERATIONS);
@@ -284,14 +287,14 @@ DIMSE_sendGetResponse(T_ASC_Association * assoc,
 
 OFCondition
 DIMSE_getProvider(
-        /* in */ 
-        T_ASC_Association *assoc, 
+        /* in */
+        T_ASC_Association *assoc,
         T_ASC_PresentationContextID presIdCmd,
         T_DIMSE_C_GetRQ *request,
         DIMSE_GetProviderCallback callback, void *callbackData,
         /* blocking info for data set */
         T_DIMSE_BlockingMode blockMode, int timeout)
-{       
+{
     T_ASC_PresentationContextID presIdData;
     DcmDataset *statusDetail = NULL;
     DcmDataset *reqIds = NULL;
@@ -304,7 +307,7 @@ DIMSE_getProvider(
     OFCondition cond = DIMSE_receiveDataSetInMemory(assoc, blockMode, timeout, &presIdData, &reqIds, NULL, NULL);
 
     if (cond.good())
-    {    
+    {
         if (presIdData != presIdCmd)
         {
             cond = makeDcmnetCondition(DIMSEC_INVALIDPRESENTATIONCONTEXTID, OF_error, "DIMSE: Presentation Contexts of Command and Data Differ");
@@ -313,45 +316,45 @@ DIMSE_getProvider(
         {
             bzero((char*)&rsp, sizeof(rsp));
             rsp.DimseStatus = STATUS_Pending;   /* assume */
-            
+
             while (cond == EC_Normal && rsp.DimseStatus == STATUS_Pending && normal)
             {
                 responseCount++;
-            
+
                 cond = DIMSE_checkForCancelRQ(assoc, presIdCmd, request->MessageID);
                 if (cond == EC_Normal)
                 {
                     /* cancel received */
                     rsp.DimseStatus = STATUS_GET_Cancel_SubOperationsTerminatedDueToCancelIndication;
-                    cancelled = OFTrue;     
+                    cancelled = OFTrue;
                 } else if (cond == DIMSE_NODATAAVAILABLE) {
                     /* timeout */
                 } else {
                     /* some execption condition occured, bail out */
                     normal = OFFalse;
                 }
-            
-                if (normal)            
+
+                if (normal)
                 {
                     if (callback) {
-                        callback(callbackData, cancelled, request, reqIds, 
+                        callback(callbackData, cancelled, request, reqIds,
                             responseCount, &rsp, &statusDetail, &rspIds);
                     } else {
                         return makeDcmnetCondition(DIMSEC_NULLKEY, OF_error, "DIMSE_getProvider: no callback function");
                     }
-                    
+
                     if (cancelled) {
                         /* make sure */
-                        rsp.DimseStatus = 
+                        rsp.DimseStatus =
                           STATUS_GET_Cancel_SubOperationsTerminatedDueToCancelIndication;
                         if (rspIds != NULL) {
                             delete reqIds;
                             reqIds = NULL;
                         }
                     }
-                    
+
                     cond = DIMSE_sendGetResponse(assoc, presIdCmd, request, &rsp, rspIds, statusDetail);
-                        
+
                     if (rspIds != NULL) {
                         delete rspIds;
                         rspIds = NULL;
@@ -366,6 +369,6 @@ DIMSE_getProvider(
     }
 
     delete reqIds;
-    delete rspIds;       
+    delete rspIds;
     return cond;
 }
index b5244d6e6a7884be05a8d9e4867e138405902ba4..e04a6a04f4fecea298568af6b45f617b09114ce2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2014, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were partly developed by
@@ -314,7 +314,7 @@ DIMSE_sendMoveResponse(
     /* copy over stuff from request */
     rsp.msg.CMoveRSP.MessageIDBeingRespondedTo = request->MessageID;
     /* always send affected sop class uid */
-    strcpy(rsp.msg.CMoveRSP.AffectedSOPClassUID, request->AffectedSOPClassUID);
+    OFStandard::strlcpy(rsp.msg.CMoveRSP.AffectedSOPClassUID, request->AffectedSOPClassUID, sizeof(rsp.msg.CMoveRSP.AffectedSOPClassUID));
     rsp.msg.CMoveRSP.opts = O_MOVE_AFFECTEDSOPCLASSUID;
 
     switch (response->DimseStatus) {
index cd4204365c517306090a27bb29bf051b6b7c3363..d5a24a65841d4d04adf80dd4597d6c93f061706e 100644 (file)
@@ -322,8 +322,8 @@ DIMSE_sendStoreResponse(T_ASC_Association * assoc,
     bzero((char*)&rsp, sizeof(rsp));
     rsp.CommandField = DIMSE_C_STORE_RSP;
     response->MessageIDBeingRespondedTo = request->MessageID;
-    strcpy(response->AffectedSOPClassUID, request->AffectedSOPClassUID);
-    strcpy(response->AffectedSOPInstanceUID, request->AffectedSOPInstanceUID);
+    OFStandard::strlcpy(response->AffectedSOPClassUID, request->AffectedSOPClassUID, sizeof(response->AffectedSOPClassUID));
+    OFStandard::strlcpy(response->AffectedSOPInstanceUID, request->AffectedSOPInstanceUID, sizeof(response->AffectedSOPInstanceUID));
     response->opts = (O_STORE_AFFECTEDSOPCLASSUID |
         O_STORE_AFFECTEDSOPINSTANCEUID);
     response->DataSetType = DIMSE_DATASET_NULL;
@@ -411,8 +411,8 @@ DIMSE_storeProvider( T_ASC_Association *assoc,
     response.DimseStatus = STATUS_Success;     /* assume */
     response.MessageIDBeingRespondedTo = request->MessageID;
     response.DataSetType = DIMSE_DATASET_NULL; /* always for C-STORE-RSP */
-    strcpy(response.AffectedSOPClassUID, request->AffectedSOPClassUID);
-    strcpy(response.AffectedSOPInstanceUID, request->AffectedSOPInstanceUID);
+    OFStandard::strlcpy(response.AffectedSOPClassUID, request->AffectedSOPClassUID, sizeof(response.AffectedSOPClassUID));
+    OFStandard::strlcpy(response.AffectedSOPInstanceUID, request->AffectedSOPInstanceUID, sizeof(response.AffectedSOPInstanceUID));
     response.opts = (O_STORE_AFFECTEDSOPCLASSUID | O_STORE_AFFECTEDSOPINSTANCEUID);
     if (request->opts & O_STORE_RQ_BLANK_PADDING) response.opts |= O_STORE_RSP_BLANK_PADDING;
     if (dcmPeerRequiresExactUIDCopy.get()) response.opts |= O_STORE_PEER_REQUIRES_EXACT_UID_COPY;
index fbcb0265462b7e63b983de99deb08b7f607b9f77..cd8152dd6bdc1c51c4392a3679b391239e34c80c 100644 (file)
@@ -163,7 +163,7 @@ DU_stripLeadingAndTrailingSpaces(char *s)
 #undef TO_UCHAR
 
 OFBool
-DU_getStringDOElement(DcmItem *obj, DcmTagKey t, char *s)
+DU_getStringDOElement(DcmItem *obj, DcmTagKey t, char *s, size_t bufsize)
 {
     DcmByteString *elem;
     DcmStack stack;
@@ -177,7 +177,7 @@ DU_getStringDOElement(DcmItem *obj, DcmTagKey t, char *s)
             s[0] = '\0';
         } else {
             ec =  elem->getString(aString);
-            strcpy(s, aString);
+            OFStandard::strlcpy(s, aString, bufsize);
         }
     }
     return (ec == EC_Normal);
@@ -238,11 +238,13 @@ OFBool
 DU_findSOPClassAndInstanceInDataSet(
   DcmItem *obj,
   char* sopClass,
+  size_t sopClassSize,
   char* sopInstance,
+  size_t sopInstanceSize,
   OFBool tolerateSpacePaddedUIDs)
 {
-    OFBool result = (DU_getStringDOElement(obj, DCM_SOPClassUID, sopClass) &&
-        DU_getStringDOElement(obj, DCM_SOPInstanceUID, sopInstance));
+    OFBool result = (DU_getStringDOElement(obj, DCM_SOPClassUID, sopClass, sopClassSize) &&
+        DU_getStringDOElement(obj, DCM_SOPInstanceUID, sopInstance, sopInstanceSize));
 
     if (tolerateSpacePaddedUIDs)
     {
@@ -261,7 +263,9 @@ OFBool
 DU_findSOPClassAndInstanceInFile(
   const char *fname,
   char* sopClass,
+  size_t sopClassSize,
   char* sopInstance,
+  size_t sopInstanceSize,
   OFBool tolerateSpacePaddedUIDs)
 {
     DcmFileFormat ff;
@@ -270,11 +274,11 @@ DU_findSOPClassAndInstanceInFile(
 
     /* look in the meta-header first */
     OFBool found = DU_findSOPClassAndInstanceInDataSet(
-        ff.getMetaInfo(), sopClass, sopInstance, tolerateSpacePaddedUIDs);
+        ff.getMetaInfo(), sopClass, sopClassSize, sopInstance, sopInstanceSize, tolerateSpacePaddedUIDs);
 
     if (!found) {
         found = DU_findSOPClassAndInstanceInDataSet(
-            ff.getDataset(), sopClass, sopInstance, tolerateSpacePaddedUIDs);
+            ff.getDataset(), sopClass, sopClassSize, sopInstance, sopInstanceSize, tolerateSpacePaddedUIDs);
     }
 
     return found;
index a939d67e4d7665a69c17b140765664a8ce71e0dc..51d034e72103335874b1b81d547198678e8f8ba4 100644 (file)
@@ -74,6 +74,7 @@
 
 #ifdef HAVE_WINDOWS_H
 #include <winsock2.h>  /* for SO_EXCLUSIVEADDRUSE */
+#include <ws2tcpip.h>  /* for socklen_t */
 #endif
 
 #include "dcmtk/dcmnet/diutil.h"
@@ -141,6 +142,7 @@ END_EXTERN_C
 #include "dcmtk/dcmnet/cond.h"
 #include "dcmtk/dcmnet/lst.h"
 #include "dcmtk/ofstd/ofconsol.h"
+#include "dcmtk/ofstd/ofstd.h"
 
 #include "dcmtk/dcmnet/dul.h"
 #include "dulstruc.h"
@@ -155,6 +157,7 @@ OFGlobal<Sint32> dcmConnectionTimeout(-1);
 OFGlobal<DcmNativeSocketType> dcmExternalSocketHandle(DCMNET_INVALID_SOCKET);
 OFGlobal<const char *> dcmTCPWrapperDaemonName((const char *)NULL);
 OFGlobal<unsigned long> dcmEnableBackwardCompatibility(0);
+OFGlobal<size_t> dcmAssociatePDUSizeLimit(0x100000);
 
 static int networkInitialized = 0;
 
@@ -525,6 +528,9 @@ DUL_RequestAssociation(
     if (cond.bad())
         return cond;
 
+    if (block == DUL_NOBLOCK)
+        DCMNET_TRACE("setting association request timeout to " << timeout << " seconds");
+
     if (activatePDUStorage) DUL_activateAssociatePDUStorage(*association);
 
     /* send a request primitive */
@@ -547,8 +553,17 @@ DUL_RequestAssociation(
         destroyAssociationKey(association);
         return cond;
     }
+
+    /* if no timeout is passed, use the default one (do not wait forever) */
+    if ((block == DUL_BLOCK) && ((*association)->timeout > 0))
+    {
+        block = DUL_NOBLOCK;
+        timeout = (*association)->timeout;
+        DCMNET_TRACE("setting timeout for first PDU to be read to " << timeout << " seconds");
+    }
     /* Find the next event */
     cond = PRV_NextPDUType(association, block, timeout, &pduType);
+
     if (cond == DUL_NETWORKCLOSED)
         event = TRANS_CONN_CLOSED;
     else if (cond == DUL_READTIMEOUT)
@@ -657,6 +672,9 @@ DUL_ReceiveAssociationRQ(
     if (cond.bad())
         return cond;
 
+    if (block == DUL_NOBLOCK)
+        DCMNET_TRACE("setting association receive timeout to " << timeout << " seconds");
+
     if (activatePDUStorage) DUL_activateAssociatePDUStorage(*association);
     clearRequestorsParams(params);
 
@@ -677,7 +695,8 @@ DUL_ReceiveAssociationRQ(
     /* This is the first time we read from this new connection, so in case it
      * doesn't speak DICOM, we shouldn't wait forever (= DUL_NOBLOCK).
      */
-    cond = PRV_NextPDUType(association, DUL_NOBLOCK, PRV_DEFAULTTIMEOUT, &pduType);
+    DCMNET_TRACE("setting timeout for first PDU to be read to " << (*association)->timeout << " seconds");
+    cond = PRV_NextPDUType(association, DUL_NOBLOCK, (*association)->timeout, &pduType);
 
     if (cond == DUL_NETWORKCLOSED)
         event = TRANS_CONN_CLOSED;
@@ -2077,7 +2096,7 @@ createNetworkKey(const char *mode,
     }
     *key = (PRIVATE_NETWORKKEY *) malloc(sizeof(PRIVATE_NETWORKKEY));
     if (*key == NULL) return EC_MemoryExhausted;
-    (void) strcpy((*key)->keyType, KEY_NETWORK);
+    OFStandard::strlcpy((*key)->keyType, KEY_NETWORK, sizeof((*key)->keyType));
 
     (*key)->applicationFunction = 0;
 
@@ -2228,7 +2247,7 @@ initializeNetworkTCP(PRIVATE_NETWORKKEY ** key, void *parameter)
       }
     }
 
-    (*key)->networkSpecific.TCP.tLayer = new DcmTransportLayer((*key)->applicationFunction);
+    (*key)->networkSpecific.TCP.tLayer = new DcmTransportLayer();
     (*key)->networkSpecific.TCP.tLayerOwned = 1;
     if (NULL == (*key)->networkSpecific.TCP.tLayer)
     {
@@ -2272,10 +2291,10 @@ createAssociationKey(PRIVATE_NETWORKKEY ** networkKey,
     if (key == NULL) return EC_MemoryExhausted;
     key->receivePDUQueue = NULL;
 
-    (void) strcpy(key->keyType, KEY_ASSOCIATION);
+    OFStandard::strlcpy(key->keyType, KEY_ASSOCIATION, sizeof(key->keyType));
     key->applicationFunction = (*networkKey)->applicationFunction;
 
-    (void) strcpy(key->remoteNode, remoteNode);
+    OFStandard::strlcpy(key->remoteNode, remoteNode, sizeof(key->remoteNode));
     key->presentationContextID = 0;
     key->timeout = (*networkKey)->timeout;
     key->timerStart = 0;
@@ -2369,11 +2388,11 @@ get_association_parameter(void *paramAddress,
     if ((paramType == DUL_K_STRING) && (outputLength < strlen((char*)paramAddress))) return DUL_INSUFFICIENTBUFFERLENGTH;
 
     switch (paramType) {
-    case DUL_K_INTEGER:
+      case DUL_K_INTEGER:
         (void) memcpy(outputAddress, paramAddress, paramLength);
         break;
-    case DUL_K_STRING:
-        strcpy((char*)outputAddress, (char*)paramAddress);
+      case DUL_K_STRING:
+        OFStandard::strlcpy((char*)outputAddress, (char*)paramAddress, outputLength);
         break;
     }
     return EC_Normal;
index da7757db9456f97a062f38f73cd01b935ed13baf..c0643c2bc9efb27dd6498e8aed95bbc313dbbeb4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were partly developed by
@@ -177,12 +177,12 @@ constructAssociatePDU(DUL_ASSOCIATESERVICEPARAMETERS * params,
 
     if (strlen(params->calledAPTitle) < 1 || strlen(params->calledAPTitle) > 16)
         return makeDcmnetCondition(DULC_ILLEGALSERVICEPARAMETER, OF_error, "Illegal service parameter: Called AP Title");
-    (void) strcpy(pdu->calledAPTitle, params->calledAPTitle);
+    OFStandard::strlcpy(pdu->calledAPTitle, params->calledAPTitle, sizeof(pdu->calledAPTitle));
     pdu->length += 16;
 
     if (strlen(params->callingAPTitle) < 1 || strlen(params->callingAPTitle) > 16)
         return makeDcmnetCondition(DULC_ILLEGALSERVICEPARAMETER, OF_error, "Illegal service parameter: Calling AP Title");
-    (void) strcpy(pdu->callingAPTitle, params->callingAPTitle);
+    OFStandard::strlcpy(pdu->callingAPTitle, params->callingAPTitle, sizeof(pdu->callingAPTitle));
     pdu->length += 16;
 
     (void) memset(pdu->rsv3, 0, 32);
@@ -482,11 +482,16 @@ streamAssociatePDU(PRV_ASSOCIATEPDU * assoc, unsigned char *b,
     *b++ = assoc->rsv2[0];
     *b++ = assoc->rsv2[1];
     (void) memset(b, ' ', 32);
-    (void) strncpy((char *) b, assoc->calledAPTitle,
-            strlen(assoc->calledAPTitle));
+
+    // we don't copy the zero bytes at the end of the AEtitle strings
+    // since the PDU requires a space-padded, non zero-padded string.
+    size_t len = strlen(assoc->calledAPTitle);
+    if (len > 16) len = 16;
+    memcpy(b, assoc->calledAPTitle, len);
     b += 16;
-    (void) strncpy((char *) b, assoc->callingAPTitle,
-            strlen(assoc->callingAPTitle));
+    len = strlen(assoc->callingAPTitle);
+    if (len > 16) len = 16;
+    memcpy(b, assoc->callingAPTitle, len);
     b += 16;
     (void) memset(b, 0, 32);
     b += 32;
@@ -670,7 +675,7 @@ constructSubItem(char *name, unsigned char type,
     subItem->type = type;
     subItem->rsv1 = 0;
     subItem->length = (unsigned short) strlen(name);
-    (void) strcpy(subItem->data, name);
+    OFStandard::strlcpy(subItem->data, name, sizeof(subItem->data));
 
     *rtnLength = subItem->length + 4;
     return EC_Normal;
@@ -1145,7 +1150,7 @@ constructSCUSCPSubItem(char *name, unsigned char type, unsigned char scuRole,
     scuscpItem->SCURole = scuRole;
     scuscpItem->SCPRole = scpRole;
     scuscpItem->length = (unsigned short) (strlen(name) + 2 + 2);
-    (void) strcpy(scuscpItem->SOPClassUID, name);
+    OFStandard::strlcpy(scuscpItem->SOPClassUID, name, sizeof(scuscpItem->SOPClassUID));
 
     *length = scuscpItem->length + 4;
     return EC_Normal;
index 24d84f65cdc72d990ab05a0ef335c5008df46f75..e3facda6482a504945ab760f8b6bc49a4f9f9ae4 100644 (file)
@@ -67,6 +67,8 @@
 #ifdef HAVE_WINDOWS_H
 // on Windows, we need Winsock2 for network functions
 #include <winsock2.h>
+// and ws2tcpip for socklen_t
+#include <ws2tcpip.h>
 #endif
 
 #define INCLUDE_CSTDLIB
@@ -634,7 +636,7 @@ static FSM_ENTRY StateTable[DUL_NUMBER_OF_EVENTS][DUL_NUMBER_OF_STATES] = {
         // DICOM part 8 does not define an action and state for the
         // situation where a timeout occurs while we are waiting for an
         // incoming A-ASSOCIATE-AC or A-ASSOCIATE-RJ. We close the transport
-        // connection, return an error code indicating a timout,
+        // connection, return an error code indicating a timeout,
         // and reset the FSM to idle state (STATE1).
         {ARTIM_TIMER_EXPIRED, STATE5, AA_2T, STATE1, "", "", NULL},
 
@@ -643,7 +645,7 @@ static FSM_ENTRY StateTable[DUL_NUMBER_OF_EVENTS][DUL_NUMBER_OF_STATES] = {
         // DICOM part 8 does not define an action and state for the
         // situation where a timeout occurs while we are waiting for an
         // incoming A-RELEASE-RSP. We close the transport
-        // connection, return an error code indicating a timout,
+        // connection, return an error code indicating a timeout,
         // and reset the FSM to idle state (STATE1).
         {ARTIM_TIMER_EXPIRED, STATE7, AA_2T, STATE1, "", "", NULL},
 
@@ -940,10 +942,9 @@ AE_3_AssociateConfirmationAccept(PRIVATE_NETWORKKEY ** /*network*/,
         free(buffer);
         if (cond.bad()) return makeDcmnetSubCondition(DULC_ILLEGALPDU, OF_error, "DUL Illegal or ill-formed PDU", cond);
 
-        (void) strcpy(service->respondingAPTitle, assoc.calledAPTitle);
-        (void) strcpy(service->callingAPTitle, assoc.callingAPTitle);
-        (void) strcpy(service->applicationContextName,
-                      assoc.applicationContext.data);
+        OFStandard::strlcpy(service->respondingAPTitle, assoc.calledAPTitle, sizeof(service->respondingAPTitle));
+        OFStandard::strlcpy(service->callingAPTitle, assoc.callingAPTitle, sizeof(service->callingAPTitle));
+        OFStandard::strlcpy(service->applicationContextName, assoc.applicationContext.data, sizeof(service->applicationContextName));
 
         if ((service->acceptedPresentationContext = LST_Create()) == NULL) return EC_MemoryExhausted;
 
@@ -961,8 +962,9 @@ AE_3_AssociateConfirmationAccept(PRIVATE_NETWORKKEY ** /*network*/,
             requestedPresentationCtx = findPresentationCtx(
                  &service->requestedPresentationContext, prvCtx->contextID);
             if (requestedPresentationCtx != NULL) {
-                strcpy(userPresentationCtx->abstractSyntax,
-                       requestedPresentationCtx->abstractSyntax);
+                OFStandard::strlcpy(userPresentationCtx->abstractSyntax,
+                    requestedPresentationCtx->abstractSyntax,
+                    sizeof(userPresentationCtx->abstractSyntax));
                 userPresentationCtx->proposedSCRole =
                     requestedPresentationCtx->proposedSCRole;
             }
@@ -996,8 +998,8 @@ AE_3_AssociateConfirmationAccept(PRIVATE_NETWORKKEY ** /*network*/,
             }
             subItem = (DUL_SUBITEM*)LST_Head(&prvCtx->transferSyntaxList);
             if (subItem != NULL)
-                (void) strcpy(userPresentationCtx->acceptedTransferSyntax,
-                              subItem->data);
+                OFStandard::strlcpy(userPresentationCtx->acceptedTransferSyntax,
+                              subItem->data, sizeof(userPresentationCtx->acceptedTransferSyntax));
             LST_Enqueue(&service->acceptedPresentationContext, (LST_NODE*)userPresentationCtx);
 
             prvCtx = (PRV_PRESENTATIONCONTEXTITEM*)LST_Next(&assoc.presentationContextList);
@@ -1118,7 +1120,8 @@ AE_5_TransportConnectResponse(PRIVATE_NETWORKKEY ** /*network*/,
 {
     clearPDUCache(association);
     (*association)->protocolState = nextState;
-/*  Start the timer */
+
+    /* Start the timer (?) */
 
     return EC_Normal;
 }
@@ -1199,15 +1202,14 @@ AE_6_ExamineAssociateRequest(PRIVATE_NETWORKKEY ** /*network*/,
                 (*association)->protocolState = STATE3;
             return cond;
         }
-        (void) strcpy(service->calledAPTitle, assoc.calledAPTitle);
-        (void) strcpy(service->callingAPTitle, assoc.callingAPTitle);
-        (void) strcpy(service->applicationContextName,
-                      assoc.applicationContext.data);
+        OFStandard::strlcpy(service->calledAPTitle, assoc.calledAPTitle, sizeof(service->calledAPTitle));
+        OFStandard::strlcpy(service->callingAPTitle, assoc.callingAPTitle, sizeof(service->callingAPTitle));
+        OFStandard::strlcpy(service->applicationContextName, assoc.applicationContext.data, sizeof(service->applicationContextName));
 
         if ((service->requestedPresentationContext = LST_Create()) == NULL) return EC_MemoryExhausted;
         if (translatePresentationContextList(&assoc.presentationContextList,
                                              &assoc.userInfo.SCUSCPRoleList,
-                      &service->requestedPresentationContext).bad())
+                                             &service->requestedPresentationContext).bad())
         {
             return DUL_PCTRANSLATIONFAILURE;
         }
@@ -1314,6 +1316,9 @@ AE_8_SendAssociateRJ(PRIVATE_NETWORKKEY ** network,
     abortItems = (DUL_ABORTITEMS *) params;
     cond = sendAssociationRJTCP(network, abortItems, association);
     (*association)->protocolState = nextState;
+
+    /* Start the timer (?) */
+
     return cond;
 }
 
@@ -1419,6 +1424,16 @@ DT_2_IndicatePData(PRIVATE_NETWORKKEY ** /*network*/,
         p += 4 + pdvLength;                 //move p so that it points to the next PDV (move p 4 bytes over the length field plus the amount of bytes which is captured in the PDV's length field (over presentation context.Id, message information header and data fragment))
         length -= 4 + pdvLength;            //update length (i.e. determine the length of the buffer which has not been evaluated yet.)
         pdvCount++;                         //increase counter by one, since we've found another PDV
+
+        // There must be at least a presentation context ID and a message
+        // control header (see below), else the calculation pdvLength - 2 below
+        // will underflow.
+        if (pdvLength < 2)
+        {
+           char buf[256];
+           sprintf(buf, "PDV with invalid length %lu encountered. This probably indicates a malformed P DATA PDU.", pdvLength);
+           return makeDcmnetCondition(DULC_ILLEGALPDULENGTH, OF_error, buf);
+        }
     }
 
     /* if after having counted the PDVs the length variable does not equal */
@@ -2315,9 +2330,9 @@ requestAssociationTCP(PRIVATE_NETWORKKEY ** network,
 
         do {
 #ifdef DCMTK_HAVE_POLL
-            struct pollfd pfd[] = 
+            struct pollfd pfd[] =
             {
-                { s, POLLIN, 0 }
+                { s, POLLOUT, 0 }
             };
             rc = poll(pfd, 1, timeout.tv_sec*1000+(timeout.tv_usec/1000));
 #else
@@ -2724,8 +2739,7 @@ sendAssociationRJTCP(PRIVATE_NETWORKKEY ** /*network*/,
 
 
     OFCondition cond = constructAssociateRejectPDU((unsigned char) abortItems->result,
-     (unsigned char) abortItems->source, (unsigned char) abortItems->reason,
-                                       &pdu);
+        (unsigned char) abortItems->source, (unsigned char) abortItems->reason, &pdu);
     if (pdu.length + 6 <= sizeof(buffer))
         b = buffer;
     else {
@@ -3264,6 +3278,9 @@ PRV_NextPDUType(PRIVATE_ASSOCIATIONKEY ** association, DUL_BLOCKOPTIONS block,
 **    If malloc fails, EC_MemoryExhausted is returned.
 **    Otherwise, the buffer must be released (free) by the caller!
 **
+**    This function is only used to receive incoming A-ASSOCIATE-RQ
+**    and A-ASSOCIATE-AC PDUs.
+**
 ** Algorithm:
 **      Description of the algorithm (optional) and any other notes.
 */
@@ -3289,6 +3306,13 @@ readPDU(PRIVATE_ASSOCIATIONKEY ** association, DUL_BLOCKOPTIONS block,
         (*association)->inputPDU = PDU_HEAD;
     }
 
+    size_t limit = dcmAssociatePDUSizeLimit.get();
+    if ((limit > 0) && ((*association)->nextPDULength > limit))
+    {
+      DCMNET_ERROR("A-ASSOCIATE PDU too large: " << (*association)->nextPDULength << " bytes, refusing." );
+      return NET_EC_AssociatePDUTooLarge;
+    }
+
     maxLength = ((*association)->nextPDULength)+100;
     *buffer = (unsigned char *)malloc(size_t(maxLength));
     if (*buffer)
@@ -3537,7 +3561,7 @@ readPDUHeadTCP(PRIVATE_ASSOCIATIONKEY ** association,
 **      block           For blocking/non-blocking read
 **      timeout         Timeout interval for reading
 **      buffer          Buffer to hold the PDU
-**      maxLength       MAximum number of bytes to read
+**      maxLength       Maximum number of bytes to read
 **      pduType         PDU Type of the incoming PDU (returned to caller)
 **      pduReserved     Reserved field in the PDU
 **      pduLength       Actual number of bytes read
@@ -3654,7 +3678,7 @@ defragmentTCP(DcmTransportConnection *connection, DUL_BLOCKOPTIONS block, time_t
     {
         /* figure out how long we want to wait: if timerStart equals 0 we want to wait exactly */
         /* timeout seconds starting from the call to select(...) within the below called function; */
-        /* if timerStart does not equal 0 we want to substract the time which has already passed */
+        /* if timerStart does not equal 0 we want to subtract the time which has already passed */
         /* after the timer was started from timeout and wait the resulting amount of seconds */
         /* starting from the call to select(...) within the below called function. */
         if (timerStart == 0) timerStart = time(NULL);
@@ -3850,7 +3874,7 @@ translatePresentationContextList(LST_HEAD ** internalList,
 
         userContext->acceptedTransferSyntax[0] = '\0';
         userContext->presentationContextID = context->contextID;
-        strcpy(userContext->abstractSyntax, context->abstractSyntax.data);
+        OFStandard::strlcpy(userContext->abstractSyntax, context->abstractSyntax.data, sizeof(userContext->abstractSyntax));
         userContext->proposedSCRole = DUL_SC_ROLE_DEFAULT;
         userContext->acceptedSCRole = DUL_SC_ROLE_DEFAULT;
 
@@ -3879,7 +3903,7 @@ translatePresentationContextList(LST_HEAD ** internalList,
         while (subItem != NULL) {
             transfer = (DUL_TRANSFERSYNTAX*)malloc(sizeof(DUL_TRANSFERSYNTAX));
             if (transfer == NULL) return EC_MemoryExhausted;
-            strcpy(transfer->transferSyntax, subItem->data);
+            OFStandard::strlcpy(transfer->transferSyntax, subItem->data, sizeof(transfer->transferSyntax));
 
             LST_Enqueue(&userContext->proposedTransferSyntax, (LST_NODE*)transfer);
             subItem = (DUL_SUBITEM*)LST_Next(&context->transferSyntaxList);
index 8b6cb8326ee4583c7bbd7915c7ed6c2e05c60844..73185ad4fdf48737c67d89a26d8d84c685c2df4c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2017, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were partly developed by
@@ -223,7 +223,8 @@ parseAssociate(unsigned char *buf, unsigned long pduLength,
             if (cond.good())
             {
                 buf += itemLength;
-                pduLength -= itemLength;
+                if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
+                  return makeUnderflowError("Application Context item", pduLength, itemLength);
                 DCMNET_TRACE("Successfully parsed Application Context");
             }
             break;
@@ -235,7 +236,8 @@ parseAssociate(unsigned char *buf, unsigned long pduLength,
             cond = parsePresentationContext(type, context, buf, &itemLength, pduLength);
             if (cond.bad()) return cond;
             buf += itemLength;
-            pduLength -= itemLength;
+            if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
+              return makeUnderflowError("Presentation Context item", pduLength, itemLength);
             LST_Enqueue(&assoc->presentationContextList, (LST_NODE*)context);
             DCMNET_TRACE("Successfully parsed Presentation Context");
             break;
@@ -246,11 +248,14 @@ parseAssociate(unsigned char *buf, unsigned long pduLength,
             if (cond.bad())
                 return cond;
             buf += itemLength;
-            pduLength -= itemLength;
+            if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
+              return makeUnderflowError("User Information item", pduLength, itemLength);
             DCMNET_TRACE("Successfully parsed User Information");
             break;
         default:
             cond = parseDummy(buf, &itemLength, pduLength);
+            if (cond.bad())
+                return cond;
             buf += itemLength;
             if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
               return makeUnderflowError("unknown item type", pduLength, itemLength);
@@ -396,7 +401,8 @@ parsePresentationContext(unsigned char type,
                     return cond;
 
                 buf += length;
-                presentationLength -= length;
+                if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
+                  return makeUnderflowError("Abstract Syntax", presentationLength, length);
                 DCMNET_TRACE("Successfully parsed Abstract Syntax");
                 break;
             case DUL_TYPETRANSFERSYNTAX:
@@ -406,11 +412,14 @@ parsePresentationContext(unsigned char type,
                 if (cond.bad()) return cond;
                 LST_Enqueue(&context->transferSyntaxList, (LST_NODE*)subItem);
                 buf += length;
-                presentationLength -= length;
+                if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
+                  return makeUnderflowError("Transfer Syntax", presentationLength, length);
                 DCMNET_TRACE("Successfully parsed Transfer Syntax");
                 break;
             default:
                 cond = parseDummy(buf, &length, presentationLength);
+                if (cond.bad())
+                    return cond;
                 buf += length;
                 if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
                   return makeUnderflowError("unknown presentation context type", presentationLength, length);
@@ -495,7 +504,8 @@ parseUserInfo(DUL_USERINFO * userInfo,
             if (cond.bad())
                 return cond;
             buf += length;
-            userLength -= (unsigned short) length;
+            if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
+              return makeLengthError("maximum length sub-item", userLength, length);
             DCMNET_TRACE("Successfully parsed Maximum PDU Length");
             break;
         case DUL_TYPEIMPLEMENTATIONCLASSUID:
@@ -504,11 +514,14 @@ parseUserInfo(DUL_USERINFO * userInfo,
             if (cond.bad())
                 return cond;
             buf += length;
-            userLength -= (unsigned short) length;
+            if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
+              return makeLengthError("Implementation Class UID sub-item", userLength, length);
             break;
 
         case DUL_TYPEASYNCOPERATIONS:
             cond = parseDummy(buf, &length, userLength);
+            if (cond.bad())
+                return cond;
             buf += length;
             if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
               return makeLengthError("asynchronous operation user item type", userLength, length);
@@ -520,14 +533,16 @@ parseUserInfo(DUL_USERINFO * userInfo,
             if (cond.bad()) return cond;
             LST_Enqueue(&userInfo->SCUSCPRoleList, (LST_NODE*)role);
             buf += length;
-            userLength -= (unsigned short) length;
+            if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
+              return makeLengthError("SCP/SCU Role Selection sub-item", userLength, length);
             break;
         case DUL_TYPEIMPLEMENTATIONVERSIONNAME:
             cond = parseSubItem(&userInfo->implementationVersionName,
                                 buf, &length, userLength);
             if (cond.bad()) return cond;
             buf += length;
-            userLength -= (unsigned short) length;
+            if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
+              return makeLengthError("Implementation Version Name structure", userLength, length);
             break;
 
         case DUL_TYPESOPCLASSEXTENDEDNEGOTIATION:
@@ -543,7 +558,8 @@ parseUserInfo(DUL_USERINFO * userInfo,
             }
             userInfo->extNegList->push_back(extNeg);
             buf += length;
-            userLength -= (unsigned short) length;
+            if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
+              return makeLengthError("SOP Class Extended Negotiation sub-item", userLength, length);
             break;
 
         case DUL_TYPENEGOTIATIONOFUSERIDENTITY_REQ:
@@ -561,16 +577,20 @@ parseUserInfo(DUL_USERINFO * userInfo,
           }
           userInfo->usrIdent = usrIdent;
           buf += length;
-          userLength -= (unsigned short) length;
+          if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
+            return makeLengthError("User Identity sub-item", userLength, length);
           break;
         default:
             // we hit an unknown user item that is not defined in the standard
             // or still unknown to DCMTK
             cond = parseDummy(buf, &length /* returns bytes "handled" by parseDummy */, userLength /* data available in bytes for user item */);
+            if (cond.bad())
+              return cond;
             // skip the bytes read
             buf += length;
             // subtract bytes of parsed data from available data bytes
-            if (!OFStandard::safeSubtract(userLength, OFstatic_cast(unsigned short, length), userLength))
+            if (OFstatic_cast(unsigned short, length) != length
+                || !OFStandard::safeSubtract(userLength, OFstatic_cast(unsigned short, length), userLength))
               return makeUnderflowError("unknown user item", userLength, length);
             break;
         }
index c08da30ac3d5f275e60c7e4cc6ad04f8f6d07b39..f586942e50985e390717465a827acfdd4a3ebfe0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1994-2011, OFFIS e.V.
+ *  Copyright (C) 1994-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were partly developed by
 /* DUL_MakePresentationCtx
 **
 ** Purpose:
-**     Build a Presentation Context from the specified parameters
+**  Build a Presentation Context from the specified parameters
 **
 ** Parameter Dictionary:
-**     ctx             Pointer to the presentation context that is to
-**                     be built.
-**     proposedSCRole  Proposed role played by the caller
-**     acceptedSCRole  Accepted role (after negotiation)
-**     ctxID           Unique ID for this presentation context
-**     result
-**     abstarctSyntax
+**  ctx     Pointer to the presentation context that is to
+**          be built.
+**  proposedSCRole  Proposed role played by the caller
+**  acceptedSCRole  Accepted role (after negotiation)
+**  ctxID       Unique ID for this presentation context
+**  result
+**  abstarctSyntax
 **
 ** Return Values:
-**     DUL_LISTERROR
+**  DUL_LISTERROR
 **
 **
 ** Notes:
-**     The transfer syntax argument allows the caller to specify one
-**     or more transfer syntaxes.  The function expects the caller to
-**     terminate the set of transfer syntaxes with a NULL pointer.
+**  The transfer syntax argument allows the caller to specify one
+**  or more transfer syntaxes.  The function expects the caller to
+**  terminate the set of transfer syntaxes with a NULL pointer.
 **
-**     Transfer syntaxes of 0 length are not considered an error and/but
-**     are ignored.
+**  Transfer syntaxes of 0 length are not considered an error and/but
+**  are ignored.
 **
 ** Algorithm:
-**     Description of the algorithm (optional) and any other notes.
+**  Description of the algorithm (optional) and any other notes.
 */
 
 OFCondition
 DUL_MakePresentationCtx(DUL_PRESENTATIONCONTEXT ** ctx,
-                    DUL_SC_ROLE proposedSCRole, DUL_SC_ROLE acceptedSCRole,
-                     DUL_PRESENTATIONCONTEXTID ctxID, unsigned char result,
-                       const char *abstractSyntax, const char *transferSyntax,...)
+             DUL_SC_ROLE proposedSCRole, DUL_SC_ROLE acceptedSCRole,
+              DUL_PRESENTATIONCONTEXTID ctxID, unsigned char result,
+            const char *abstractSyntax, const char *transferSyntax,...)
 {
     va_list
-       args;
+    args;
     LST_HEAD
-       * lst;
+    * lst;
     DUL_TRANSFERSYNTAX
-       * transfer;
+    * transfer;
 
     *ctx = (DUL_PRESENTATIONCONTEXT *) malloc(sizeof(**ctx));
     if (*ctx == NULL) return EC_MemoryExhausted;
@@ -132,19 +132,19 @@ DUL_MakePresentationCtx(DUL_PRESENTATIONCONTEXT ** ctx,
     (*ctx)->result = result;
     (*ctx)->proposedSCRole = proposedSCRole;
     (*ctx)->acceptedSCRole = acceptedSCRole;
-    strcpy((*ctx)->abstractSyntax, abstractSyntax);
+    OFStandard::strlcpy((*ctx)->abstractSyntax, abstractSyntax, sizeof((*ctx)->abstractSyntax));
 
     va_start(args, transferSyntax);
-    strcpy((*ctx)->acceptedTransferSyntax, transferSyntax);
+    OFStandard::strlcpy((*ctx)->acceptedTransferSyntax, transferSyntax, sizeof((*ctx)->acceptedTransferSyntax));
     while ((transferSyntax = va_arg(args, char *)) != NULL)
     {
-       if (strlen(transferSyntax) != 0)
-       {
-           transfer = (DUL_TRANSFERSYNTAX*)malloc(sizeof(DUL_TRANSFERSYNTAX));
-           if (transfer == NULL) return EC_MemoryExhausted;
-           strcpy(transfer->transferSyntax, transferSyntax);
-           LST_Enqueue(&lst, (LST_NODE*)transfer);
-       }
+    if (strlen(transferSyntax) != 0)
+    {
+        transfer = (DUL_TRANSFERSYNTAX*)malloc(sizeof(DUL_TRANSFERSYNTAX));
+        if (transfer == NULL) return EC_MemoryExhausted;
+        OFStandard::strlcpy(transfer->transferSyntax, transferSyntax, sizeof(transfer->transferSyntax));
+        LST_Enqueue(&lst, (LST_NODE*)transfer);
+    }
     }
     va_end(args);
     (*ctx)->proposedTransferSyntax = lst;
index 07e08386cd7a8af37cf887ff345c15788fb872e8..b476f7d6d601656a131ecf8645c56e12acdf0abc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2012-2017, OFFIS e.V.
+ *  Copyright (C) 2012-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -20,7 +20,6 @@
  */
 
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
-
 #ifdef WITH_TCPWRAPPER
 
 #ifdef HAVE_NETINET_IN_H
 #endif
 
 #include <tcpd.h>               /* for hosts_ctl */
-#include <syslog.h>
-
-/* libwrap expects that two global flags, deny_severity and allow_severity,
- * are defined and initialized by user code. If these flags are already present
- * somewhere else, compile DCMTK with TCPWRAPPER_SEVERITY_EXTERN defined
- * to avoid linker errors due to duplicate symbols.
- */
-#ifndef TCPWRAPPER_SEVERITY_EXTERN
-int deny_severity = LOG_WARNING;
-int allow_severity = LOG_INFO;
-#endif
-
-int dcmtk_hosts_access(struct request_info *req);
 
 /* Some versions of libwrap omit the full prototype from tcpd.h.
  * Instead something like this is used:
index 4bf9ddcfeef9a91c1852f0c0327f0f8f1db79580..e250de74e4a6b98c0832bacb41a0d390a4b174b9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2009-2017, OFFIS e.V.
+ *  Copyright (C) 2009-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -395,7 +395,7 @@ OFCondition DcmSCP::processAssociationRQ()
   // Condition 2: determine the application context name. If an error occurred or if the
   // application context name is not supported we want to refuse the association request.
   char buf[BUFSIZ];
-  OFCondition cond = ASC_getApplicationContextName( m_assoc->params, buf );
+  OFCondition cond = ASC_getApplicationContextName( m_assoc->params, buf , sizeof(buf));
   if( cond.bad() || strcmp( buf, DICOM_STDAPPLICATIONCONTEXT ) != 0 )
   {
     refuseAssociation( DCMSCP_BAD_APPLICATION_CONTEXT_NAME );
index 626f99e413bf4e95f8ff5474357edfd98e86358a..153ea3c202d7d0f2ae9262b4c8aa230025c9e15f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2008-2017, OFFIS e.V.
+ *  Copyright (C) 2008-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -776,7 +776,13 @@ OFCondition DcmSCU::sendSTORERequest(const T_ASC_PresentationContextID presID,
       {
         DCMNET_INFO("Converting transfer syntax: " << xfer.getXferName() << " -> "
           << netXfer.getXferName());
-        dataset->chooseRepresentation(netXfer.getXfer(), NULL);
+        cond = dataset->chooseRepresentation(netXfer.getXfer(), NULL);
+        if (cond.bad())
+        {
+           DCMNET_ERROR("No conversion to transfer syntax " << netXfer.getXferName() << " possible!");
+           delete fileformat;
+           return cond;
+        }
       }
     }
   }
index 6a51df7d00affa399fee9b1201b88f627eb9d4b3..78eaebf47a69af6527a06f1de3e82a16b59a426b 100644 (file)
@@ -8,17 +8,19 @@ tdump.o: tdump.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -79,17 +81,19 @@ tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -126,17 +130,19 @@ tpool.o: tpool.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -254,17 +260,19 @@ tscuscp.o: tscuscp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
index ff7e16fceb22ebde05feb679419fa8eb9e4f620d..f45a460545043d06c2c18208c20013d2fd6665db 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmpmaps)
+project(dcmpmaps)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmpmaps_SOURCE_DIR}/include" "${dcmfg_SOURCE_DIR}/include" "${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
+include_directories("${dcmpmaps_SOURCE_DIR}/include" "${dcmfg_SOURCE_DIR}/include" "${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc include)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc include)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 0c8da07a3632daf6765bfda7d12044250d983c6e..f1f5f341cc7aa450a1c862bb7beb575740454b1a 100644 (file)
@@ -438,7 +438,7 @@ static OFCondition addFrame(DPMParametricMapIOD& map,
   // Frame Content
   OFCondition result = fgFracon->setDimensionIndexValues(frameNo+1 /* value within dimension */, 0 /* first dimension */);
 
-  // Add frame wit related groups
+  // Add frame with related groups
   if (result.good())
   {
     // Add frame
index 569f448910552760b1cc348cb2844903f987b81e..5fd68015835a550d715950a0017e95b67fd10585 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmpmap DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h" PATTERN "CVS" EXCLUDE)
+install(DIRECTORY dcmtk/dcmpmap DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 4c49d929bc3b883c10cb062b5986a355c5873418..728f39fe059f56a642cc961b01e3ce553b407a27 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, Open Connections GmbH
+ *  Copyright (C) 2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
index 0cc1ae71a67cdd6ba8f127c64e6f201b4e6c2982..cd44343c2952ef3b2ab1dfa7284ee641f0a563b1 100644 (file)
@@ -40,6 +40,7 @@ dpmmodparametricmapimage.o: dpmmodparametricmapimage.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -49,6 +50,7 @@ dpmmodparametricmapimage.o: dpmmodparametricmapimage.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -117,6 +119,7 @@ dpmmodparametricmapseries.o: dpmmodparametricmapseries.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -126,6 +129,7 @@ dpmmodparametricmapseries.o: dpmmodparametricmapseries.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -246,6 +250,7 @@ dpmparametricmapbase.o: dpmparametricmapbase.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -253,6 +258,7 @@ dpmparametricmapbase.o: dpmparametricmapbase.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -422,8 +428,10 @@ dpmparametricmapiod.o: dpmparametricmapiod.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -588,6 +596,7 @@ dpmtypes.o: dpmtypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -596,6 +605,7 @@ dpmtypes.o: dpmtypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
index cf65edc4f8abb4125c4a9d13602f72e1cabe9950..efa20b0042cc7f6532c674ebe9d13fb6ffa0beba 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
 const OFString DPMParametricMapSeriesModule::m_ModuleName = "DPMParametricMapSeriesModule";
 
 DPMParametricMapSeriesModule::DPMParametricMapSeriesModule()
-: IODModule()
+: IODModule(),
+  m_ReferencedPerformedProcedureStepSequence()
 {
   resetRules();
 }
 
 DPMParametricMapSeriesModule::DPMParametricMapSeriesModule(OFshared_ptr<DcmItem> item,
                                                            OFshared_ptr<IODRules> rules)
-: IODModule(item, rules)
+: IODModule(item, rules),
+  m_ReferencedPerformedProcedureStepSequence()
 {
   // reset element rules
   resetRules();
index a1dc11007874959350716457da4d3f1eea52dd08..a31f97929e5289c7a6c4f8b938c592649c9df54b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -27,6 +27,7 @@
 
 DPMParametricMapBase::DPMParametricMapBase()
 : DPMParametricMapBase::IODImage()
+, m_FGInterface()
 , m_DPMParametricMapSeriesModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules())
 , m_IODEnhGeneralEquipmentModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules())
 , m_DPMParametricMapImageModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules())
@@ -41,6 +42,7 @@ DPMParametricMapBase::DPMParametricMapBase()
 template<typename ImagePixel>
 DPMParametricMapBase::DPMParametricMapBase(OFin_place_type_t(ImagePixel))
 : DPMParametricMapBase::IODImage(OFin_place<ImagePixel>)
+, m_FGInterface()
 , m_DPMParametricMapSeriesModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules())
 , m_IODEnhGeneralEquipmentModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules())
 , m_DPMParametricMapImageModule(DPMParametricMapBase::IODImage::getData(), DPMParametricMapBase::IODImage::getRules())
index cb89c651ef04d3241b5cd105b0ca03ad9c39480b..18feaf660f35079e60daaefc767fe90a5bb6fd25 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016-2017, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -110,19 +110,20 @@ struct DPMParametricMapIOD::ReadVisitor
     OFCondition result = map.readGeneric(item);
     if (result.good())
     {
-      Uint16 rows, cols, numFrames;
+      Uint16 rows, cols;
+      Uint32 numFrames;
       size_t numBytesFrame = 0;
-      rows = cols = numFrames = 0;
+      rows = cols = 0;
       map.getRows(rows);
       map.getColumns(cols);
       numFrames = DcmIODUtil::limitMaxFrames(map.getFunctionalGroups().getNumberOfFrames(),
-                                             "Functional groups implicate more than 65535 frames, only 65535 will be used");
+                                             "Functional groups implicate more than 2147483647 frames, only 2147483647 will be used");
       if (!rows || !cols || !numFrames)
       {
         DCMPMAP_ERROR("Rows (" << rows << "), Columns (" << cols << ") and Number of Frames (" << numFrames << ") must not be 0");
         return DPM_InvalidPixelInfo;
       }
-      numBytesFrame = rows * cols * sizeof(typename ImagePixel::value_type);
+      numBytesFrame = OFstatic_cast(size_t,rows) * cols * sizeof(typename ImagePixel::value_type);
       result = readSpecific(pixel, numFrames, numBytesFrame);
     }
     return result;
@@ -130,7 +131,7 @@ struct DPMParametricMapIOD::ReadVisitor
 
   template<typename T>
   OFCondition readSpecific(IODImagePixelModule<T>& p,
-                           const Uint16 numFrames,
+                           const Uint32 numFrames,
                            const size_t numBytesFrame)
   {
     // Avoid compiler warning about unused parameter
@@ -141,7 +142,7 @@ struct DPMParametricMapIOD::ReadVisitor
     {
       if (numTotalWords == numBytesFrame * numFrames / 2 /* we compare to num words not num bytes */)
       {
-        for (Uint16 n = 0; n < numFrames; n++)
+        for (Uint32 n = 0; n < numFrames; n++)
         {
           DcmIODTypes::Frame* f = new DcmIODTypes::Frame;
           if (f)
@@ -172,7 +173,7 @@ struct DPMParametricMapIOD::ReadVisitor
   }
 
   OFCondition readSpecific(IODFloatingPointImagePixelModule& p,
-                           const Uint16 numFrames,
+                           const Uint32 numFrames,
                            const size_t numBytesFrame)
   {
     // Avoid compiler warning on unused parameter
@@ -183,7 +184,7 @@ struct DPMParametricMapIOD::ReadVisitor
     {
       if (numTotalFloats == numBytesFrame * numFrames / 4 /* we compare to 32 bit floats not bytes */)
       {
-        for (Uint16 n=0; n < numFrames; n++)
+        for (Uint32 n=0; n < numFrames; n++)
         {
           DcmIODTypes::Frame* f = new DcmIODTypes::Frame;
           if (f)
@@ -214,8 +215,8 @@ struct DPMParametricMapIOD::ReadVisitor
   }
 
   OFCondition readSpecific(IODDoubleFloatingPointImagePixelModule& p,
-                    const Uint16 numFrames,
-                    const size_t numBytesFrame)
+                           const Uint32 numFrames,
+                           const size_t numBytesFrame)
   {
     // Avoid compiler warning on unused parameter
     (void)p;
@@ -976,7 +977,7 @@ OFCondition DPMParametricMapIOD::readGeneric(DcmItem& dataset)
 OFCondition DPMParametricMapIOD::writeGeneric(DcmItem& dataset)
 {
   getFrameOfReference().ensureFrameOfReferenceUID();
-  m_IODMultiFrameFGModule.setNumberOfFrames(DcmIODUtil::limitMaxFrames(m_Frames.size(), "Maximum number of frames exceeded, will write 65535"));
+  m_IODMultiFrameFGModule.setNumberOfFrames(DcmIODUtil::limitMaxFrames(m_Frames.size(), "Maximum number of frames exceeded, will write 2147483647"));
   OFCondition result = m_ContentIdentification.write(dataset);
   if (result.good())
   {
index 994da8b7511e85fbefa41b22261cfff0f98ac4f2..340293b7c5db30e86617b48be9e7c019f638e311 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmpstat)
+project(dcmpstat)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmpstat_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmnet_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmqrdb_SOURCE_DIR}/include" "${dcmsr_SOURCE_DIR}/include" "${dcmsign_SOURCE_DIR}/include" "${dcmtls_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${OPENSSL_INCDIR})
+include_directories("${dcmpstat_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmnet_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmqrdb_SOURCE_DIR}/include" "${dcmsr_SOURCE_DIR}/include" "${dcmsign_SOURCE_DIR}/include" "${dcmtls_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${OPENSSL_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc apps include data etc tests)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc apps include data etc tests)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 4bc6024d997451e0d03a24f6f94c1e2a0add0052..776e46222075015cec5065f2639bf77842b338d7 100644 (file)
@@ -1,16 +1,16 @@
 # declare additional include directories
-INCLUDE_DIRECTORIES(${dcmtls_SOURCE_DIR}/include ${LIBXML_INCDIR})
+include_directories(${dcmtls_SOURCE_DIR}/include ${LIBXML_INCDIR})
 
 # declare executables
-FOREACH(PROGRAM dcmmkcrv dcmmklut dcmp2pgm dcmprscp dcmprscu dcmpschk dcmpsmk dcmpsprt dcmpsrcv dcmpssnd)
+foreach(PROGRAM dcmmkcrv dcmmklut dcmp2pgm dcmprscp dcmprscu dcmpschk dcmpsmk dcmpsprt dcmpsrcv dcmpssnd)
   DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
-ENDFOREACH(PROGRAM)
+endforeach()
 
 # make sure executables are linked to the corresponding libraries
-FOREACH(PROGRAM dcmp2pgm dcmprscp dcmprscu dcmpsmk dcmpschk dcmpsprt dcmpsrcv dcmpssnd)
+foreach(PROGRAM dcmp2pgm dcmprscp dcmprscu dcmpsmk dcmpschk dcmpsprt dcmpsrcv dcmpssnd)
   DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmpstat dcmdsig dcmsr dcmimage dcmimgle dcmqrdb dcmnet dcmtls dcmdata oflog ofstd)
-ENDFOREACH(PROGRAM)
+endforeach()
 
-FOREACH(PROGRAM dcmmkcrv dcmmklut)
+foreach(PROGRAM dcmmkcrv dcmmklut)
   DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmdsig dcmsr dcmimage dcmimgle dcmdata oflog ofstd)
-ENDFOREACH(PROGRAM)
+endforeach()
index a0580a8998a4345ccb02bf2ac49771c510cbaa56..1fe3ec50d8374a571365e21056ec7ad0e9335e72 100644 (file)
@@ -7,17 +7,19 @@ dcmmkcrv.o: dcmmkcrv.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -149,6 +151,7 @@ dcmmklut.o: dcmmklut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -158,6 +161,7 @@ dcmmklut.o: dcmmklut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -230,7 +234,8 @@ dcmmklut.o: dcmmklut.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/digsdfn.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \
  ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h
+ ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \
+ ../../ofstd/include/dcmtk/ofstd/ofrand.h
 dcmp2pgm.o: dcmp2pgm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../include/dcmtk/dcmpstat/dviface.h ../include/dcmtk/dcmpstat/dvpscf.h \
@@ -267,6 +272,7 @@ dcmp2pgm.o: dcmp2pgm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -276,6 +282,7 @@ dcmp2pgm.o: dcmp2pgm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \
@@ -430,6 +437,7 @@ dcmprscp.o: dcmprscp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -439,6 +447,7 @@ dcmprscp.o: dcmprscp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmpstat/dviface.h ../include/dcmtk/dcmpstat/dvpscf.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -550,7 +559,8 @@ dcmprscp.o: dcmprscp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \
  ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h
+ ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h
 dcmprscu.o: dcmprscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \
  ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \
@@ -590,6 +600,7 @@ dcmprscu.o: dcmprscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -599,6 +610,7 @@ dcmprscu.o: dcmprscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmpstat/dviface.h ../include/dcmtk/dcmpstat/dvpscf.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -721,7 +733,8 @@ dcmprscu.o: dcmprscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \
  ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h
+ ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h
 dcmpschk.o: dcmpschk.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
@@ -732,16 +745,18 @@ dcmpschk.o: dcmpschk.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -861,17 +876,19 @@ dcmpsmk.o: dcmpsmk.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -1019,6 +1036,7 @@ dcmpsprt.o: dcmpsprt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1028,6 +1046,7 @@ dcmpsprt.o: dcmpsprt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \
@@ -1183,6 +1202,7 @@ dcmpsrcv.o: dcmpsrcv.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1192,6 +1212,7 @@ dcmpsrcv.o: dcmpsrcv.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmpstat/dvpscf.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -1294,7 +1315,8 @@ dcmpsrcv.o: dcmpsrcv.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmtls/include/dcmtk/dcmtls/tlstrans.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \
  ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h
+ ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h
 dcmpssnd.o: dcmpssnd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dpdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -1331,6 +1353,7 @@ dcmpssnd.o: dcmpssnd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1340,6 +1363,7 @@ dcmpssnd.o: dcmpssnd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmpstat/dvpscf.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -1387,4 +1411,5 @@ dcmpssnd.o: dcmpssnd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \
  ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h
+ ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h
index 507208b5afd961fdc3e6b38820727ac3024b35a0..7b03f4a382673d0dea047695eb8908273c325ddb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -36,6 +36,7 @@
 #include "dcmtk/dcmimgle/diutils.h"
 #include "dcmtk/ofstd/ofstream.h"
 #include "dcmtk/ofstd/ofstd.h"
+#include "dcmtk/ofstd/ofrand.h"
 
 #define INCLUDE_CSTDLIB
 #define INCLUDE_CSTDIO
@@ -430,14 +431,15 @@ static void applyInverseGSDF(const unsigned int numberOfBits,
                              const unsigned int reflection,
                              Uint16 *outputData,
                              OFString &header,
-                             char *explanation)
+                             char *explanation,
+                             size_t explanationSize)
 {
     if (outputData != NULL)
     {
         OFLOG_INFO(dcmmklutLogger, "applying inverse GSDF ...");
         OFOStringStream oss;
         if ((explanation != NULL) && (strlen(explanation) > 0))
-            strcat(explanation, ", inverse GSDF");
+            OFStandard::strlcat(explanation, ", inverse GSDF", explanationSize);
         const double l0 = (double)illumination;
         const double la = (double)reflection;
         const double dmin = (double)minDensity / 100;
@@ -467,37 +469,31 @@ static void applyInverseGSDF(const unsigned int numberOfBits,
     }
 }
 
-#ifndef RAND_MAX
-/* some brain-dead systems such as SunOS 4.1.3 do not define any constant
- * for the upper limit of rand() calls. We hope that such systems at least
- * keep within the SysV specs and return values up to 2^15-1.
- */
-#define RAND_MAX 32767
-#endif
-
 static void mixingUpLUT(const unsigned long numberOfEntries,
                         const OFBool byteAlign,
                         const unsigned long randomCount,
-                        const unsigned int randomSeed,
+                        const Uint32 randomSeed,
                         Uint16 *outputData,
-                        char *explanation)
+                        char *explanation,
+                        size_t explanationSize)
 {
+    OFRandom rnd;
     if (outputData != NULL)
     {
         OFLOG_INFO(dcmmklutLogger, "mixing up LUT entries ...");
         if ((explanation != NULL) && (strlen(explanation) > 0))
-            strcat(explanation, ", mixed-up entries");
-        srand(randomSeed);
+            OFStandard::strlcat(explanation, ", mixed-up entries", explanationSize);
+        rnd.seed(randomSeed);
         unsigned long i, i1, i2;
-        const double factor = (double)(numberOfEntries - 1) / RAND_MAX;
+        const double factor = (double)(numberOfEntries - 1) / OFstatic_cast(Uint32, -1);
         if (byteAlign)
         {
             Uint8 temp;
             Uint8 *data8 = (Uint8 *)outputData;
             for (i = 0; i < randomCount; i++)
             {
-                i1 = (unsigned long)(rand() * factor);
-                i2 = (unsigned long)(rand() * factor);
+                i1 = (unsigned long)(rnd.getRND32() * factor);
+                i2 = (unsigned long)(rnd.getRND32() * factor);
                 if (i1 != i2)
                 {
                     temp = data8[i1];
@@ -509,8 +505,8 @@ static void mixingUpLUT(const unsigned long numberOfEntries,
             Uint16 temp;
             for (i = 0; i < randomCount; i++)
             {
-                i1 = (unsigned long)(rand() * factor);
-                i2 = (unsigned long)(rand() * factor);
+                i1 = (unsigned long)(rnd.getRND32() * factor);
+                i2 = (unsigned long)(rnd.getRND32() * factor);
                 if (i1 != i2)
                 {
                     temp = outputData[i1];
@@ -907,7 +903,7 @@ int main(int argc, char *argv[])
         {
             char explStr[1024];
             if (opt_explanation != NULL)
-                strcpy(explStr, opt_explanation);
+                OFStandard::strlcpy(explStr, opt_explanation, 1024);
             else
                 explStr[0] = 0;
             OFString headerStr;
@@ -932,9 +928,9 @@ int main(int argc, char *argv[])
             {
                 if (opt_inverseGSDF)
                     applyInverseGSDF((unsigned int)opt_bits, opt_entries, opt_byteAlign, (unsigned int)opt_minDensity, (unsigned int)opt_maxDensity,
-                        (unsigned int)opt_illumination, (unsigned int)opt_reflection, outputData, headerStr, explStr);
+                        (unsigned int)opt_illumination, (unsigned int)opt_reflection, outputData, headerStr, explStr, 1024);
                 if (opt_randomCount > 0)
-                    mixingUpLUT(opt_entries, opt_byteAlign, opt_randomCount, (unsigned int)opt_randomSeed, outputData, explStr);
+                    mixingUpLUT(opt_entries, opt_byteAlign, opt_randomCount, (Uint32)opt_randomSeed, outputData, explStr, 1024);
                 result = createLUT((unsigned int)opt_bits, opt_entries, opt_firstMapped, opt_byteAlign, opt_lutVR, *ditem,
                     outputData, explStr);
             }
index b1e58781e0206ae27a7406135b152f84d740bfb3..480975b1a2b9988990c25f88e9ef0f061187ee85 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -358,10 +358,12 @@ static void dumpPresentationState(DVPresentationState &ps)
         ofile = fopen(overlayfile, "wb");
         if (ofile)
         {
-           fprintf(ofile, "P5\n%d %d 255\n", overlayWidth, overlayHeight);
-           fwrite(overlayData, overlayWidth, overlayHeight, ofile);
-           fclose(ofile);
-           oss << " - written." << OFendl;
+          fprintf(ofile, "P5\n%d %d 255\n", overlayWidth, overlayHeight);
+          if (fwrite(overlayData, overlayWidth, overlayHeight, ofile) == overlayHeight)
+            oss << " - written." << OFendl;
+          else
+            oss << " -write error-" << OFendl;
+          fclose(ofile);
         } else oss << " -write error-" << OFendl;
       } else {
         oss << "        unable to access overlay data!" << OFendl;
@@ -542,7 +544,8 @@ int main(int argc, char *argv[])
                 {
                     OFLOG_DEBUG(dcmp2pgmLogger, "writing PGM file: " << opt_pgmName);
                     fprintf(outfile, "P5\n%ld %ld 255\n", width, height);
-                    fwrite(pixelData, (size_t)width, (size_t)height, outfile);
+                    if (fwrite(pixelData, OFstatic_cast(size_t, width), OFstatic_cast(size_t, height), outfile) != OFstatic_cast(size_t, height))
+                        OFLOG_FATAL(dcmp2pgmLogger, "Can't write output data to file.");
                     fclose(outfile);
                 } else {
                     OFLOG_FATAL(dcmp2pgmLogger, "Can't create output file.");
index 2013adfc0af4486b193c169be8d2cec9debcdc69..73a95a6aa28966225ecc4df30f8b518fcf866769 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -66,7 +66,7 @@ static void cleanChildren()
 {
 #ifdef HAVE_WAITPID
     int stat_loc;
-#elif HAVE_WAIT3
+#elif defined(HAVE_WAIT3)
     struct rusage rusage;
 #if defined(__NeXT__)
     /* some systems need a union wait as argument to wait3 */
@@ -105,6 +105,9 @@ static void cleanChildren()
 int main(int argc, char *argv[])
 {
     OFStandard::initializeNetwork();
+#ifdef WITH_OPENSSL
+    DcmTLSTransportLayer::initializeOpenSSL();
+#endif
 
     dcmDisableGethostbyaddr.set(OFTrue);  // disable hostname lookup
 
@@ -146,7 +149,7 @@ int main(int argc, char *argv[])
             COUT << "- ZLIB, Version " << zlibVersion() << OFendl;
 #endif
 #ifdef WITH_OPENSSL
-            COUT << "- " << OPENSSL_VERSION_TEXT << OFendl;
+            COUT << "- " << DcmTLSTransportLayer::getOpenSSLVersionName() << OFendl;
 #endif
             return 0;
          }
@@ -337,50 +340,47 @@ int main(int argc, char *argv[])
     if (tlsCACertificateFolder==NULL) tlsCACertificateFolder = ".";
 
     /* key file format */
-    int keyFileFormat = SSL_FILETYPE_PEM;
-    if (! dvi.getTLSPEMFormat()) keyFileFormat = SSL_FILETYPE_ASN1;
-
-    /* ciphersuites */
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-    OFString tlsCiphersuites(TLS1_TXT_RSA_WITH_AES_128_SHA ":" SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#else
-    OFString tlsCiphersuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#endif
-    Uint32 tlsNumberOfCiphersuites = dvi.getTargetNumberOfCipherSuites(opt_printer);
-    if (tlsNumberOfCiphersuites > 0)
-    {
-      tlsCiphersuites.clear();
-      OFString currentSuite;
-      const char *currentOpenSSL;
-      for (Uint32 ui=0; ui<tlsNumberOfCiphersuites; ui++)
-      {
-        dvi.getTargetCipherSuite(opt_printer, ui, currentSuite);
-        if (NULL == (currentOpenSSL = DcmTLSTransportLayer::findOpenSSLCipherSuiteName(currentSuite.c_str())))
-        {
-          OFLOG_WARN(dcmprscpLogger, "ciphersuite '" << currentSuite << "' is unknown. Known ciphersuites are:");
-          unsigned long numSuites = DcmTLSTransportLayer::getNumberOfCipherSuites();
-          for (unsigned long cs=0; cs < numSuites; cs++)
-          {
-            OFLOG_WARN(dcmprscpLogger, "    " << DcmTLSTransportLayer::getTLSCipherSuiteName(cs));
-          }
-          return 1;
-        } else {
-          if (!tlsCiphersuites.empty()) tlsCiphersuites += ":";
-          tlsCiphersuites += currentOpenSSL;
-        }
-      }
-    }
+    DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM;
+    if (! dvi.getTLSPEMFormat()) keyFileFormat = DCF_Filetype_ASN1;
 
     DcmTLSTransportLayer *tLayer = NULL;
     if (targetUseTLS)
     {
-      tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_ACCEPTOR, tlsRandomSeedFile.c_str());
+      tLayer = new DcmTLSTransportLayer(NET_ACCEPTOR, tlsRandomSeedFile.c_str(), OFFalse);
       if (tLayer == NULL)
       {
         OFLOG_FATAL(dcmprscpLogger, "unable to create TLS transport layer");
         return 1;
       }
 
+      // determine TLS profile
+      OFString profileName;
+      const char *profileNamePtr = dvi.getTargetTLSProfile(opt_printer);
+      if (profileNamePtr) profileName = profileNamePtr;
+      DcmTLSSecurityProfile tlsProfile = TSP_Profile_BCP195;  // default
+      if (profileName == "BCP195") tlsProfile = TSP_Profile_BCP195;
+      else if (profileName == "BCP195-ND") tlsProfile = TSP_Profile_BCP195_ND;
+      else if (profileName == "AES") tlsProfile = TSP_Profile_AES;
+      else if (profileName == "BASIC") tlsProfile = TSP_Profile_Basic;
+      else if (profileName == "NULL") tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted;
+      else
+      {
+        OFLOG_WARN(dcmprscpLogger, "unknown TLS profile '" << profileName << "', ignoring");
+      }
+
+      if (TCS_ok != tLayer->setTLSProfile(tlsProfile))
+      {
+        OFLOG_FATAL(dcmprscpLogger, "unable to select the TLS security profile");
+        return 1;
+      }
+
+      // activate cipher suites
+      if (TCS_ok != tLayer->activateCipherSuites())
+      {
+        OFLOG_FATAL(dcmprscpLogger, "unable to activate the selected list of TLS ciphersuites");
+        return 1;
+      }
+
       if (tlsCACertificateFolder && (TCS_ok != tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat)))
       {
         OFLOG_WARN(dcmprscpLogger, "unable to load certificates from directory '" << tlsCACertificateFolder << "', ignoring");
@@ -406,12 +406,6 @@ int main(int argc, char *argv[])
         OFLOG_FATAL(dcmprscpLogger, "private key '" << tlsPrivateKeyFile << "' and certificate '" << tlsCertificateFile << "' do not match");
         return 1;
       }
-      if (TCS_ok != tLayer->setCipherSuites(tlsCiphersuites.c_str()))
-      {
-        OFLOG_FATAL(dcmprscpLogger, "unable to set selected cipher suites");
-        return 1;
-      }
-
       tLayer->setCertificateVerification(tlsCertVerification);
 
     }
index 1393610c603e7cf8c1f706a434bddfb473c39e2d..17bcc67e4e9e32cc4cae6e777eff096fad3237f5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 1999-2017, OFFIS e.V.
+ *  Copyright (C) 1999-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -54,16 +54,16 @@ END_EXTERN_C
 #include "dcmtk/ofstd/ofstream.h"
 #include "dcmtk/dcmpstat/dvpsdef.h"    /* for constants */
 #include "dcmtk/dcmpstat/dviface.h"    /* for DVInterface */
-#include "dcmtk/ofstd/ofstring.h"   /* for OFString */
-#include "dcmtk/ofstd/ofbmanip.h"   /* for OFBitmanipTemplate */
-#include "dcmtk/ofstd/ofdatime.h"   /* for OFDateTime */
-#include "dcmtk/dcmdata/dcuid.h"      /* for dcmtk version name */
-#include "dcmtk/dcmdata/cmdlnarg.h"   /* for prepareCmdLineArgs */
-#include "dcmtk/ofstd/ofconapp.h"   /* for OFConsoleApplication */
+#include "dcmtk/ofstd/ofstring.h"      /* for OFString */
+#include "dcmtk/ofstd/ofbmanip.h"      /* for OFBitmanipTemplate */
+#include "dcmtk/ofstd/ofdatime.h"      /* for OFDateTime */
+#include "dcmtk/dcmdata/dcuid.h"       /* for dcmtk version name */
+#include "dcmtk/dcmdata/cmdlnarg.h"    /* for prepareCmdLineArgs */
+#include "dcmtk/ofstd/ofconapp.h"      /* for OFConsoleApplication */
 #include "dcmtk/dcmimgle/dcmimage.h"
 #include "dcmtk/dcmpstat/dvpspr.h"
 #include "dcmtk/dcmpstat/dvpssp.h"
-#include "dcmtk/dcmpstat/dvpshlp.h"     /* for class DVPSHelper */
+#include "dcmtk/dcmpstat/dvpshlp.h"    /* for class DVPSHelper */
 #include "dcmtk/ofstd/ofstd.h"
 
 #ifdef WITH_OPENSSL
@@ -369,7 +369,7 @@ static OFCondition spoolJobList(
       result2 = spoolStoredPrintFile(currentJob->storedPrintFilename.c_str(), dvi, tlayer);
       if (result2 != EC_Normal)
       {
-        OFLOG_ERROR(dcmprscuLogger, "spooler: error occured during spooling of Stored Print object '" << currentJob->storedPrintFilename << "'");
+        OFLOG_ERROR(dcmprscuLogger, "spooler: error occurred during spooling of Stored Print object '" << currentJob->storedPrintFilename << "'");
       }
       if (result == EC_Normal) result = result2; // forward error codes, but do not erase
     } else {
@@ -617,6 +617,9 @@ static OFCondition updateJobList(
 int main(int argc, char *argv[])
 {
     OFStandard::initializeNetwork();
+#ifdef WITH_OPENSSL
+    DcmTLSTransportLayer::initializeOpenSSL();
+#endif
 
     OFConsoleApplication app(OFFIS_CONSOLE_APPLICATION , "Print spooler for presentation state viewer", rcsid);
     OFCommandLine cmd;
@@ -680,7 +683,7 @@ int main(int argc, char *argv[])
             COUT << "- ZLIB, Version " << zlibVersion() << OFendl;
 #endif
 #ifdef WITH_OPENSSL
-            COUT << "- " << OPENSSL_VERSION_TEXT << OFendl;
+            COUT << "- " << DcmTLSTransportLayer::getOpenSSLVersionName() << OFendl;
 #endif
             return 0;
          }
@@ -865,50 +868,47 @@ int main(int argc, char *argv[])
     if (tlsCACertificateFolder==NULL) tlsCACertificateFolder = ".";
 
     /* key file format */
-    int keyFileFormat = SSL_FILETYPE_PEM;
-    if (! dvi.getTLSPEMFormat()) keyFileFormat = SSL_FILETYPE_ASN1;
-
-    /* ciphersuites */
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-    OFString tlsCiphersuites(TLS1_TXT_RSA_WITH_AES_128_SHA ":" SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#else
-    OFString tlsCiphersuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#endif
-    Uint32 tlsNumberOfCiphersuites = dvi.getTargetNumberOfCipherSuites(opt_printer);
-    if (tlsNumberOfCiphersuites > 0)
-    {
-      tlsCiphersuites.clear();
-      OFString currentSuite;
-      const char *currentOpenSSL;
-      for (Uint32 ui=0; ui<tlsNumberOfCiphersuites; ui++)
-      {
-        dvi.getTargetCipherSuite(opt_printer, ui, currentSuite);
-        if (NULL == (currentOpenSSL = DcmTLSTransportLayer::findOpenSSLCipherSuiteName(currentSuite.c_str())))
-        {
-          OFLOG_FATAL(dcmprscuLogger, "ciphersuite '" << currentSuite << "' is unknown. Known ciphersuites are:");
-          unsigned long numSuites = DcmTLSTransportLayer::getNumberOfCipherSuites();
-          for (unsigned long cs=0; cs < numSuites; cs++)
-          {
-            OFLOG_FATAL(dcmprscuLogger, "    " << DcmTLSTransportLayer::getTLSCipherSuiteName(cs));
-          }
-          return 1;
-        } else {
-          if (!tlsCiphersuites.empty()) tlsCiphersuites += ":";
-          tlsCiphersuites += currentOpenSSL;
-        }
-      }
-    }
+    DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM;
+    if (! dvi.getTLSPEMFormat()) keyFileFormat = DCF_Filetype_ASN1;
 
     DcmTLSTransportLayer *tLayer = NULL;
     if (useTLS)
     {
-      tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_REQUESTOR, tlsRandomSeedFile.c_str());
+      tLayer = new DcmTLSTransportLayer(NET_REQUESTOR, tlsRandomSeedFile.c_str(), OFFalse);
       if (tLayer == NULL)
       {
         OFLOG_FATAL(dcmprscuLogger, "unable to create TLS transport layer");
         return 1;
       }
 
+      // determine TLS profile
+      OFString profileName;
+      const char *profileNamePtr = dvi.getTargetTLSProfile(opt_printer);
+      if (profileNamePtr) profileName = profileNamePtr;
+      DcmTLSSecurityProfile tlsProfile = TSP_Profile_BCP195;  // default
+      if (profileName == "BCP195") tlsProfile = TSP_Profile_BCP195;
+      else if (profileName == "BCP195-ND") tlsProfile = TSP_Profile_BCP195_ND;
+      else if (profileName == "AES") tlsProfile = TSP_Profile_AES;
+      else if (profileName == "BASIC") tlsProfile = TSP_Profile_Basic;
+      else if (profileName == "NULL") tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted;
+      else
+      {
+        OFLOG_WARN(dcmprscuLogger, "unknown TLS profile '" << profileName << "', ignoring");
+      }
+
+      if (TCS_ok != tLayer->setTLSProfile(tlsProfile))
+      {
+        OFLOG_FATAL(dcmprscuLogger, "unable to select the TLS security profile");
+        return 1;
+      }
+
+      // activate cipher suites
+      if (TCS_ok != tLayer->activateCipherSuites())
+      {
+        OFLOG_FATAL(dcmprscuLogger, "unable to activate the selected list of TLS ciphersuites");
+        return 1;
+      }
+
       if (tlsCACertificateFolder && (TCS_ok != tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat)))
       {
         OFLOG_WARN(dcmprscuLogger, "unable to load certificates from directory '" << tlsCACertificateFolder << "', ignoring");
@@ -937,11 +937,6 @@ int main(int argc, char *argv[])
           return 1;
         }
       }
-      if (TCS_ok != tLayer->setCipherSuites(tlsCiphersuites.c_str()))
-      {
-        OFLOG_FATAL(dcmprscuLogger, "unable to set selected cipher suites");
-        return 1;
-      }
 
       tLayer->setCertificateVerification(tlsCertVerification);
 
@@ -1025,13 +1020,15 @@ int main(int argc, char *argv[])
 #ifdef WITH_OPENSSL
     if (useTLS)
     {
+      OFString cslist;
+      if (tLayer) tLayer->getListOfCipherSuitesForOpenSSL(cslist);
       OFLOG_INFO(dcmprscuLogger, "  certificate   : " << tlsCertificateFile);
       OFLOG_INFO(dcmprscuLogger, "  key file      : " << tlsPrivateKeyFile);
       OFLOG_INFO(dcmprscuLogger, "  DH params     : " << tlsDHParametersFile);
       OFLOG_INFO(dcmprscuLogger, "  PRNG seed     : " << tlsRandomSeedFile);
       OFLOG_INFO(dcmprscuLogger, "  CA directory  : " << tlsCACertificateFolder);
-      OFLOG_INFO(dcmprscuLogger, "  ciphersuites  : " << tlsCiphersuites);
-      OFLOG_INFO(dcmprscuLogger, "  key format    : " << (keyFileFormat == SSL_FILETYPE_PEM ? "PEM" : "DER"));
+      OFLOG_INFO(dcmprscuLogger, "  ciphersuites  : " << cslist);
+      OFLOG_INFO(dcmprscuLogger, "  key format    : " << (keyFileFormat == DCF_Filetype_PEM ? "PEM" : "DER"));
       const char *verification;
       switch (tlsCertVerification)
       {
index ff4af5b3860e3b998ade6b511094d4ffb6f0695a..42f394dd118287c6e2db16ed8a2e30730514e527 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -245,7 +245,7 @@ static OFBool isaKnownPointer(DcmTag& t)
 
     if (dictRef && (t.getEVR() == EVR_up) && (t.getEVR() == dictRef->getEVR())) result = OFTrue;
 
-    dcmDataDict.unlock();
+    dcmDataDict.rdunlock();
     return result;
 }
 
@@ -557,7 +557,7 @@ static int checkelem(
       } //end of if (isaStringVR(vr))
 
     }
-    dcmDataDict.unlock();
+    dcmDataDict.rdunlock();
     return 0;
 }
 
@@ -889,15 +889,8 @@ static int checkfile(const char *filename)
           << "Pass 3 - Semantic Check of Presentation State Object         " << OFendl
           << "-------------------------------------------------------------");
 
-    DcmUniqueIdentifier sopclassuid(DCM_SOPClassUID);
-    DcmStack stack;
-    if (EC_Normal == DataSet->search(DCM_SOPClassUID, stack, ESM_fromHere, OFFalse))
-    {
-      sopclassuid = *((DcmUniqueIdentifier *)(stack.top()));
-    }
     OFString aString;
-    sopclassuid.getOFString(aString,0);
-    if (aString == UID_GrayscaleSoftcopyPresentationStateStorage)
+    if ((DataSet->findAndGetOFString(DCM_SOPClassUID, aString).good()) && (aString == UID_GrayscaleSoftcopyPresentationStateStorage))
     {
       DcmPresentationState pState;
       if (pState.read(*DataSet).bad())
index 064efb38c0403597dc0c606a32114a7fc9124b27..061c3ca80446705d10fc5af3581136b58c0947e6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2012, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -353,9 +353,7 @@ int main(int argc, char *argv[])
 
     DcmXfer oxferSyn(opt_oxfer);
 
-    dataset2->chooseRepresentation(opt_oxfer, NULL);
-
-    if (dataset2->canWriteXfer(opt_oxfer))
+    if (dataset2->chooseRepresentation(opt_oxfer, NULL).good() && dataset2->canWriteXfer(opt_oxfer))
     {
         OFLOG_INFO(dcmpsmkLogger, "Output transfer syntax " << oxferSyn.getXferName()
                 << " can be written");
index 64d8c46dfef110daf9953dc9e506c026976bcb6a..d7fa1c6ced1a983ab314413b0bccdd80f5e176b8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1999-2017, OFFIS e.V.
+ *  Copyright (C) 1999-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -40,6 +40,7 @@ END_EXTERN_C
 #include "dcmtk/dcmnet/diutil.h"
 #include "dcmtk/dcmdata/cmdlnarg.h"
 #include "dcmtk/ofstd/ofconapp.h"
+#include "dcmtk/ofstd/ofstd.h"
 #include "dcmtk/dcmqrdb/dcmqrdbi.h"     /* for LOCK_IMAGE_FILES */
 #include "dcmtk/dcmqrdb/dcmqrdbs.h"     /* for DcmQueryRetrieveDatabaseStatus */
 #include "dcmtk/dcmpstat/dvpsmsg.h"     /* for class DVPSIPCClient */
@@ -101,7 +102,7 @@ static void cleanChildren()
 {
 #ifdef HAVE_WAITPID
     int stat_loc;
-#elif HAVE_WAIT3
+#elif defined(HAVE_WAIT3)
     struct rusage rusage;
 #if defined(__NeXT__)
     /* some systems need a union wait as argument to wait3 */
@@ -230,7 +231,7 @@ static associationType negotiateAssociation(
 
       ASC_setAPTitles((*assoc)->params, NULL, NULL, aetitle);
       /* Application Context Name */
-      cond = ASC_getApplicationContextName((*assoc)->params, buf);
+      cond = ASC_getApplicationContextName((*assoc)->params, buf, sizeof(buf));
       if (cond.bad() || strcmp(buf, DICOM_STDAPPLICATIONCONTEXT) != 0)
       {
           /* reject: the application context name is not supported */
@@ -364,7 +365,7 @@ checkRequestAgainstDataset(
     DIC_UI sopClass;
     DIC_UI sopInstance;
 
-    if (!DU_findSOPClassAndInstanceInDataSet(dataSet, sopClass, sopInstance, opt_correctUIDPadding))
+    if (!DU_findSOPClassAndInstanceInDataSet(dataSet, sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), opt_correctUIDPadding))
     {
       OFLOG_ERROR(dcmpsrcvLogger, "Bad image file: " << fname);
       rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand;
@@ -503,7 +504,7 @@ static OFCondition storeSCP(
         /* callback will send back sop class not supported status */
         status = STATUS_STORE_Refused_SOPClassNotSupported;
         /* must still receive data */
-        strcpy(imageFileName, NULL_DEVICE_NAME);
+        OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName));
     }
     else
     {
@@ -512,7 +513,7 @@ static OFCondition storeSCP(
       {
         OFLOG_ERROR(dcmpsrcvLogger, "Unable to access database '" << dbfolder << "'");
         /* must still receive data */
-        strcpy(imageFileName, NULL_DEVICE_NAME);
+        OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName));
         /* callback will send back out of resources status */
         status = STATUS_STORE_Refused_OutOfResources;
         dbhandle = NULL;
@@ -522,11 +523,11 @@ static OFCondition storeSCP(
         if (dbhandle->makeNewStoreFileName(
             request->AffectedSOPClassUID,
             request->AffectedSOPInstanceUID,
-            imageFileName).bad())
+            imageFileName, sizeof(imageFileName)).bad())
         {
             OFLOG_ERROR(dcmpsrcvLogger, "storeSCP: Database: DB_makeNewStoreFileName Failed");
             /* must still receive data */
-            strcpy(imageFileName, NULL_DEVICE_NAME);
+            OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName));
             /* callback will send back out of resources status */
             status = STATUS_STORE_Refused_OutOfResources;
         }
@@ -564,11 +565,8 @@ static OFCondition storeSCP(
     if (cond.bad() || (context.status != STATUS_Success))
     {
         /* remove file */
-        if (strcpy(imageFileName, NULL_DEVICE_NAME) != 0)
-        {
-          OFLOG_INFO(dcmpsrcvLogger, "Store SCP: Deleting Image File: " << imageFileName);
-          OFStandard::deleteFile(imageFileName);
-        }
+        OFLOG_INFO(dcmpsrcvLogger, "Store SCP: Deleting Image File: " << imageFileName);
+        OFStandard::deleteFile(imageFileName);
         if (dbhandle) dbhandle->pruneInvalidRecords();
     }
 
@@ -733,8 +731,8 @@ static void terminateAllReceivers(DVConfiguration& dvi)
   if (tlsFolder==NULL) tlsFolder = ".";
 
   /* key file format */
-  int keyFileFormat = SSL_FILETYPE_PEM;
-  if (! dvi.getTLSPEMFormat()) keyFileFormat = SSL_FILETYPE_ASN1;
+  DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM;
+  if (! dvi.getTLSPEMFormat()) keyFileFormat = DCF_Filetype_PEM;
 #endif
 
   if ((ASC_initializeNetwork(NET_REQUESTOR, 0, 30, &net).bad())) return;
@@ -790,36 +788,29 @@ static void terminateAllReceivers(DVConfiguration& dvi)
       if (tlsCACertificateFolder==NULL) tlsCACertificateFolder = ".";
 
       /* ciphersuites */
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-      OFString tlsCiphersuites(TLS1_TXT_RSA_WITH_AES_128_SHA ":" SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#else
-      OFString tlsCiphersuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#endif
-      Uint32 tlsNumberOfCiphersuites = dvi.getTargetNumberOfCipherSuites(recID);
-      if (tlsNumberOfCiphersuites > 0)
-      {
-        tlsCiphersuites.clear();
-        OFString currentSuite;
-        const char *currentOpenSSL;
-        for (Uint32 ui=0; ui<tlsNumberOfCiphersuites; ui++)
-        {
-          dvi.getTargetCipherSuite(recID, ui, currentSuite);
-          if (NULL != (currentOpenSSL = DcmTLSTransportLayer::findOpenSSLCipherSuiteName(currentSuite.c_str())))
-          {
-            if (!tlsCiphersuites.empty()) tlsCiphersuites += ":";
-            tlsCiphersuites += currentOpenSSL;
-          }
-        }
-      }
-      DcmTLSTransportLayer *tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_REQUESTOR, tlsRandomSeedFile.c_str());
+      DcmTLSTransportLayer *tLayer = new DcmTLSTransportLayer(NET_REQUESTOR, tlsRandomSeedFile.c_str(), OFFalse);
       if (tLayer)
       {
+
+        // determine TLS profile
+        OFString profileName;
+        const char *profileNamePtr = dvi.getTargetTLSProfile(recID);
+        if (profileNamePtr) profileName = profileNamePtr;
+        DcmTLSSecurityProfile tlsProfile = TSP_Profile_BCP195;  // default
+        if (profileName == "BCP195") tlsProfile = TSP_Profile_BCP195;
+        else if (profileName == "BCP195-ND") tlsProfile = TSP_Profile_BCP195_ND;
+        else if (profileName == "AES") tlsProfile = TSP_Profile_AES;
+        else if (profileName == "BASIC") tlsProfile = TSP_Profile_Basic;
+        else if (profileName == "NULL") tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted;
+
+        (void) tLayer->setTLSProfile(tlsProfile);
+        (void) tLayer->activateCipherSuites();
+
         if (tlsCACertificateFolder) tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat);
         if (tlsDHParametersFile.size() > 0) tLayer->setTempDHParameters(tlsDHParametersFile.c_str());
         tLayer->setPrivateKeyPasswd(tlsPrivateKeyPassword); // never prompt on console
         tLayer->setPrivateKeyFile(tlsPrivateKeyFile.c_str(), keyFileFormat);
         tLayer->setCertificateFile(tlsCertificateFile.c_str(), keyFileFormat);
-        tLayer->setCipherSuites(tlsCiphersuites.c_str());
         tLayer->setCertificateVerification(DCV_ignoreCertificate);
         ASC_setTransportLayer(net, tLayer, 1);
       }
@@ -827,7 +818,7 @@ static void terminateAllReceivers(DVConfiguration& dvi)
       prepared = OFFalse;
 #endif
     } else {
-      DcmTransportLayer *dLayer = new DcmTransportLayer(DICOM_APPLICATION_REQUESTOR);
+      DcmTransportLayer *dLayer = new DcmTransportLayer();
       ASC_setTransportLayer(net, dLayer, 1);
     }
     if (prepared && recAETitle && (recPort > 0))
@@ -862,6 +853,9 @@ static void terminateAllReceivers(DVConfiguration& dvi)
 int main(int argc, char *argv[])
 {
     OFStandard::initializeNetwork();
+#ifdef WITH_OPENSSL
+    DcmTLSTransportLayer::initializeOpenSSL();
+#endif
 
     int         opt_terminate = 0;         /* default: no terminate mode */
     const char *opt_cfgName   = NULL;      /* config file name */
@@ -903,7 +897,7 @@ int main(int argc, char *argv[])
             COUT << "- ZLIB, Version " << zlibVersion() << OFendl;
 #endif
 #ifdef WITH_OPENSSL
-            COUT << "- " << OPENSSL_VERSION_TEXT << OFendl;
+            COUT << "- " << DcmTLSTransportLayer::getOpenSSLVersionName() << OFendl;
 #endif
             return 0;
          }
@@ -1022,39 +1016,9 @@ int main(int argc, char *argv[])
     if (tlsCACertificateFolder==NULL) tlsCACertificateFolder = ".";
 
     /* key file format */
-    int keyFileFormat = SSL_FILETYPE_PEM;
-    if (! dvi.getTLSPEMFormat()) keyFileFormat = SSL_FILETYPE_ASN1;
+    DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM;
+    if (! dvi.getTLSPEMFormat()) keyFileFormat = DCF_Filetype_ASN1;
 
-    /* ciphersuites */
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-    OFString tlsCiphersuites(TLS1_TXT_RSA_WITH_AES_128_SHA ":" SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#else
-    OFString tlsCiphersuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#endif
-    Uint32 tlsNumberOfCiphersuites = dvi.getTargetNumberOfCipherSuites(opt_cfgID);
-    if (tlsNumberOfCiphersuites > 0)
-    {
-      tlsCiphersuites.clear();
-      OFString currentSuite;
-      const char *currentOpenSSL;
-      for (Uint32 ui=0; ui<tlsNumberOfCiphersuites; ui++)
-      {
-        dvi.getTargetCipherSuite(opt_cfgID, ui, currentSuite);
-        if (NULL == (currentOpenSSL = DcmTLSTransportLayer::findOpenSSLCipherSuiteName(currentSuite.c_str())))
-        {
-          OFLOG_FATAL(dcmpsrcvLogger, "ciphersuite '" << currentSuite << "' is unknown. Known ciphersuites are:");
-          unsigned long numSuites = DcmTLSTransportLayer::getNumberOfCipherSuites();
-          for (unsigned long cs=0; cs < numSuites; cs++)
-          {
-            OFLOG_FATAL(dcmpsrcvLogger, "    " << DcmTLSTransportLayer::getTLSCipherSuiteName(cs));
-          }
-          return 1;
-        } else {
-          if (!tlsCiphersuites.empty()) tlsCiphersuites += ":";
-          tlsCiphersuites += currentOpenSSL;
-        }
-      }
-    }
 #else
     if (useTLS)
     {
@@ -1126,37 +1090,6 @@ int main(int argc, char *argv[])
     verboseParameters << "  TLS             : ";
     if (useTLS) verboseParameters << "enabled" << OFendl; else verboseParameters << "disabled" << OFendl;
 
-#ifdef WITH_OPENSSL
-    if (useTLS)
-    {
-      verboseParameters << "  TLS certificate : " << tlsCertificateFile << OFendl
-           << "  TLS key file    : " << tlsPrivateKeyFile << OFendl
-           << "  TLS DH params   : " << tlsDHParametersFile << OFendl
-           << "  TLS PRNG seed   : " << tlsRandomSeedFile << OFendl
-           << "  TLS CA directory: " << tlsCACertificateFolder << OFendl
-           << "  TLS ciphersuites: " << tlsCiphersuites << OFendl
-           << "  TLS key format  : ";
-      if (keyFileFormat == SSL_FILETYPE_PEM) verboseParameters << "PEM" << OFendl; else verboseParameters << "DER" << OFendl;
-      verboseParameters << "  TLS cert verify : ";
-      switch (tlsCertVerification)
-      {
-          case DCV_checkCertificate:
-            verboseParameters << "verify" << OFendl;
-            break;
-          case DCV_ignoreCertificate:
-            verboseParameters << "ignore" << OFendl;
-            break;
-          default:
-            verboseParameters << "require" << OFendl;
-            break;
-      }
-    }
-#endif
-
-    verboseParameters << OFStringStream_ends;
-    OFSTRINGSTREAM_GETSTR(verboseParameters, verboseParametersString)
-    OFLOG_INFO(dcmpsrcvLogger, verboseParametersString);
-
     /* check if we can get access to the database */
     const char *dbfolder = dvi.getDatabaseFolder();
 
@@ -1184,13 +1117,41 @@ int main(int argc, char *argv[])
     DcmTLSTransportLayer *tLayer = NULL;
     if (useTLS)
     {
-      tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_ACCEPTOR, tlsRandomSeedFile.c_str());
+      tLayer = new DcmTLSTransportLayer(NET_ACCEPTOR, tlsRandomSeedFile.c_str(), OFFalse);
       if (tLayer == NULL)
       {
         OFLOG_FATAL(dcmpsrcvLogger, "unable to create TLS transport layer");
         return 1;
       }
 
+      // determine TLS profile
+      OFString profileName;
+      const char *profileNamePtr = dvi.getTargetTLSProfile(opt_cfgID);
+      if (profileNamePtr) profileName = profileNamePtr;
+      DcmTLSSecurityProfile tlsProfile = TSP_Profile_BCP195;  // default
+      if (profileName == "BCP195") tlsProfile = TSP_Profile_BCP195;
+      else if (profileName == "BCP195-ND") tlsProfile = TSP_Profile_BCP195_ND;
+      else if (profileName == "AES") tlsProfile = TSP_Profile_AES;
+      else if (profileName == "BASIC") tlsProfile = TSP_Profile_Basic;
+      else if (profileName == "NULL") tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted;
+      else
+      {
+        OFLOG_WARN(dcmpsrcvLogger, "unknown TLS profile '" << profileName << "', ignoring");
+      }
+
+      if (TCS_ok != tLayer->setTLSProfile(tlsProfile))
+      {
+        OFLOG_FATAL(dcmpsrcvLogger, "unable to select the TLS security profile");
+        return 1;
+      }
+
+      // activate cipher suites
+      if (TCS_ok != tLayer->activateCipherSuites())
+      {
+        OFLOG_FATAL(dcmpsrcvLogger, "unable to activate the selected list of TLS ciphersuites");
+        return 1;
+      }
+
       if (tlsCACertificateFolder && (TCS_ok != tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat)))
       {
         OFLOG_WARN(dcmpsrcvLogger, "unable to load certificates from directory '" << tlsCACertificateFolder << "', ignoring");
@@ -1216,18 +1177,43 @@ int main(int argc, char *argv[])
         OFLOG_FATAL(dcmpsrcvLogger, "private key '" << tlsPrivateKeyFile << "' and certificate '" << tlsCertificateFile << "' do not match");
         return 1;
       }
-      if (TCS_ok != tLayer->setCipherSuites(tlsCiphersuites.c_str()))
-      {
-        OFLOG_FATAL(dcmpsrcvLogger, "unable to set selected cipher suites");
-        return 1;
-      }
 
       tLayer->setCertificateVerification(tlsCertVerification);
 
     }
 
+    if (useTLS)
+    {
+      OFString cslist;
+      if (tLayer) tLayer->getListOfCipherSuitesForOpenSSL(cslist);
+      verboseParameters << "  TLS certificate : " << tlsCertificateFile << OFendl
+           << "  TLS key file    : " << tlsPrivateKeyFile << OFendl
+           << "  TLS DH params   : " << tlsDHParametersFile << OFendl
+           << "  TLS PRNG seed   : " << tlsRandomSeedFile << OFendl
+           << "  TLS CA directory: " << tlsCACertificateFolder << OFendl
+           << "  TLS ciphersuites: " << cslist << OFendl
+           << "  TLS key format  : ";
+      if (keyFileFormat == DCF_Filetype_PEM) verboseParameters << "PEM" << OFendl; else verboseParameters << "DER" << OFendl;
+      verboseParameters << "  TLS cert verify : ";
+      switch (tlsCertVerification)
+      {
+          case DCV_checkCertificate:
+            verboseParameters << "verify" << OFendl;
+            break;
+          case DCV_ignoreCertificate:
+            verboseParameters << "ignore" << OFendl;
+            break;
+          default:
+            verboseParameters << "require" << OFendl;
+            break;
+      }
+    }
 #endif
 
+    verboseParameters << OFStringStream_ends;
+    OFSTRINGSTREAM_GETSTR(verboseParameters, verboseParametersString)
+    OFLOG_INFO(dcmpsrcvLogger, verboseParametersString);
+
     while (!finished1)
     {
       /* open listen socket */
index 94b835a81a238575257fcafa4dc419343ae56b2c..009381b1a9e5df509a4d2b1df726486b35950f4f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1999-2017, OFFIS e.V.
+ *  Copyright (C) 1999-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -42,6 +42,7 @@ END_EXTERN_C
 #include "dcmtk/dcmnet/diutil.h"
 #include "dcmtk/dcmdata/cmdlnarg.h"
 #include "dcmtk/ofstd/ofconapp.h"
+#include "dcmtk/ofstd/ofstd.h"
 #include "dcmtk/dcmpstat/dvpshlp.h"     /* for class DVPSHelper */
 #include "dcmtk/dcmqrdb/dcmqrdbi.h"     /* for LOCK_IMAGE_FILES */
 #include "dcmtk/dcmqrdb/dcmqrdbs.h"     /* for DcmQueryRetrieveDatabaseStatus */
@@ -121,8 +122,9 @@ static OFCondition sendImage(T_ASC_Association *assoc, const char *sopClass, con
     /* start store */
     OFBitmanipTemplate<char>::zeroMem((char *)&req, sizeof(req));
     req.MessageID = assoc->nextMsgID++;
-    strcpy(req.AffectedSOPClassUID, sopClass);
-    strcpy(req.AffectedSOPInstanceUID, sopInstance);
+
+    OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, sizeof(req.AffectedSOPClassUID));
+    OFStandard::strlcpy(req.AffectedSOPInstanceUID, sopInstance, sizeof(req.AffectedSOPInstanceUID));
     req.DataSetType = DIMSE_DATASET_PRESENT;
     req.Priority = DIMSE_PRIORITY_MEDIUM;
 
@@ -249,7 +251,7 @@ static OFCondition sendStudy(
 
     while (dbStatus.status() == STATUS_Pending)
     {
-      cond = handle.nextMoveResponse(sopClass, sopInstance, imgFile, &nRemaining, &dbStatus);
+      cond = handle.nextMoveResponse(sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), imgFile, sizeof(imgFile), &nRemaining, &dbStatus);
       if (cond.bad()) return cond;
 
       if (dbStatus.status() == STATUS_Pending)
@@ -321,6 +323,9 @@ static OFCondition addAllStoragePresentationContexts(T_ASC_Parameters *params, i
 int main(int argc, char *argv[])
 {
     OFStandard::initializeNetwork();
+#ifdef WITH_OPENSSL
+    DcmTLSTransportLayer::initializeOpenSSL();
+#endif
 
     OFString temp_str;
 
@@ -366,7 +371,7 @@ int main(int argc, char *argv[])
             COUT << "- ZLIB, Version " << zlibVersion() << OFendl;
 #endif
 #ifdef WITH_OPENSSL
-            COUT << "- " << OPENSSL_VERSION_TEXT << OFendl;
+            COUT << "- " << DcmTLSTransportLayer::getOpenSSLVersionName() << OFendl;
 #endif
             return 0;
          }
@@ -480,39 +485,9 @@ int main(int argc, char *argv[])
     if (tlsCACertificateFolder==NULL) tlsCACertificateFolder = ".";
 
     /* key file format */
-    int keyFileFormat = SSL_FILETYPE_PEM;
-    if (! dvi.getTLSPEMFormat()) keyFileFormat = SSL_FILETYPE_ASN1;
+    DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM;
+    if (! dvi.getTLSPEMFormat()) keyFileFormat = DCF_Filetype_ASN1;
 
-    /* ciphersuites */
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-    OFString tlsCiphersuites(TLS1_TXT_RSA_WITH_AES_128_SHA ":" SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#else
-    OFString tlsCiphersuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#endif
-    Uint32 tlsNumberOfCiphersuites = dvi.getTargetNumberOfCipherSuites(opt_target);
-    if (tlsNumberOfCiphersuites > 0)
-    {
-      tlsCiphersuites.clear();
-      OFString currentSuite;
-      const char *currentOpenSSL;
-      for (Uint32 ui=0; ui<tlsNumberOfCiphersuites; ui++)
-      {
-        dvi.getTargetCipherSuite(opt_target, ui, currentSuite);
-        if (NULL == (currentOpenSSL = DcmTLSTransportLayer::findOpenSSLCipherSuiteName(currentSuite.c_str())))
-        {
-          OFLOG_FATAL(dcmpssndLogger, "ciphersuite '" << currentSuite << "' is unknown. Known ciphersuites are:");
-          unsigned long numSuites = DcmTLSTransportLayer::getNumberOfCipherSuites();
-          for (unsigned long cs=0; cs < numSuites; cs++)
-          {
-            OFLOG_FATAL(dcmpssndLogger, "    " << DcmTLSTransportLayer::getTLSCipherSuiteName(cs));
-          }
-          return 1;
-        } else {
-          if (!tlsCiphersuites.empty()) tlsCiphersuites += ":";
-          tlsCiphersuites += currentOpenSSL;
-        }
-      }
-    }
 #else
     if (useTLS)
     {
@@ -573,37 +548,6 @@ int main(int argc, char *argv[])
     verboseParameters << "\tTLS             : ";
     if (useTLS) verboseParameters << "enabled" << OFendl; else verboseParameters << "disabled" << OFendl;
 
-#ifdef WITH_OPENSSL
-    if (useTLS)
-    {
-      verboseParameters << "\tTLS certificate : " << tlsCertificateFile << OFendl
-           << "\tTLS key file    : " << tlsPrivateKeyFile << OFendl
-           << "\tTLS DH params   : " << tlsDHParametersFile << OFendl
-           << "\tTLS PRNG seed   : " << tlsRandomSeedFile << OFendl
-           << "\tTLS CA directory: " << tlsCACertificateFolder << OFendl
-           << "\tTLS ciphersuites: " << tlsCiphersuites << OFendl
-           << "\tTLS key format  : ";
-      if (keyFileFormat == SSL_FILETYPE_PEM) verboseParameters << "PEM" << OFendl; else verboseParameters << "DER" << OFendl;
-      verboseParameters << "\tTLS cert verify : ";
-      switch (tlsCertVerification)
-      {
-          case DCV_checkCertificate:
-            verboseParameters << "verify" << OFendl;
-            break;
-          case DCV_ignoreCertificate:
-            verboseParameters << "ignore" << OFendl;
-            break;
-          default:
-            verboseParameters << "require" << OFendl;
-            break;
-      }
-    }
-#endif
-
-    verboseParameters << OFStringStream_ends;
-    OFSTRINGSTREAM_GETOFSTRING(verboseParameters, verboseParametersString)
-    OFLOG_INFO(dcmpssndLogger, verboseParametersString);
-
     /* open database */
     const char *dbfolder = dvi.getDatabaseFolder();
 
@@ -622,13 +566,41 @@ int main(int argc, char *argv[])
     DcmTLSTransportLayer *tLayer = NULL;
     if (useTLS)
     {
-      tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_REQUESTOR, tlsRandomSeedFile.c_str());
+      tLayer = new DcmTLSTransportLayer(NET_REQUESTOR, tlsRandomSeedFile.c_str(), OFFalse);
       if (tLayer == NULL)
       {
         OFLOG_FATAL(dcmpssndLogger, "unable to create TLS transport layer");
         return 1;
       }
 
+      // determine TLS profile
+      OFString profileName;
+      const char *profileNamePtr = dvi.getTargetTLSProfile(opt_target);
+      if (profileNamePtr) profileName = profileNamePtr;
+      DcmTLSSecurityProfile tlsProfile = TSP_Profile_BCP195;  // default
+      if (profileName == "BCP195") tlsProfile = TSP_Profile_BCP195;
+      else if (profileName == "BCP195-ND") tlsProfile = TSP_Profile_BCP195_ND;
+      else if (profileName == "AES") tlsProfile = TSP_Profile_AES;
+      else if (profileName == "BASIC") tlsProfile = TSP_Profile_Basic;
+      else if (profileName == "NULL") tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted;
+      else
+      {
+        OFLOG_WARN(dcmpssndLogger, "unknown TLS profile '" << profileName << "', ignoring");
+      }
+
+      if (TCS_ok != tLayer->setTLSProfile(tlsProfile))
+      {
+        OFLOG_FATAL(dcmpssndLogger, "unable to select the TLS security profile");
+        return 1;
+      }
+
+      // activate cipher suites
+      if (TCS_ok != tLayer->activateCipherSuites())
+      {
+        OFLOG_FATAL(dcmpssndLogger, "unable to activate the selected list of TLS ciphersuites");
+        return 1;
+      }
+
       if (tlsCACertificateFolder && (TCS_ok != tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat)))
       {
         OFLOG_WARN(dcmpssndLogger, "unable to load certificates from directory '" << tlsCACertificateFolder << "', ignoring");
@@ -657,11 +629,6 @@ int main(int argc, char *argv[])
           return 1;
         }
       }
-      if (TCS_ok != tLayer->setCipherSuites(tlsCiphersuites.c_str()))
-      {
-        OFLOG_FATAL(dcmpssndLogger, "unable to set selected cipher suites");
-        return 1;
-      }
 
       tLayer->setCertificateVerification(tlsCertVerification);
 
@@ -672,8 +639,38 @@ int main(int argc, char *argv[])
       tLayer->addPRNGseed(randomUID, strlen(randomUID));
     }
 
+    if (useTLS)
+    {
+      OFString cslist;
+      if (tLayer) tLayer->getListOfCipherSuitesForOpenSSL(cslist);
+      verboseParameters << "\tTLS certificate : " << tlsCertificateFile << OFendl
+           << "\tTLS key file    : " << tlsPrivateKeyFile << OFendl
+           << "\tTLS DH params   : " << tlsDHParametersFile << OFendl
+           << "\tTLS PRNG seed   : " << tlsRandomSeedFile << OFendl
+           << "\tTLS CA directory: " << tlsCACertificateFolder << OFendl
+           << "\tTLS ciphersuites: " << cslist << OFendl
+           << "\tTLS key format  : ";
+      if (keyFileFormat == DCF_Filetype_PEM) verboseParameters << "PEM" << OFendl; else verboseParameters << "DER" << OFendl;
+      verboseParameters << "\tTLS cert verify : ";
+      switch (tlsCertVerification)
+      {
+          case DCV_checkCertificate:
+            verboseParameters << "verify" << OFendl;
+            break;
+          case DCV_ignoreCertificate:
+            verboseParameters << "ignore" << OFendl;
+            break;
+          default:
+            verboseParameters << "require" << OFendl;
+            break;
+      }
+    }
 #endif
 
+    verboseParameters << OFStringStream_ends;
+    OFSTRINGSTREAM_GETOFSTRING(verboseParameters, verboseParametersString)
+    OFLOG_INFO(dcmpssndLogger, verboseParametersString);
+
     /* open network connection */
     T_ASC_Network *net=NULL;
     T_ASC_Parameters *params=NULL;
index 216158d6f64645e8e5fbcf014cf3fe247064b3e5..9a10736aec4486c088155d1cc833e3673fbd76e6 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES philips.lut DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data)
+install(FILES philips.lut DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data)
index d48c648038a0f8c1082b9e27daf0962c17d27645..9f4bd0b12c0e9139ba0c9d2e3a726d3853f4f241 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES dcmpstat.cfg printers.cfg DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/dcmtk" COMPONENT etc)
+install(FILES dcmpstat.cfg printers.cfg DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/dcmtk" COMPONENT etc)
index 2c0eb2b856c724382819eb620097588d1ccf8427..3ed834aeb7b3e8ba0d9da010dd69ddd8fd682d0b 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 1998-2010, OFFIS e.V.
+#  Copyright (C) 1998-2018, OFFIS e.V.
 #  All rights reserved.  See COPYRIGHT file for details.
 #
 #  This software and supporting documentation were developed by
@@ -295,7 +295,7 @@ AutoUpdateStudyBrowser = true
 # Default: If HighResolutionGraphics, the default is 30 otherwise 12
 #FontSize = 30
 
-# Sets the name of the fonts uesed in all GUI components
+# Sets the name of the fonts used in all GUI components
 # Default value: SansSerif
 #FontName = SansSerif
 
@@ -311,7 +311,7 @@ AutoUpdateStudyBrowser = true
 # Default: If HighResolutionGraphics, the default is 30 otherwise 12
 #FontSizeLog = 30
 
-# Sets the name of the fonts uesed for the process log
+# Sets the name of the fonts used for the process log
 # Default value: Monospaced
 #FontNameLog = Monospaced
 
@@ -324,7 +324,7 @@ AutoUpdateStudyBrowser = true
 # Default: If HighResolutionGraphics, the default is East otherwise South
 #FunctionPanelPlacement = East
 
-# Sets the placement of the paint functio panel in the viewer.
+# Sets the placement of the paint function panel in the viewer.
 # Valid values are: North, South, East, West, None, Toolbar, Integrated
 # Default value: Integrated
 #PaintPanelPlacement = Integrated
@@ -507,17 +507,27 @@ WarnUnsignedObjectsInSR = true
 #
 # ----------------------------------------------------------------------------
 #
-# Negotiate the following TLS ciphersuites when using TLS transmission.
-# Ciphersuite names should have the format as defined in RFC 2246, e. g.:
-#   TLS_RSA_WITH_RC4_128_SHA
-#   TLS_RSA_WITH_IDEA_CBC_SHA
-#   TLS_RSA_WITH_DES_CBC_SHA
-#   TLS_RSA_WITH_3DES_EDE_CBC_SHA
-# See the DCMTK documentation dcmtls/docs/ciphers.txt for a complete list of
-# supported terms. Multiple terms should be separated by backslash characters.
-# Optional setting, default is: TLS_RSA_WITH_3DES_EDE_CBC_SHA.
+# Select the following security profile when using TLS connections.
+# Known terms are:
+#   BCP195:     BCP 195 TLS Profile (default)
+#   BCP195-ND:  Non-downgrading BCP 195 TLS Profile
+#   AES:        AES TLS Secure Transport Connection Profile (retired)
+#   BASIC:      Basic TLS Secure Transport Connection Profile (retired)
+#   NULL:        Authenticated unencrypted communication (retired)
 #
-# CipherSuites = TLS_RSA_WITH_IDEA_CBC_SHA\TLS_RSA_WITH_3DES_EDE_CBC_SHA
+# TLSProfile = BCP195
+#
+# Note 1: The direct configuration of a list of ciphersuites using the
+# "CipherSuites" configuration setting is not supported anymore;
+# this setting will be ignored.
+#
+# Note 2: The BCP195 profile, which is the default, provides backwards
+# compatibility with older implementations only supporting the AES or
+# BASIC profile.
+#
+# Note 3: The BASIC profile requires 3DES to be enabled in the OpenSSL
+# library that DCMTK is compiled with. Starting with OpenSSL 1.1.0, this
+# has to be manually enabled at compile time.
 #
 # ----------------------------------------------------------------------------
 #
@@ -533,11 +543,10 @@ WarnUnsignedObjectsInSR = true
 # ----------------------------------------------------------------------------
 #
 # File containing a set of random-generated Diffie-Hellman parameters
-# as required for DH/DSS ciphersuites (but not for RSA ciphersuites).
+# as required for DH[E]/DSS ciphersuites.
 # File should be located in the directory specified by GENERAL/TLS/TLSDIRECTORY
 # in the format specified by GENERAL/TLS/USEPEMFORMAT.
-# Optional setting, default is: no Diffie-Hellman parameters (which will cause
-# TLS connection setup for DH/DSS ciphersuites to fail).
+# Optional setting, default is: used built-in set of DH parameters.
 #
 # DiffieHellmanParameters = dhparams.pem
 #
@@ -737,7 +746,7 @@ WarnUnsignedObjectsInSR = true
 # use printer default.
 # Print SCP usage: The first specified value is used as the default. This
 # is an optional entry. If omitted, the Print SCP does not support the
-# attribute and rejects N-CREATE or N-SET requests containing the attribtute.
+# attribute and rejects N-CREATE or N-SET requests containing the attribute.
 #
 # ResolutionID = STANDARD\HIGH
 #
@@ -764,7 +773,7 @@ WarnUnsignedObjectsInSR = true
 # use printer default.
 # Print SCP usage: The first specified value is used as the default. This
 # is an optional entry. If omitted, the Print SCP does not support the
-# attribute and rejects N-CREATE or N-SET requests containing the attribtute.
+# attribute and rejects N-CREATE or N-SET requests containing the attribute.
 #
 # SmoothingType = NONE
 #
@@ -866,7 +875,7 @@ WarnUnsignedObjectsInSR = true
 # configuration information.
 # Print SCP usage: These are optional settings. If omitted, the Print
 # SCP does not support the attribute and rejects N-CREATE or N-SET requests
-# containing the attribtute. The Print SCP default for Configuration
+# containing the attribute. The Print SCP default for Configuration
 # Information is always an empty string.
 #
 # Configuration_1 = Configuration Value 1
@@ -935,7 +944,7 @@ Port = 10007
 ImplicitOnly  = false
 DisableNewVRs = false
 UseTLS = true
-CipherSuites = TLS_RSA_WITH_NULL_SHA
+TLSProfile = NULL
 RandomSeed = store2.rnd
 PeerAuthentication = REQUIRE
 Certificate = sitecert.pem
@@ -946,14 +955,14 @@ PrivateKey = sitekey.pem
 # ----------------------------------------------------------------------------
 Type = STORAGE
 Aetitle = STORESCP
-Description = Hostname, TLS transmission, 3DES encryption
+Description = Hostname, TLS transmission, with encryption
 Hostname = Hostname
 MaxPDU = 32768
 Port = 10007
 ImplicitOnly  = false
 DisableNewVRs = false
 UseTLS = true
-CipherSuites = TLS_RSA_WITH_3DES_EDE_CBC_SHA
+TLSProfile = BCP195
 RandomSeed = store3.rnd
 PeerAuthentication = REQUIRE
 Certificate = sitecert.pem
@@ -983,8 +992,7 @@ BitPreservingMode = false
 
 # ----------------------------------------------------------------------------
 [RECEIVE_2]
-# We accept TLS_RSA_WITH_3DES_EDE_CBC_SHA and TLS_RSA_WITH_NULL_SHA
-# connections, default is 3DES. We require that the client authenticates
+# We use the BCP 195 TLS profile. We require that the client authenticates
 # with a certificate issued by a Certification Authority that we trust.
 # ----------------------------------------------------------------------------
 Type = RECEIVER
@@ -997,7 +1005,7 @@ ImplicitOnly  = false
 DisableNewVRs = false
 BitPreservingMode = false
 UseTLS = true
-CipherSuites = TLS_RSA_WITH_3DES_EDE_CBC_SHA\TLS_RSA_WITH_NULL_SHA
+TLSProfile = BCP195
 RandomSeed = receiver.rnd
 PeerAuthentication = REQUIRE
 Certificate = sitecert.pem
@@ -1117,7 +1125,7 @@ SupportsTrim = true
 
 # TLS settings
 UseTLS = true
-CipherSuites = TLS_RSA_WITH_3DES_EDE_CBC_SHA\TLS_RSA_WITH_NULL_SHA
+TLSProfile = BCP195
 RandomSeed = iheprt1.rnd
 PeerAuthentication = REQUIRE
 Certificate = sitecert.pem
@@ -1156,7 +1164,7 @@ SupportsPresentationLUT = true
 
 # TLS settings
 UseTLS = true
-CipherSuites = TLS_RSA_WITH_3DES_EDE_CBC_SHA\TLS_RSA_WITH_NULL_SHA
+TLSProfile = BCP195
 RandomSeed = iheprt2.rnd
 PeerAuthentication = REQUIRE
 Certificate = sitecert.pem
index 1486da529a69fdef0b196646a6df46ec6268936f..65dec8ccaa8386ce0c22323499af8126e7552cad 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 1998-2010, OFFIS e.V.
+#  Copyright (C) 1998-2018, OFFIS e.V.
 #  All rights reserved.  See COPYRIGHT file for details.
 #
 #  This software and supporting documentation were developed by
@@ -373,7 +373,7 @@ SupportsTrim = true
 
 # TLS settings
 UseTLS = true
-CipherSuites = TLS_RSA_WITH_3DES_EDE_CBC_SHA\TLS_RSA_WITH_NULL_SHA
+TLSProfile = BCP195
 RandomSeed = iheprt1.rnd
 PeerAuthentication = REQUIRE
 Certificate = sitecert.pem
@@ -412,7 +412,7 @@ SupportsPresentationLUT = true
 
 # TLS settings
 UseTLS = true
-CipherSuites = TLS_RSA_WITH_3DES_EDE_CBC_SHA\TLS_RSA_WITH_NULL_SHA
+TLSProfile = BCP195
 RandomSeed = iheprt2.rnd
 PeerAuthentication = REQUIRE
 Certificate = sitecert.pem
index ee3b58ca33a6e47b24030a7baaee5fef2fbd91da..9bf65f67370ee9f31caadae5b6530aed768ac134 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmpstat DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmpstat DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 9f6f03ba6381bd7ef84ddb3c6ad86eab873313a6..4dc1c8114825149afec3923bf8ef5a0abafc3c03 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2012, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -1441,8 +1441,8 @@ class DCMTK_DCMPSTAT_EXPORT DVInterface: public DVConfiguration
      *  to load and decrypt the private key for the given user with the
      *  given password. If this fails, the password verification fails,
      *  otherwise the password verification succeeds.
-     *  This method requires that DCMTK be configured and compiled with
-     *  the WITH_OPENSSL flag, otherwise always returns false.
+     *  @remark this method is only functional if DCMTK is compiled with
+     *  OpenSSL support enabled. Otherwise it always returns false.
      *  @param userID symbolic user ID for given user, as returned by
      *    DVConfiguration::getUserID()
      *  @param passwd for user as entered in some GUI control
@@ -1460,9 +1460,9 @@ class DCMTK_DCMPSTAT_EXPORT DVInterface: public DVConfiguration
      *  before the object is stored in the database or a file. Otherwise the digital signature
      *  would be corrupted. Therefore, the SOP instance UID should be generated before calling
      *  this method.
-     *  To digitally sign the report it is required that DCMTK is configured and compiled
-     *  with the WITH_OPENSSL flag, otherwise only verification is available (returns an
-     *  error code if mode differs from DVPSY_verify).
+     *  @remark this method only has full functionality if DCMTK is compiled with
+     *  OpenSSL support enabled. If not, only mode DVPSY_verify (verification)
+     *  is available and an error is returned for any other mode.
      *  @param userID symbolic user ID for given user, as returned by
      *    DVConfiguration::getUserID()
      *  @param passwd for user as entered in some GUI control
index 818f8d1163fbe25bf2fbf8c8d16ec044238ded54..028fe0d795a1ee57396abdeb76a69e1a4ae5c4ab 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2012, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -191,24 +191,13 @@ class DCMTK_DCMPSTAT_EXPORT DVConfiguration
    */
   const char *getTargetPrivateKeyPassword(const char *targetID);
 
-  /** returns the number of distinct values (separated by backslash characters)
-   *  in the CIPHERSUITES entry for the storage peer with the given
+  /** returns the TLSPROFILE entry for the storage peer with the given
    *  target ID from the configuration file.
    *  @param targetID communication target ID, must be one of the target
    *    identifiers returned by getTargetID().
-   *  @return number of values if entry present in the config file, 0 otherwise.
-   */
-  Uint32 getTargetNumberOfCipherSuites(const char *targetID);
-
-  /** returns one value from the CIPHERSUITES entry for the storage peer
-   *  with the given target ID from the configuration file.
-   *  @param targetID communication target ID, must be one of the target
-   *    identifiers returned by getTargetID().
-   *  @param idx index of the value, must be < getTargetNumberOfCipherSuites(targetID)
-   *  @param value the result is both stored in this object and returned as return value.
-   *  @return value if present, NULL otherwise.
+   *  @return entry if present in the config file, NULL otherwise.
    */
-  const char *getTargetCipherSuite(const char *targetID, Uint32 idx, OFString& value);
+  const char *getTargetTLSProfile(const char *targetID);
 
   /** returns the PEERAUTHENTICATION entry for the communication partner with the given
    *  target ID from the configuration file.
index fc16b69c10cc7540e8971dc532ce96ff3efc5947..799777d6853726fede04b10c7e9b63b6c18a0ae8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2012, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -153,25 +153,25 @@ if (result==EC_Normal)                                              \
 }
 
 // reads a dicom element from a dataset if present
-#define READ_FROM_DATASET(a_type, a_name)                           \
+#define READ_FROM_DATASET(a_type, an_ident, a_name)                 \
 stack.clear();                                                      \
-if (EC_Normal == dset.search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) \
+if ((EC_Normal == dset.search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == an_ident)) \
 {                                                                   \
   a_name = *((a_type *)(stack.top()));                              \
 }
 
 // reads a dicom element from an item if present
-#define READ_FROM_DATASET2(a_type, a_name)                          \
+#define READ_FROM_DATASET2(a_type, an_ident, a_name)                \
 stack.clear();                                                      \
-if (EC_Normal == item->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) \
+if ((EC_Normal == item->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == an_ident)) \
 {                                                                   \
   a_name = *((a_type *)(stack.top()));                              \
 }
 
 // reads a dicom element from an item if present
-#define READ_FROM_PDATASET(a_type, a_name)                          \
+#define READ_FROM_PDATASET(a_type, an_ident, a_name)                \
 stack.clear();                                                      \
-if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse))) \
+if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)a_name.getTag(), stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == an_ident)) \
 {                                                                   \
   a_name = *((a_type *)(stack.top()));                              \
 }
index f1b338af3e8d98382358828a6842adb061888be0..c27232290c5cf55f97ff46c193835bbedb6a7bd7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2012, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -137,7 +137,7 @@ private:
   /** resize payload if necessary such that at least i bytes can be written
    *  @param i number of bytes required in buffer
    */
-  void resizePayload(Uint32 i);
+  void resizePayload(size_t i);
 
   /// type of message
   Uint32 messageType;
index cc4138ff112354269cb4fe1fc2f9b912f12ba60d..b4c39071f39c935a24a9d1a9013938a43d532f3b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2001-2012, OFFIS e.V.
+ *  Copyright (C) 2001-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -68,8 +68,9 @@ public:
   const char *getCurrentSignatureValidationOverview() const;
 
   /** updates the digital signature information for the given object type.
-   *  If compiled without WITH_OPENSSL, always reports that no signatures
-   *  were found in the object.
+   *  @remark This class is only functional if DCMTK is compiled with
+   *  OpenSSL support enabled. If compiled without, it always reports
+   *  that no signatures were found in the object.
    *  @param dataset dataset to be checked for digital signatures
    *  @param objtype object type of dataset
    *  @param onRead true if the dataset is just being read, false if it is being written
@@ -121,7 +122,8 @@ public:
    *  is signed by a digital signature on the dataset level, or if any
    *  of the attributes is a sequence that contains one or more signatures
    *  in its items.  Otherwise returns false.
-   *  If compiled without WITH_OPENSSL, always returns false.
+   *  @remark this method is only functional if DCMTK is compiled with
+   *  OpenSSL support enabled. Otherwise it always returns false.
    *  @param item item or dataset to be tested
    *  @param tagList list of attributes (tags) to be looked up inside the dataset
    *  @return true if any of the given attributes is affected by a digital signature,
@@ -214,6 +216,9 @@ private:
 
 #ifdef WITH_OPENSSL  
   /// the certificate verifier, available only if compiled with OpenSSL support
+  /// @remark This member is only available if DCMTK is compiled with
+  /// OpenSSL support enabled.
+
   SiCertificateVerifier certVerifier;  
 #endif
 
index 7ef955eab4d857cf179af539affa6623beb2a815..a3cd6ef518400498161a421f6df3804199f746bb 100644 (file)
@@ -36,6 +36,7 @@ dcmpstat.o: dcmpstat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -45,6 +46,7 @@ dcmpstat.o: dcmpstat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -166,6 +168,7 @@ dviface.o: dviface.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -175,6 +178,7 @@ dviface.o: dviface.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \
@@ -317,7 +321,6 @@ dviface.o: dviface.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../../dcmsr/include/dcmtk/dcmsr/dsrdoctn.h \
  ../../dcmsr/include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../dcmsr/include/dcmtk/dcmsr/dsrdncsr.h \
  ../../dcmsr/include/dcmtk/dcmsr/dsrdnflt.h \
  ../../dcmsr/include/dcmtk/dcmsr/dsritcsr.h \
@@ -360,7 +363,8 @@ dviface.o: dviface.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \
  ../../dcmtls/include/dcmtk/dcmtls/tlsdefin.h \
- ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h
+ ../../dcmtls/include/dcmtk/dcmtls/tlslayer.h \
+ ../../dcmtls/include/dcmtk/dcmtls/tlsciphr.h
 dvpsab.o: dvpsab.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -408,8 +412,10 @@ dvpsab.o: dvpsab.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -477,8 +483,10 @@ dvpsabl.o: dvpsabl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -545,8 +553,10 @@ dvpsal.o: dvpsal.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -605,8 +615,10 @@ dvpsall.o: dvpsall.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -716,6 +728,7 @@ dvpscf.o: dvpscf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -725,6 +738,7 @@ dvpscf.o: dvpscf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmpstat/dvpstyp.h ../include/dcmtk/dcmpstat/dpdefine.h \
@@ -769,6 +783,7 @@ dvpscu.o: dvpscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -778,6 +793,7 @@ dvpscu.o: dvpscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
@@ -893,8 +909,10 @@ dvpscul.o: dvpscul.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -916,6 +934,13 @@ dvpsda.o: dvpsda.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../include/dcmtk/dcmpstat/dvpsda.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
@@ -932,7 +957,6 @@ dvpsda.o: dvpsda.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
  ../../ofstd/include/dcmtk/ofstd/ofutil.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../../oflog/include/dcmtk/oflog/layout.h \
  ../../oflog/include/dcmtk/oflog/streams.h \
@@ -946,15 +970,11 @@ dvpsda.o: dvpsda.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
- ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
- ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../../ofstd/include/dcmtk/ofstd/oflimits.h \
- ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -1073,8 +1093,10 @@ dvpsdal.o: dvpsdal.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1184,6 +1206,7 @@ dvpsfs.o: dvpsfs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1193,6 +1216,7 @@ dvpsfs.o: dvpsfs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -1332,6 +1356,7 @@ dvpsga.o: dvpsga.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1341,6 +1366,7 @@ dvpsga.o: dvpsga.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
@@ -1459,8 +1485,10 @@ dvpsgal.o: dvpsgal.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1572,6 +1600,7 @@ dvpsgl.o: dvpsgl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1581,6 +1610,7 @@ dvpsgl.o: dvpsgl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -1695,8 +1725,10 @@ dvpsgll.o: dvpsgll.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -1810,6 +1842,7 @@ dvpsgr.o: dvpsgr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1819,6 +1852,7 @@ dvpsgr.o: dvpsgr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -1934,8 +1968,10 @@ dvpsgrl.o: dvpsgrl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2058,7 +2094,9 @@ dvpshlp.o: dvpshlp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2171,8 +2209,10 @@ dvpsib.o: dvpsib.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2302,8 +2342,10 @@ dvpsibl.o: dvpsibl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2426,6 +2468,7 @@ dvpsmsg.o: dvpsmsg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2435,6 +2478,7 @@ dvpsmsg.o: dvpsmsg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -2483,6 +2527,7 @@ dvpsov.o: dvpsov.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -2492,6 +2537,7 @@ dvpsov.o: dvpsov.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -2606,8 +2652,10 @@ dvpsovl.o: dvpsovl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -2677,24 +2725,31 @@ dvpsovl.o: dvpsovl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
-dvpspl2.o: dvpspl2.cc ../../config/include/dcmtk/config/osconfig.h \
+dvpspl.o: dvpspl.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/dcmpstat/dvpspl.h ../include/dcmtk/dcmpstat/dvpstyp.h \
- ../include/dcmtk/dcmpstat/dpdefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -2710,7 +2765,6 @@ dvpspl2.o: dvpspl2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
  ../../ofstd/include/dcmtk/ofstd/ofutil.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../../oflog/include/dcmtk/oflog/layout.h \
  ../../oflog/include/dcmtk/oflog/streams.h \
@@ -2724,42 +2778,21 @@ dvpspl2.o: dvpspl2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
- ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h \
- ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oflimits.h \
- ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \
+ ../include/dcmtk/dcmpstat/dvpspl.h ../include/dcmtk/dcmpstat/dvpstyp.h \
+ ../include/dcmtk/dcmpstat/dpdefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
- ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \
- ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \
  ../include/dcmtk/dcmpstat/dvpsdef.h \
  ../../dcmnet/include/dcmtk/dcmnet/dimse.h \
  ../../dcmnet/include/dcmtk/dcmnet/dicom.h \
@@ -2774,32 +2807,27 @@ dvpspl2.o: dvpspl2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \
  ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \
  ../../dcmnet/include/dcmtk/dcmnet/assoc.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h
-dvpspl.o: dvpspl.cc ../../config/include/dcmtk/config/osconfig.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h
+dvpspl2.o: dvpspl2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h \
- ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oflist.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../../ofstd/include/dcmtk/ofstd/oflimits.h \
- ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../include/dcmtk/dcmpstat/dvpspl.h ../include/dcmtk/dcmpstat/dvpstyp.h \
+ ../include/dcmtk/dcmpstat/dpdefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -2815,6 +2843,7 @@ dvpspl.o: dvpspl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
  ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../../oflog/include/dcmtk/oflog/layout.h \
  ../../oflog/include/dcmtk/oflog/streams.h \
@@ -2828,19 +2857,44 @@ dvpspl.o: dvpspl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
- ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \
- ../include/dcmtk/dcmpstat/dvpspl.h ../include/dcmtk/dcmpstat/dvpstyp.h \
- ../include/dcmtk/dcmpstat/dpdefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcvrus.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dcmimage.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dimoimg.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diimage.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcfcache.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcistrma.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diovlay.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diobjcou.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/didefine.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diovdat.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diovpln.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diutils.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dimopx.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dipixel.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dimomod.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/diluptab.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dibaslut.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/dimoopx.h \
+ ../../dcmimgle/include/dcmtk/dcmimgle/didispfn.h \
  ../include/dcmtk/dcmpstat/dvpsdef.h \
  ../../dcmnet/include/dcmtk/dcmnet/dimse.h \
  ../../dcmnet/include/dcmtk/dcmnet/dicom.h \
@@ -2855,9 +2909,7 @@ dvpspl.o: dvpspl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \
  ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \
  ../../dcmnet/include/dcmtk/dcmnet/assoc.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h
+ ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h
 dvpspll.o: dvpspll.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmpstat/dvpspll.h ../include/dcmtk/dcmpstat/dvpstyp.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
@@ -2908,11 +2960,13 @@ dvpspll.o: dvpspll.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
  ../../dcmnet/include/dcmtk/dcmnet/dul.h \
@@ -3003,6 +3057,13 @@ dvpspr.o: dvpspr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
  ../include/dcmtk/dcmpstat/dvpsdef.h ../include/dcmtk/dcmpstat/dpdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
@@ -3017,7 +3078,6 @@ dvpspr.o: dvpspr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
  ../../ofstd/include/dcmtk/ofstd/ofutil.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../../oflog/include/dcmtk/oflog/layout.h \
  ../../oflog/include/dcmtk/oflog/streams.h \
@@ -3031,15 +3091,11 @@ dvpspr.o: dvpspr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
- ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
- ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../../ofstd/include/dcmtk/ofstd/oflimits.h \
- ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmpstat/dvpspr.h \
  ../../dcmnet/include/dcmtk/dcmnet/dimse.h \
  ../../dcmnet/include/dcmtk/dcmnet/dicom.h \
@@ -3119,11 +3175,13 @@ dvpsprt.o: dvpsprt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
  ../../dcmnet/include/dcmtk/dcmnet/dul.h \
@@ -3276,8 +3334,10 @@ dvpsri.o: dvpsri.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -3346,7 +3406,9 @@ dvpsril.o: dvpsril.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -3412,8 +3474,10 @@ dvpsrs.o: dvpsrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -3485,7 +3549,9 @@ dvpsrsl.o: dvpsrsl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -3554,11 +3620,13 @@ dvpssp.o: dvpssp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
  ../../dcmnet/include/dcmtk/dcmnet/dul.h \
@@ -3718,12 +3786,14 @@ dvpsspl.o: dvpsspl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3881,7 +3951,9 @@ dvpssv.o: dvpssv.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -3956,7 +4028,9 @@ dvpssvl.o: dvpssvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
@@ -4013,6 +4087,7 @@ dvpstat.o: dvpstat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -4022,6 +4097,7 @@ dvpstat.o: dvpstat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -4161,6 +4237,7 @@ dvpstx.o: dvpstx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -4170,6 +4247,7 @@ dvpstx.o: dvpstx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -4285,8 +4363,10 @@ dvpstxl.o: dvpstxl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -4396,6 +4476,7 @@ dvpsvl.o: dvpsvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -4405,6 +4486,7 @@ dvpsvl.o: dvpsvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -4520,8 +4602,10 @@ dvpsvll.o: dvpsvll.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -4632,6 +4716,7 @@ dvpsvw.o: dvpsvw.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -4640,6 +4725,7 @@ dvpsvw.o: dvpsvw.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
@@ -4748,6 +4834,7 @@ dvpsvwl.o: dvpsvwl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -4757,6 +4844,7 @@ dvpsvwl.o: dvpsvwl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -4784,14 +4872,6 @@ dvsighdl.o: dvsighdl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmsign/include/dcmtk/dcmsign/sicertvf.h \
  ../../dcmsign/include/dcmtk/dcmsign/sitypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../../dcmsign/include/dcmtk/dcmsign/sidefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
- ../../dcmsign/include/dcmtk/dcmsign/dcsignat.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -4819,6 +4899,7 @@ dvsighdl.o: dvsighdl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -4827,6 +4908,15 @@ dvsighdl.o: dvsighdl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../../dcmsign/include/dcmtk/dcmsign/sidefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
+ ../../dcmsign/include/dcmtk/dcmsign/dcsignat.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
index d1a3bd2fc8140df78d609f83da47006fdf09b16b..b98cdb6ab169af120edcbd2cfe7ac273ffba7be8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -300,8 +300,8 @@ OFCondition DcmPresentationState::read(DcmItem &dset)
   DcmUniqueIdentifier sopclassuid(DCM_SOPClassUID);
   DcmCodeString modality(DCM_Modality);
   OFString aString;
-  READ_FROM_DATASET(DcmUniqueIdentifier, sopclassuid)
-  READ_FROM_DATASET(DcmCodeString, modality)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sopclassuid)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, modality)
 
   if (sopclassuid.getLength() == 0)
   {
@@ -341,78 +341,81 @@ OFCondition DcmPresentationState::read(DcmItem &dset)
 
   if (result==EC_Normal)
   {
-    READ_FROM_DATASET(DcmPersonName, patientName)
-    READ_FROM_DATASET(DcmLongString, patientID)
-    READ_FROM_DATASET(DcmDate, patientBirthDate)
-    READ_FROM_DATASET(DcmCodeString, patientSex)
-    READ_FROM_DATASET(DcmUniqueIdentifier, studyInstanceUID)
-    READ_FROM_DATASET(DcmDate, studyDate)
-    READ_FROM_DATASET(DcmTime, studyTime)
-    READ_FROM_DATASET(DcmPersonName, referringPhysicianName)
-    READ_FROM_DATASET(DcmShortString, studyID)
-    READ_FROM_DATASET(DcmShortString, accessionNumber)
-    READ_FROM_DATASET(DcmUniqueIdentifier, seriesInstanceUID)
-    READ_FROM_DATASET(DcmIntegerString, seriesNumber)
-    READ_FROM_DATASET(DcmLongString, manufacturer)
-    READ_FROM_DATASET(DcmIntegerString, imageNumber)
-    READ_FROM_DATASET(DcmCodeString, presentationLabel)
-    READ_FROM_DATASET(DcmLongString, presentationDescription)
-    READ_FROM_DATASET(DcmDate, presentationCreationDate)
-    READ_FROM_DATASET(DcmTime, presentationCreationTime)
-    READ_FROM_DATASET(DcmPersonName, presentationCreatorsName)
-    READ_FROM_DATASET(DcmUniqueIdentifier, sOPInstanceUID)
-    READ_FROM_DATASET(DcmCodeString, specificCharacterSet)
-    READ_FROM_DATASET(DcmDate, instanceCreationDate)
-    READ_FROM_DATASET(DcmTime, instanceCreationTime)
-    READ_FROM_DATASET(DcmUniqueIdentifier, instanceCreatorUID)
-    READ_FROM_DATASET(DcmCodeString, shutterShape)
-    READ_FROM_DATASET(DcmIntegerString, shutterLeftVerticalEdge)
-    READ_FROM_DATASET(DcmIntegerString, shutterRightVerticalEdge)
-    READ_FROM_DATASET(DcmIntegerString, shutterUpperHorizontalEdge)
-    READ_FROM_DATASET(DcmIntegerString, shutterLowerHorizontalEdge)
-    READ_FROM_DATASET(DcmIntegerString, centerOfCircularShutter)
-    READ_FROM_DATASET(DcmIntegerString, radiusOfCircularShutter)
-    READ_FROM_DATASET(DcmIntegerString, verticesOfThePolygonalShutter)
-    READ_FROM_DATASET(DcmUnsignedShort, shutterPresentationValue)
-    READ_FROM_DATASET(DcmUnsignedShort, shutterOverlayGroup)
-    READ_FROM_DATASET(DcmUnsignedShort, imageRotation)
-    READ_FROM_DATASET(DcmCodeString, imageHorizontalFlip)
-    READ_FROM_DATASET(DcmDecimalString, rescaleIntercept)
-    READ_FROM_DATASET(DcmDecimalString, rescaleSlope)
-    READ_FROM_DATASET(DcmLongString, rescaleType)
+    READ_FROM_DATASET(DcmPersonName, EVR_PN, patientName)
+    READ_FROM_DATASET(DcmLongString, EVR_LO, patientID)
+    READ_FROM_DATASET(DcmDate, EVR_DA, patientBirthDate)
+    READ_FROM_DATASET(DcmCodeString, EVR_CS, patientSex)
+    READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, studyInstanceUID)
+    READ_FROM_DATASET(DcmDate, EVR_DA, studyDate)
+    READ_FROM_DATASET(DcmTime, EVR_TM, studyTime)
+    READ_FROM_DATASET(DcmPersonName, EVR_PN, referringPhysicianName)
+    READ_FROM_DATASET(DcmShortString, EVR_SH, studyID)
+    READ_FROM_DATASET(DcmShortString, EVR_SH, accessionNumber)
+    READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, seriesInstanceUID)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, seriesNumber)
+    READ_FROM_DATASET(DcmLongString, EVR_LO, manufacturer)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, imageNumber)
+    READ_FROM_DATASET(DcmCodeString, EVR_CS, presentationLabel)
+    READ_FROM_DATASET(DcmLongString, EVR_LO, presentationDescription)
+    READ_FROM_DATASET(DcmDate, EVR_DA, presentationCreationDate)
+    READ_FROM_DATASET(DcmTime, EVR_TM, presentationCreationTime)
+    READ_FROM_DATASET(DcmPersonName, EVR_PN, presentationCreatorsName)
+    READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sOPInstanceUID)
+    READ_FROM_DATASET(DcmCodeString, EVR_CS, specificCharacterSet)
+    READ_FROM_DATASET(DcmDate, EVR_DA, instanceCreationDate)
+    READ_FROM_DATASET(DcmTime, EVR_TM, instanceCreationTime)
+    READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, instanceCreatorUID)
+    READ_FROM_DATASET(DcmCodeString, EVR_CS, shutterShape)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterLeftVerticalEdge)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterRightVerticalEdge)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterUpperHorizontalEdge)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterLowerHorizontalEdge)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, centerOfCircularShutter)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, radiusOfCircularShutter)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, verticesOfThePolygonalShutter)
+    READ_FROM_DATASET(DcmUnsignedShort, EVR_US, shutterPresentationValue)
+    READ_FROM_DATASET(DcmUnsignedShort, EVR_US, shutterOverlayGroup)
+    READ_FROM_DATASET(DcmUnsignedShort, EVR_US, imageRotation)
+    READ_FROM_DATASET(DcmCodeString, EVR_CS, imageHorizontalFlip)
+    READ_FROM_DATASET(DcmDecimalString, EVR_DS, rescaleIntercept)
+    READ_FROM_DATASET(DcmDecimalString, EVR_DS, rescaleSlope)
+    READ_FROM_DATASET(DcmLongString, EVR_LO, rescaleType)
   }
 
   /* read Modality LUT Sequence */
   if (result==EC_Normal)
   {
     stack.clear();
-    if (EC_Normal == dset.search(DCM_ModalityLUTSequence, stack, ESM_fromHere, OFFalse))
+    if ((EC_Normal == dset.search(DCM_ModalityLUTSequence, stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_SQ))
     {
       seq=(DcmSequenceOfItems *)stack.top();
       if (seq->card() ==1)
       {
          item = seq->getItem(0);
          stack.clear();
-         if (EC_Normal == item->search((DcmTagKey &)modalityLUTDescriptor.getTag(),
-           stack, ESM_fromHere, OFFalse))
+         // LUTDescriptor can be US or SS. For now we only handle US.
+         if ((EC_Normal == item->search((DcmTagKey &)modalityLUTDescriptor.getTag(),
+           stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_US))
          {
            modalityLUTDescriptor = *((DcmUnsignedShort *)(stack.top()));
          }
          stack.clear();
-         if (EC_Normal == item->search((DcmTagKey &)modalityLUTExplanation.getTag(),
-           stack, ESM_fromHere, OFFalse))
+         if ((EC_Normal == item->search((DcmTagKey &)modalityLUTExplanation.getTag(),
+           stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_LO))
          {
            modalityLUTExplanation = *((DcmLongString *)(stack.top()));
          }
          stack.clear();
-         if (EC_Normal == item->search((DcmTagKey &)modalityLUTData.getTag(),
-           stack, ESM_fromHere, OFFalse))
+
+         // LUTData can be OW, US or SS. For now we only handle US.
+         if ((EC_Normal == item->search((DcmTagKey &)modalityLUTData.getTag(),
+           stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_US))
          {
            modalityLUTData = *((DcmUnsignedShort *)(stack.top()));
          }
          stack.clear();
-         if (EC_Normal == item->search((DcmTagKey &)modalityLUTType.getTag(),
-           stack, ESM_fromHere, OFFalse))
+         if ((EC_Normal == item->search((DcmTagKey &)modalityLUTType.getTag(),
+           stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_LO))
          {
            modalityLUTType = *((DcmLongString *)(stack.top()));
          }
@@ -747,13 +750,13 @@ OFCondition DcmPresentationState::createDefaultDisplayedArea(DcmItem &dset)
   OFCondition result = EC_Normal;
   DcmStack stack;
 
-  READ_FROM_DATASET(DcmUnsignedShort, rows)
-  READ_FROM_DATASET(DcmUnsignedShort, columns)
-  READ_FROM_DATASET(DcmUniqueIdentifier, sopclassUID)
-  READ_FROM_DATASET(DcmUniqueIdentifier, imageUID)
-  READ_FROM_DATASET(DcmDecimalString, imagerPixelSpacing)
-  READ_FROM_DATASET(DcmDecimalString, pixelSpacing)
-  READ_FROM_DATASET(DcmIntegerString, pixelAspectRatio)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, rows)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, columns)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sopclassUID)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, imageUID)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, imagerPixelSpacing)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, pixelSpacing)
+  READ_FROM_DATASET(DcmIntegerString, EVR_IS, pixelAspectRatio)
 
   if (result == EC_Normal) result = columns.getUint16(cols_uint,0);
   if (result == EC_Normal) result = rows.getUint16(rows_uint,0);
@@ -822,48 +825,48 @@ OFCondition DcmPresentationState::createFromImage(
   clear(); // re-initialize Presentation State object
 
   /* copy some image attributes we will need later */
-  READ_FROM_DATASET(DcmCodeString, photometricInterpretation)
-  READ_FROM_DATASET(DcmUniqueIdentifier, sopclassUID)
-  READ_FROM_DATASET(DcmUniqueIdentifier, imageUID)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, photometricInterpretation)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sopclassUID)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, imageUID)
   sopclassUID.getOFString(ofsopclassUID,0);
   imageUID.getOFString(ofimageUID,0);
 
   /* copy attributes for Patient, General Study and General Equipment
    * modules from image object. Also copy specific character set (SOP common). */
-  READ_FROM_DATASET(DcmPersonName, patientName)
-  READ_FROM_DATASET(DcmLongString, patientID)
-  READ_FROM_DATASET(DcmDate, patientBirthDate)
-  READ_FROM_DATASET(DcmCodeString, patientSex)
-  READ_FROM_DATASET(DcmUniqueIdentifier, studyInstanceUID)
-  READ_FROM_DATASET(DcmDate, studyDate)
-  READ_FROM_DATASET(DcmTime, studyTime)
-  READ_FROM_DATASET(DcmPersonName, referringPhysicianName)
-  READ_FROM_DATASET(DcmShortString, studyID)
-  READ_FROM_DATASET(DcmShortString, accessionNumber)
-  READ_FROM_DATASET(DcmLongString, manufacturer)
-  READ_FROM_DATASET(DcmCodeString, specificCharacterSet)
+  READ_FROM_DATASET(DcmPersonName, EVR_PN, patientName)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, patientID)
+  READ_FROM_DATASET(DcmDate, EVR_DA, patientBirthDate)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, patientSex)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, studyInstanceUID)
+  READ_FROM_DATASET(DcmDate, EVR_DA, studyDate)
+  READ_FROM_DATASET(DcmTime, EVR_TM, studyTime)
+  READ_FROM_DATASET(DcmPersonName, EVR_PN, referringPhysicianName)
+  READ_FROM_DATASET(DcmShortString, EVR_SH, studyID)
+  READ_FROM_DATASET(DcmShortString, EVR_SH, accessionNumber)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, manufacturer)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, specificCharacterSet)
 
   /* if there is a modality rescale, copy it now.
    * Later we decide whether we want to use it.
    */
-  READ_FROM_DATASET(DcmDecimalString, rescaleIntercept)
-  READ_FROM_DATASET(DcmDecimalString, rescaleSlope)
-  READ_FROM_DATASET(DcmLongString, rescaleType)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, rescaleIntercept)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, rescaleSlope)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, rescaleType)
 
   if ((result==EC_Normal) && shutterActivation)
   {
     /* if there is a display shutter in the image (i.e. in XA, RF, DX), copy it.
      * We never copy bitmap shutters.
      */
-    READ_FROM_DATASET(DcmCodeString, shutterShape)
-    READ_FROM_DATASET(DcmIntegerString, shutterLeftVerticalEdge)
-    READ_FROM_DATASET(DcmIntegerString, shutterRightVerticalEdge)
-    READ_FROM_DATASET(DcmIntegerString, shutterUpperHorizontalEdge)
-    READ_FROM_DATASET(DcmIntegerString, shutterLowerHorizontalEdge)
-    READ_FROM_DATASET(DcmIntegerString, centerOfCircularShutter)
-    READ_FROM_DATASET(DcmIntegerString, radiusOfCircularShutter)
-    READ_FROM_DATASET(DcmIntegerString, verticesOfThePolygonalShutter)
-    READ_FROM_DATASET(DcmUnsignedShort, shutterPresentationValue)
+    READ_FROM_DATASET(DcmCodeString, EVR_CS, shutterShape)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterLeftVerticalEdge)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterRightVerticalEdge)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterUpperHorizontalEdge)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, shutterLowerHorizontalEdge)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, centerOfCircularShutter)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, radiusOfCircularShutter)
+    READ_FROM_DATASET(DcmIntegerString, EVR_IS, verticesOfThePolygonalShutter)
+    READ_FROM_DATASET(DcmUnsignedShort, EVR_US, shutterPresentationValue)
   }
 
   if ((result==EC_Normal) && presentationActivation)
@@ -871,40 +874,43 @@ OFCondition DcmPresentationState::createFromImage(
     /* if there is a Presentation LUT shape in the image (i.e. in DX), copy it.
      * We never copy presentation LUT sequences.
      */
-    READ_FROM_DATASET(DcmCodeString, presentationLUTShape)
+    READ_FROM_DATASET(DcmCodeString, EVR_CS, presentationLUTShape)
   }
 
   /* read Modality LUT Sequence */
   if (result==EC_Normal)
   {
     stack.clear();
-    if (EC_Normal == dset.search(DCM_ModalityLUTSequence, stack, ESM_fromHere, OFFalse))
+    if ((EC_Normal == dset.search(DCM_ModalityLUTSequence, stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_SQ))
     {
       seq=(DcmSequenceOfItems *)stack.top();
       if (seq->card() >0)
       {
          item = seq->getItem(0);
          stack.clear();
-         if (EC_Normal == item->search((DcmTagKey &)modalityLUTDescriptor.getTag(),
-           stack, ESM_fromHere, OFFalse))
+         // LUTDescriptor can be US or SS. For now we only handle US.
+         if ((EC_Normal == item->search((DcmTagKey &)modalityLUTDescriptor.getTag(),
+           stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_US))
          {
            modalityLUTDescriptor = *((DcmUnsignedShort *)(stack.top()));
          }
          stack.clear();
-         if (EC_Normal == item->search((DcmTagKey &)modalityLUTExplanation.getTag(),
-           stack, ESM_fromHere, OFFalse))
+         if ((EC_Normal == item->search((DcmTagKey &)modalityLUTExplanation.getTag(),
+           stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_LO))
          {
            modalityLUTExplanation = *((DcmLongString *)(stack.top()));
          }
          stack.clear();
-         if (EC_Normal == item->search((DcmTagKey &)modalityLUTData.getTag(),
-           stack, ESM_fromHere, OFFalse))
+
+         // LUTData can be OW, US or SS. For now we only handle US.
+         if ((EC_Normal == item->search((DcmTagKey &)modalityLUTData.getTag(),
+           stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_US))
          {
            modalityLUTData = *((DcmUnsignedShort *)(stack.top()));
          }
          stack.clear();
-         if (EC_Normal == item->search((DcmTagKey &)modalityLUTType.getTag(),
-           stack, ESM_fromHere, OFFalse))
+         if ((EC_Normal == item->search((DcmTagKey &)modalityLUTType.getTag(),
+           stack, ESM_fromHere, OFFalse)) && (stack.top()->ident() == EVR_LO))
          {
            modalityLUTType = *((DcmLongString *)(stack.top()));
          }
@@ -1328,11 +1334,11 @@ OFCondition DcmPresentationState::addImageReference(
   Sint32 ofnumberOfFrames=0;
   DcmStack stack;
 
-  READ_FROM_DATASET(DcmIntegerString, numberOfFrames)
-  READ_FROM_DATASET(DcmUniqueIdentifier, studyUID)
-  READ_FROM_DATASET(DcmUniqueIdentifier, seriesUID)
-  READ_FROM_DATASET(DcmUniqueIdentifier, sopclassUID)
-  READ_FROM_DATASET(DcmUniqueIdentifier, imageUID)
+  READ_FROM_DATASET(DcmIntegerString, EVR_IS, numberOfFrames)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, studyUID)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, seriesUID)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sopclassUID)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, imageUID)
 
   numberOfFrames.getSint32(ofnumberOfFrames,0);
   seriesUID.getOFString(ofseriesUID,0);
@@ -1393,9 +1399,9 @@ OFCondition DcmPresentationState::removeImageReference(DcmItem &dset)
   OFString ofimageUID;
   DcmStack stack;
 
-  READ_FROM_DATASET(DcmUniqueIdentifier, studyUID)
-  READ_FROM_DATASET(DcmUniqueIdentifier, seriesUID)
-  READ_FROM_DATASET(DcmUniqueIdentifier, imageUID)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, studyUID)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, seriesUID)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, imageUID)
 
   seriesUID.getOFString(ofseriesUID,0);
   studyInstanceUID.getOFString(ofstudyInstanceUID,0);
index d9d811f08c1d42532b407b8cdfa5226d029bd5b9..e3392aedcf861f4eb001dd07fed5d63e7506936e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -105,6 +105,7 @@ BEGIN_EXTERN_C
 #include <openssl/x509.h>
 #include <openssl/pem.h>
 #include <openssl/err.h>
+#include <openssl/ssl.h>
 END_EXTERN_C
 #endif
 
@@ -663,7 +664,7 @@ OFCondition DVInterface::savePState(OFBool replaceSOPInstanceUID)
         return EC_IllegalCall;
     }
 
-    if (dbhandle.makeNewStoreFileName(UID_GrayscaleSoftcopyPresentationStateStorage, instanceUID, imageFileName).good())
+    if (dbhandle.makeNewStoreFileName(UID_GrayscaleSoftcopyPresentationStateStorage, instanceUID, imageFileName, sizeof(imageFileName)).good())
     {
         // now store presentation state as filename
         result = savePState(imageFileName, OFFalse);
@@ -687,14 +688,14 @@ OFCondition DVInterface::savePState(OFBool replaceSOPInstanceUID)
             DIC_UI instanceUID2;
             DIC_UI seriesUID;
             DIC_UI studyUID;
-            if (DU_getStringDOElement(dset, DCM_SOPClassUID, sopClass) &&
-                    DU_getStringDOElement(dset, DCM_SOPInstanceUID, instanceUID2) &&
-                    DU_getStringDOElement(dset, DCM_SeriesInstanceUID, seriesUID) &&
-                    DU_getStringDOElement(dset, DCM_StudyInstanceUID, studyUID) &&
+            if (DU_getStringDOElement(dset, DCM_SOPClassUID, sopClass, sizeof(sopClass)) &&
+                    DU_getStringDOElement(dset, DCM_SOPInstanceUID, instanceUID2, sizeof(instanceUID2)) &&
+                    DU_getStringDOElement(dset, DCM_SeriesInstanceUID, seriesUID, sizeof(seriesUID)) &&
+                    DU_getStringDOElement(dset, DCM_StudyInstanceUID, studyUID, sizeof(studyUID)) &&
                 ((!imageInDatabase) || (getSeriesStruct(studyUID, seriesUID, instanceUID2) == NULL)))
             {
                 releaseDatabase();   /* avoid deadlocks */
-                if (dbhandle.makeNewStoreFileName(sopClass, instanceUID2, imageFileName).good())
+                if (dbhandle.makeNewStoreFileName(sopClass, instanceUID2, imageFileName, sizeof(imageFileName)).good())
                 {
                     // now store presentation state as filename
                     result = saveCurrentImage(imageFileName);
@@ -790,7 +791,7 @@ OFCondition DVInterface::saveStructuredReport()
         return EC_IllegalCall;
     }
 
-    if (dbhandle.makeNewStoreFileName(sopClassUID.c_str(), instanceUID.c_str(), filename).good())
+    if (dbhandle.makeNewStoreFileName(sopClassUID.c_str(), instanceUID.c_str(), filename, sizeof(filename)).good())
     {
         // now store presentation state as filename
         result = saveStructuredReport(filename);
@@ -2651,7 +2652,7 @@ OFCondition DVInterface::saveDICOMImage(
     return result;
   }
 
-  if (handle.makeNewStoreFileName(UID_SecondaryCaptureImageStorage, uid, imageFileName).good())
+  if (handle.makeNewStoreFileName(UID_SecondaryCaptureImageStorage, uid, imageFileName, sizeof(imageFileName)).good())
   {
      // now store presentation state as filename
      result = saveDICOMImage(imageFileName, pixelData, width, height, aspectRatio, OFTrue, uid);
@@ -2810,7 +2811,7 @@ OFCondition DVInterface::saveHardcopyGrayscaleImage(
     return result;
   }
 
-  if (handle.makeNewStoreFileName(UID_RETIRED_HardcopyGrayscaleImageStorage, uid, imageFileName).good())
+  if (handle.makeNewStoreFileName(UID_RETIRED_HardcopyGrayscaleImageStorage, uid, imageFileName, sizeof(imageFileName)).good())
   {
      result = saveHardcopyGrayscaleImage(imageFileName, pixelData, width, height, aspectRatio, OFTrue, uid);
      if (EC_Normal==result)
@@ -2862,7 +2863,7 @@ OFCondition DVInterface::saveFileFormatToDB(DcmFileFormat &fileformat)
     return result;
   }
 
-  if (handle.makeNewStoreFileName(classUID, instanceUID, imageFileName).good())
+  if (handle.makeNewStoreFileName(classUID, instanceUID, imageFileName, sizeof(imageFileName)).good())
   {
      // save image file
      result = DVPSHelper::saveFileFormat(imageFileName, &fileformat, OFTrue);
@@ -3040,7 +3041,7 @@ OFCondition DVInterface::saveStoredPrint(OFBool writeRequestedImageSize)
     return result;
   }
 
-  if (handle.makeNewStoreFileName(UID_RETIRED_StoredPrintStorage, uid, imageFileName).good())
+  if (handle.makeNewStoreFileName(UID_RETIRED_StoredPrintStorage, uid, imageFileName, sizeof(imageFileName)).good())
   {
      // now store stored print object as filename
      result = saveStoredPrint(imageFileName, writeRequestedImageSize, OFTrue, uid);
@@ -3614,8 +3615,8 @@ OFCondition DVInterface::terminatePrintServer()
   if (tlsFolder==NULL) tlsFolder = ".";
 
   /* key file format */
-  int keyFileFormat = SSL_FILETYPE_PEM;
-  if (! getTLSPEMFormat()) keyFileFormat = SSL_FILETYPE_ASN1;
+  DcmKeyFileFormat keyFileFormat = DCF_Filetype_PEM;
+  if (! getTLSPEMFormat()) keyFileFormat = DCF_Filetype_ASN1;
 #endif
 
   Uint32 numberOfPrinters = getNumberOfTargets(DVPSE_printLocal);
@@ -3668,30 +3669,8 @@ OFCondition DVInterface::terminatePrintServer()
           const char *tlsCACertificateFolder = getTLSCACertificateFolder();
           if (tlsCACertificateFolder==NULL) tlsCACertificateFolder = ".";
 
-          /* ciphersuites */
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-          OFString tlsCiphersuites(TLS1_TXT_RSA_WITH_AES_128_SHA ":" SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#else
-          OFString tlsCiphersuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);
-#endif
-          Uint32 tlsNumberOfCiphersuites = getTargetNumberOfCipherSuites(target);
-          if (tlsNumberOfCiphersuites > 0)
-          {
-            tlsCiphersuites.clear();
-            OFString currentSuite;
-            const char *currentOpenSSL;
-            for (Uint32 ui=0; ui<tlsNumberOfCiphersuites; ui++)
-            {
-              getTargetCipherSuite(target, ui, currentSuite);
-              if (NULL != (currentOpenSSL = DcmTLSTransportLayer::findOpenSSLCipherSuiteName(currentSuite.c_str())))
-              {
-                if (!tlsCiphersuites.empty()) tlsCiphersuites += ":";
-                tlsCiphersuites += currentOpenSSL;
-              }
-            }
-          }
 
-          DcmTLSTransportLayer *tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_REQUESTOR, tlsRandomSeedFile.c_str());
+          DcmTLSTransportLayer *tLayer = new DcmTLSTransportLayer(NET_REQUESTOR, tlsRandomSeedFile.c_str(), OFTrue);
           if (tLayer)
           {
             if (tlsCACertificateFolder) tLayer->addTrustedCertificateDir(tlsCACertificateFolder, keyFileFormat);
@@ -3699,8 +3678,25 @@ OFCondition DVInterface::terminatePrintServer()
             tLayer->setPrivateKeyPasswd(tlsPrivateKeyPassword); // never prompt on console
             tLayer->setPrivateKeyFile(tlsPrivateKeyFile.c_str(), keyFileFormat);
             tLayer->setCertificateFile(tlsCertificateFile.c_str(), keyFileFormat);
-            tLayer->setCipherSuites(tlsCiphersuites.c_str());
             tLayer->setCertificateVerification(DCV_ignoreCertificate);
+
+           // determine TLS profile
+             OFString profileName;
+            const char *profileNamePtr = getTargetTLSProfile(target);
+            if (profileNamePtr) profileName = profileNamePtr;
+            DcmTLSSecurityProfile tlsProfile = TSP_Profile_BCP195;  // default
+            if (profileName == "BCP195-ND") tlsProfile = TSP_Profile_BCP195_ND;
+            else if (profileName == "BCP195") tlsProfile = TSP_Profile_BCP195;
+            else if (profileName == "AES") tlsProfile = TSP_Profile_AES;
+            else if (profileName == "BASIC") tlsProfile = TSP_Profile_Basic;
+            else if (profileName == "NULL") tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted;
+
+            // set TLS profile
+            (void) tLayer->setTLSProfile(tlsProfile);
+
+            // activate cipher suites
+            (void) tLayer->activateCipherSuites();
+
             ASC_setTransportLayer(net, tLayer, 1);
           }
 #else
index a79b0e17668d93dfa4dfe5d6c74c93627f4ddbe4..c00d41758e795a149469da90bb316a6fabbb5eea 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -76,9 +76,9 @@ OFCondition DVPSAnnotationContent::read(DcmItem &dset)
   OFCondition result = EC_Normal;
   DcmStack stack;
   
-  READ_FROM_DATASET(DcmUniqueIdentifier, sOPInstanceUID)
-  READ_FROM_DATASET(DcmUnsignedShort, annotationPosition)
-  READ_FROM_DATASET(DcmLongString, textString)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sOPInstanceUID)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, annotationPosition)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, textString)
   
   /* Now perform basic sanity checks */
 
index 3514760d286697eda803210c41a3bd580e9a4e8f..b5a276d38a94146439847cf6a8f4559ad727804d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -51,7 +51,7 @@ OFCondition DVPSOverlayCurveActivationLayer::read(DcmItem &dset, Uint16 ovGroup)
 
   repeatingGroup = ovGroup;
   activationLayer.setGTag(repeatingGroup);
-  READ_FROM_DATASET(DcmCodeString, activationLayer)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, activationLayer)
 
   if (activationLayer.getVM() > 1)
   {
index 23a825cde78c4db79117d8f924e8dd3a630cd0a7..c39f06e6c9a94f23640a4cf2fb270d767a000475 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -245,8 +245,8 @@ OFCondition DVPSOverlayCurveActivationLayer_PList::createFromImage(
         DcmCodeString typeOfDataValue(DCM_RETIRED_TypeOfData);
         curveDimensionsValue.setGTag(group);
         typeOfDataValue.setGTag(group);
-        READ_FROM_DATASET(DcmUnsignedShort, curveDimensionsValue)
-        READ_FROM_DATASET(DcmCodeString, typeOfDataValue)
+        READ_FROM_DATASET(DcmUnsignedShort, EVR_US, curveDimensionsValue)
+        READ_FROM_DATASET(DcmCodeString, EVR_CS, typeOfDataValue)
 
         /* we can only display POLY and ROI curves */
         aString.clear();
index 82d2d100c3bad7125d03e35456f8875c35409b41..18e4359a0724672fb8bf0391fb2997b7a9404c47 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2013, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -54,7 +54,6 @@ extern "C" int strncasecmp(const char *s1, const char *s2, size_t n);
 #define L0_CERTIFICATE                  "CERTIFICATE"
 #define L0_CHARACTERISTICS              "CHARACTERISTICS"
 #define L0_CHECK                        "CHECK"
-#define L0_CIPHERSUITES                 "CIPHERSUITES"
 #define L0_CODE                         "CODE"
 #define L0_CORRECTUIDPADDING            "CORRECTUIDPADDING"
 #define L0_DEFAULTILLUMINATION          "DEFAULTILLUMINATION"
@@ -120,6 +119,7 @@ extern "C" int strncasecmp(const char *s1, const char *s2, size_t n);
 #define L0_SUPPORTSTRIM                 "SUPPORTSTRIM"
 #define L0_TIMEOUT                      "TIMEOUT"
 #define L0_TLSDIRECTORY                 "TLSDIRECTORY"
+#define L0_TLSPROFILE                   "TLSPROFILE"
 #define L0_TYPE                         "TYPE"
 #define L0_USEPEMFORMAT                 "USEPEMFORMAT"
 #define L0_USERKEYDIRECTORY             "USERKEYDIRECTORY"
@@ -1338,15 +1338,9 @@ const char *DVConfiguration::getTargetPrivateKeyPassword(const char *targetID)
   return getConfigEntry(L2_COMMUNICATION, targetID, L0_PRIVATEKEYPASSWORD);
 }
 
-Uint32 DVConfiguration::getTargetNumberOfCipherSuites(const char *targetID)
+const char *DVConfiguration::getTargetTLSProfile(const char *targetID)
 {
-  return countValues(getConfigEntry(L2_COMMUNICATION, targetID, L0_CIPHERSUITES));
-}
-
-const char *DVConfiguration::getTargetCipherSuite(const char *targetID, Uint32 idx, OFString& value)
-{
-  copyValue(getConfigEntry(L2_COMMUNICATION, targetID, L0_CIPHERSUITES), idx, value);
-  if (value.length()) return value.c_str(); else return NULL;
+  return getConfigEntry(L2_COMMUNICATION, targetID, L0_TLSPROFILE);
 }
 
 DVPSCertificateVerificationType DVConfiguration::getTargetPeerAuthentication(const char *targetID)
index feb5250c29cf0916e0221b4ffcc7fb0c5684d832..17ef491a363ed4b82349ae8eff9b152fed96a9df 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -22,6 +22,7 @@
 
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 #include "dcmtk/ofstd/ofstring.h"
+#include "dcmtk/ofstd/ofstd.h"
 #include "dcmtk/dcmpstat/dvpsda.h"
 #include "dcmtk/dcmpstat/dvpsri.h"      /* for DVPSReferencedImage */
 #include "dcmtk/dcmpstat/dvpsrsl.h"     /* DVPSReferencedSeries_PList */
@@ -66,12 +67,12 @@ OFCondition DVPSDisplayedArea::read(DcmItem &dset)
   DcmStack stack;
   OFString aString;
   
-  READ_FROM_DATASET(DcmSignedLong, displayedAreaTopLeftHandCorner)
-  READ_FROM_DATASET(DcmSignedLong, displayedAreaBottomRightHandCorner)
-  READ_FROM_DATASET(DcmCodeString, presentationSizeMode)
-  READ_FROM_DATASET(DcmDecimalString, presentationPixelSpacing)
-  READ_FROM_DATASET(DcmIntegerString, presentationPixelAspectRatio)
-  READ_FROM_DATASET(DcmFloatingPointSingle, presentationPixelMagnificationRatio)
+  READ_FROM_DATASET(DcmSignedLong, EVR_SL, displayedAreaTopLeftHandCorner)
+  READ_FROM_DATASET(DcmSignedLong, EVR_SL, displayedAreaBottomRightHandCorner)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, presentationSizeMode)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, presentationPixelSpacing)
+  READ_FROM_DATASET(DcmIntegerString, EVR_IS, presentationPixelAspectRatio)
+  READ_FROM_DATASET(DcmFloatingPointSingle, EVR_FL, presentationPixelMagnificationRatio)
 
   if (result==EC_Normal) result = referencedImageList.read(dset);
 
@@ -285,7 +286,7 @@ OFCondition DVPSDisplayedArea::setDisplayedAreaPixelSpacing(double spacingX, dou
 {
   char str[66];
   OFStandard::ftoa(str, 32, spacingY, OFStandard::ftoa_format_f);
-  strcat(str, "\\");
+  OFStandard::strlcat(str, "\\", 66);
   OFStandard::ftoa(strchr(str, 0), 32, spacingX, OFStandard::ftoa_format_f);
 
   return setDisplayedAreaPixelSpacing(str);
index 4fd741b5e0dc1339f7859aa4236d953b8b398a7c..b4d6598f30b6cd29e264790a39b4eabc610f7dea 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -96,11 +96,11 @@ OFBool DVPSFilmSession::isInstance(const char *uid)
 }
 
 OFBool DVPSFilmSession::printSCPCreate(
-    DVConfiguration& cfg, 
-    const char *cfgname, 
-    DcmDataset *rqDataset, 
-    T_DIMSE_Message& rsp, 
-    DcmDataset *& rspDataset, 
+    DVConfiguration& cfg,
+    const char *cfgname,
+    DcmDataset *rqDataset,
+    T_DIMSE_Message& rsp,
+    DcmDataset *& rspDataset,
     const char *peerae,
     OFBool presentationLUTnegotiated,
     DVPSPresentationLUT_PList& globalPresentationLUTList)
@@ -108,11 +108,11 @@ OFBool DVPSFilmSession::printSCPCreate(
   OFBool result = OFTrue;
   DcmStack stack;
   sopInstanceUID = rsp.msg.NCreateRSP.AffectedSOPInstanceUID;
-  
+
   // numberOfCopies
   if (result)
   {
-    READ_FROM_PDATASET(DcmIntegerString, numberOfCopies)
+    READ_FROM_PDATASET(DcmIntegerString, EVR_IS, numberOfCopies)
     if (numberOfCopies.getLength() == 0) numberOfCopies.putString(DEFAULT_numberOfCopies);
     else
     {
@@ -132,7 +132,7 @@ OFBool DVPSFilmSession::printSCPCreate(
   // printPriority
   if (result)
   {
-    READ_FROM_PDATASET(DcmCodeString, printPriority)
+    READ_FROM_PDATASET(DcmCodeString, EVR_CS, printPriority)
     if (printPriority.getLength() == 0) printPriority.putString(DEFAULT_priority);
     else
     {
@@ -146,18 +146,18 @@ OFBool DVPSFilmSession::printSCPCreate(
       }
     }
   }
-  
+
   // mediumType
   if (result)
   {
-    Uint32 numMediumTypes = cfg.getTargetPrinterNumberOfMediumTypes(cfgname);          
-    READ_FROM_PDATASET(DcmCodeString, mediumType)
-    if (mediumType.getLength() == 0) 
+    Uint32 numMediumTypes = cfg.getTargetPrinterNumberOfMediumTypes(cfgname);
+    READ_FROM_PDATASET(DcmCodeString, EVR_CS, mediumType)
+    if (mediumType.getLength() == 0)
     {
       if (numMediumTypes > 0)
       {
-       OFString aString;
-       cfg.getTargetPrinterMediumType(cfgname, 0, aString);            
+        OFString aString;
+        cfg.getTargetPrinterMediumType(cfgname, 0, aString);
         mediumType.putString(aString.c_str());
       } else {
         mediumType.putString(DEFAULT_mediumType);
@@ -170,12 +170,12 @@ OFBool DVPSFilmSession::printSCPCreate(
       mediumType.getOFString(theMedium, 0, OFTrue);
       for (Uint32 i=0; i<numMediumTypes; i++)
       {
-       cfg.getTargetPrinterMediumType(cfgname, i, aString);
-       if (theMedium == aString) 
-       {
-         found = OFTrue;
-         break;
-       }       
+        cfg.getTargetPrinterMediumType(cfgname, i, aString);
+        if (theMedium == aString)
+        {
+          found = OFTrue;
+          break;
+        }
       }
       if (! found)
       {
@@ -189,14 +189,14 @@ OFBool DVPSFilmSession::printSCPCreate(
   // filmDestination
   if (result)
   {
-    Uint32 numFilmDestination = cfg.getTargetPrinterNumberOfFilmDestinations(cfgname);         
-    READ_FROM_PDATASET(DcmCodeString, filmDestination)
-    if (filmDestination.getLength() == 0) 
+    Uint32 numFilmDestination = cfg.getTargetPrinterNumberOfFilmDestinations(cfgname);
+    READ_FROM_PDATASET(DcmCodeString, EVR_CS, filmDestination)
+    if (filmDestination.getLength() == 0)
     {
       if (numFilmDestination > 0)
       {
-       OFString aString;
-       cfg.getTargetPrinterFilmDestination(cfgname, 0, aString);       
+        OFString aString;
+        cfg.getTargetPrinterFilmDestination(cfgname, 0, aString);
         filmDestination.putString(aString.c_str());
       } else {
         filmDestination.putString(DEFAULT_filmDestination);
@@ -209,12 +209,12 @@ OFBool DVPSFilmSession::printSCPCreate(
       filmDestination.getOFString(theDestination, 0, OFTrue);
       for (Uint32 i=0; i<numFilmDestination; i++)
       {
-       cfg.getTargetPrinterFilmDestination(cfgname, i, aString);
-       if (theDestination == aString) 
-       {
-         found = OFTrue;
-         break;
-       }       
+        cfg.getTargetPrinterFilmDestination(cfgname, i, aString);
+        if (theDestination == aString)
+        {
+          found = OFTrue;
+          break;
+        }
       }
       if (! found)
       {
@@ -228,23 +228,23 @@ OFBool DVPSFilmSession::printSCPCreate(
   // filmSessionLabel
   if (result)
   {
-    READ_FROM_PDATASET(DcmLongString, filmSessionLabel)
-    if (filmSessionLabel.getLength() == 0) 
+    READ_FROM_PDATASET(DcmLongString, EVR_LO, filmSessionLabel)
+    if (filmSessionLabel.getLength() == 0)
     {
       OFString labelString("print job ");
       OFString aString;
       if (peerae)
       {
-       labelString += "for \"";
-       labelString += peerae;
-       labelString += "\" ";
+        labelString += "for \"";
+        labelString += peerae;
+        labelString += "\" ";
       }
       labelString += "created ";
       DVPSHelper::currentDate(aString);
       labelString += aString;
       labelString += " ";
       DVPSHelper::currentTime(aString);
-      labelString += aString;      
+      labelString += aString;
       filmSessionLabel.putString(labelString.c_str());
     }
   }
@@ -252,8 +252,8 @@ OFBool DVPSFilmSession::printSCPCreate(
   // ownerID
   if (result)
   {
-    READ_FROM_PDATASET(DcmShortString, ownerID)
-    if (ownerID.getLength() == 0) 
+    READ_FROM_PDATASET(DcmShortString, EVR_SH, ownerID)
+    if (ownerID.getLength() == 0)
     {
       if (peerae) ownerID.putString(peerae); else ownerID.putString(DEFAULT_ownerID);
     }
@@ -265,7 +265,7 @@ OFBool DVPSFilmSession::printSCPCreate(
     // illumination
     if (result)
     {
-      READ_FROM_PDATASET(DcmUnsignedShort, illumination)
+      READ_FROM_PDATASET(DcmUnsignedShort, EVR_US, illumination)
       if (illumination.getLength() == 0) illumination.putUint16(DEFAULT_illumination, 0);
       // we don't check illumination set by the user (for now)
     }
@@ -273,7 +273,7 @@ OFBool DVPSFilmSession::printSCPCreate(
     // reflectedAmbientLight
     if (result)
     {
-      READ_FROM_PDATASET(DcmUnsignedShort, reflectedAmbientLight)
+      READ_FROM_PDATASET(DcmUnsignedShort, EVR_US, reflectedAmbientLight)
       if (reflectedAmbientLight.getLength() == 0) illumination.putUint16(DEFAULT_reflectedAmbientLight, 0);
       // we don't check reflected ambient light set by the user (for now)
     }
@@ -291,7 +291,7 @@ OFBool DVPSFilmSession::printSCPCreate(
            OFString aString;
            DcmItem *item = seq->getItem(0);
            stack.clear();
-           READ_FROM_DATASET2(DcmUniqueIdentifier, referencedPresentationLUTInstanceUID)           
+           READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID)
            if (referencedPresentationLUTInstanceUID.getLength() > 0)
            {
              referencedPresentationLUTInstanceUID.getOFString(aString,0);
@@ -305,9 +305,9 @@ OFBool DVPSFilmSession::printSCPCreate(
                // check referenced SOP class UID
                DcmUniqueIdentifier refClassUID(DCM_ReferencedSOPClassUID);
                stack.clear();
-               READ_FROM_DATASET2(DcmUniqueIdentifier, refClassUID)
+               READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refClassUID)
                if (refClassUID.getLength() > 0)
-               {     
+               {
                   aString.clear();
                   refClassUID.getOFString(aString,0, OFTrue);
                   if (aString != UID_PresentationLUTSOPClass)
@@ -337,8 +337,8 @@ OFBool DVPSFilmSession::printSCPCreate(
           result = OFFalse;
         }
       }
-    }    
-    
+    }
+
   } /* if presentationLUTnegotiated */
 
   // browse through rqDataset and check for unsupported attributes
@@ -369,7 +369,7 @@ OFBool DVPSFilmSession::printSCPCreate(
         {
           DCMPSTAT_WARN("cannot create Basic Film Session: illumination received:\n"
               << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues));
-          rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute;          
+          rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute;
           result = OFFalse;
         }
       }
@@ -379,7 +379,7 @@ OFBool DVPSFilmSession::printSCPCreate(
         {
           DCMPSTAT_WARN("cannot create Basic Film Session: reflected ambient light received:\n"
               << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues));
-          rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute;          
+          rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute;
           result = OFFalse;
         }
       }
@@ -389,7 +389,7 @@ OFBool DVPSFilmSession::printSCPCreate(
         {
           DCMPSTAT_WARN("cannot create Basic Film Session: referenced presentation LUT sequence received:\n"
               << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues));
-          rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute;          
+          rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute;
           result = OFFalse;
         }
       }
@@ -397,21 +397,21 @@ OFBool DVPSFilmSession::printSCPCreate(
       {
         DCMPSTAT_WARN("cannot create Basic Film Session: unsupported attribute received:\n"
             << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues));
-       rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute;
+        rsp.msg.NCreateRSP.DimseStatus = STATUS_N_NoSuchAttribute;
         result = OFFalse;
       }
     }
   }
-  
+
   // if n-create was successful, create response dataset
   if (result)
   {
-    rspDataset = new DcmDataset;    
+    rspDataset = new DcmDataset;
     if (rspDataset)
     {
       OFCondition writeresult = EC_Normal;
       DcmElement *delem = NULL;
-      
+
       ADD_TO_PDATASET(DcmIntegerString, numberOfCopies)
       ADD_TO_PDATASET(DcmCodeString, printPriority)
       ADD_TO_PDATASET(DcmCodeString, mediumType)
@@ -431,7 +431,7 @@ OFBool DVPSFilmSession::printSCPCreate(
             {
               writeresult = wellknownlut->setType(DVPSP_identity);
               if (EC_Normal == writeresult) writeresult = wellknownlut->setSOPInstanceUID(WELLKNOWN_IDENTITY_PLUT_UID);
-              if (EC_Normal == writeresult) globalPresentationLUTList.insert(wellknownlut);              
+              if (EC_Normal == writeresult) globalPresentationLUTList.insert(wellknownlut);
             } else writeresult = EC_MemoryExhausted;
           }
         }
@@ -442,11 +442,11 @@ OFBool DVPSFilmSession::printSCPCreate(
       {
         rsp.msg.NCreateRSP.DataSetType = DIMSE_DATASET_PRESENT;
       } else {
-       delete rspDataset;
-       rspDataset = NULL;
+        delete rspDataset;
+        rspDataset = NULL;
         rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure;
         result = OFFalse;
-      }     
+      }
     } else {
       rsp.msg.NCreateRSP.DimseStatus = STATUS_N_ProcessingFailure;
       result = OFFalse;
@@ -457,10 +457,10 @@ OFBool DVPSFilmSession::printSCPCreate(
 
 
 OFBool DVPSFilmSession::printSCPSet(
-    DVConfiguration& cfg, 
-    const char *cfgname, 
-    DcmDataset *rqDataset, 
-    T_DIMSE_Message& rsp, 
+    DVConfiguration& cfg,
+    const char *cfgname,
+    DcmDataset *rqDataset,
+    T_DIMSE_Message& rsp,
     DcmDataset *& rspDataset,
     OFBool presentationLUTnegotiated,
     DVPSPresentationLUT_PList& globalPresentationLUTList,
@@ -471,14 +471,14 @@ OFBool DVPSFilmSession::printSCPSet(
   OFCondition writeresult = EC_Normal;
   DcmElement *delem = NULL;
   OFBool overrideFilmBoxPLUTSettings = OFFalse;
-  
-  rspDataset = new DcmDataset;    
+
+  rspDataset = new DcmDataset;
   if ((rqDataset == NULL)||(rspDataset == NULL))
   {
     rsp.msg.NSetRSP.DimseStatus = STATUS_N_ProcessingFailure;
     result = OFFalse;
   }
-  
+
   // numberOfCopies
   if (result)
   {
@@ -520,11 +520,11 @@ OFBool DVPSFilmSession::printSCPSet(
       }
     }
   }
-  
+
   // mediumType
   if (result)
   {
-    Uint32 numMediumTypes = cfg.getTargetPrinterNumberOfMediumTypes(cfgname);          
+    Uint32 numMediumTypes = cfg.getTargetPrinterNumberOfMediumTypes(cfgname);
     stack.clear();
     if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)mediumType.getTag(), stack, ESM_fromHere, OFFalse)))
     {
@@ -535,12 +535,12 @@ OFBool DVPSFilmSession::printSCPSet(
       mediumType.getOFString(theMedium, 0, OFTrue);
       for (Uint32 i=0; i<numMediumTypes; i++)
       {
-       cfg.getTargetPrinterMediumType(cfgname, i, aString);
-       if (theMedium == aString) 
-       {
-         found = OFTrue;
-         break;
-       }       
+        cfg.getTargetPrinterMediumType(cfgname, i, aString);
+        if (theMedium == aString)
+        {
+          found = OFTrue;
+          break;
+        }
       }
       if (! found)
       {
@@ -556,7 +556,7 @@ OFBool DVPSFilmSession::printSCPSet(
   // filmDestination
   if (result)
   {
-    Uint32 numFilmDestination = cfg.getTargetPrinterNumberOfFilmDestinations(cfgname);         
+    Uint32 numFilmDestination = cfg.getTargetPrinterNumberOfFilmDestinations(cfgname);
     stack.clear();
     if (rqDataset && (EC_Normal == rqDataset->search((DcmTagKey &)filmDestination.getTag(), stack, ESM_fromHere, OFFalse)))
     {
@@ -567,12 +567,12 @@ OFBool DVPSFilmSession::printSCPSet(
       filmDestination.getOFString(theDestination, 0, OFTrue);
       for (Uint32 i=0; i<numFilmDestination; i++)
       {
-       cfg.getTargetPrinterFilmDestination(cfgname, i, aString);
-       if (theDestination == aString) 
-       {
-         found = OFTrue;
-         break;
-       }       
+        cfg.getTargetPrinterFilmDestination(cfgname, i, aString);
+        if (theDestination == aString)
+        {
+          found = OFTrue;
+          break;
+        }
       }
       if (! found)
       {
@@ -647,7 +647,7 @@ OFBool DVPSFilmSession::printSCPSet(
            OFString aString;
            DcmItem *item = seq->getItem(0);
            stack.clear();
-           READ_FROM_DATASET2(DcmUniqueIdentifier, referencedPresentationLUTInstanceUID)
+           READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID)
            if (referencedPresentationLUTInstanceUID.getLength() > 0)
            {
              referencedPresentationLUTInstanceUID.getOFString(aString,0);
@@ -661,9 +661,9 @@ OFBool DVPSFilmSession::printSCPSet(
                // check referenced SOP class UID
                DcmUniqueIdentifier refClassUID(DCM_ReferencedSOPClassUID);
                stack.clear();
-               READ_FROM_DATASET2(DcmUniqueIdentifier, refClassUID)
+               READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refClassUID)
                if (refClassUID.getLength() > 0)
-               {     
+               {
                   aString.clear();
                   refClassUID.getOFString(aString,0, OFTrue);
                   if (aString != UID_PresentationLUTSOPClass)
@@ -681,11 +681,11 @@ OFBool DVPSFilmSession::printSCPSet(
                       rsp.msg.NSetRSP.DimseStatus = STATUS_N_InvalidAttributeValue;
                       result = OFFalse;
                     } else {
-                      // referenced presentation LUT sequence is OK                      
+                      // referenced presentation LUT sequence is OK
                       overrideFilmBoxPLUTSettings = OFTrue;
                       DcmSequenceOfItems *newSeq = new DcmSequenceOfItems(*seq);
                       if (newSeq) rspDataset->insert(newSeq, OFTrue /*replaceOld*/);
-                      else 
+                      else
                       {
                         writeresult = EC_MemoryExhausted;
                       }
@@ -708,8 +708,8 @@ OFBool DVPSFilmSession::printSCPSet(
           result = OFFalse;
         }
       }
-    }    
-    
+    }
+
   } /* if presentationLUTnegotiated */
 
   // browse through rqDataset and check for unsupported attributes
@@ -732,7 +732,7 @@ OFBool DVPSFilmSession::printSCPSet(
       {
         DCMPSTAT_WARN("warning while updating Basic Film Session: memory allocation not supported\n"
             << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues));
-       if (rsp.msg.NSetRSP.DimseStatus == 0) rsp.msg.NSetRSP.DimseStatus = STATUS_N_PRINT_BFS_Warn_MemoryAllocation;
+        if (rsp.msg.NSetRSP.DimseStatus == 0) rsp.msg.NSetRSP.DimseStatus = STATUS_N_PRINT_BFS_Warn_MemoryAllocation;
       }
       else if (currentTag == DCM_Illumination)
       {
@@ -740,7 +740,7 @@ OFBool DVPSFilmSession::printSCPSet(
         {
           DCMPSTAT_WARN("cannot update Basic Film Session: illumination received:\n"
               << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues));
-          rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute;          
+          rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute;
           result = OFFalse;
         }
       }
@@ -750,7 +750,7 @@ OFBool DVPSFilmSession::printSCPSet(
         {
           DCMPSTAT_WARN("cannot update Basic Film Session: reflected ambient light received:\n"
               << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues));
-          rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute;          
+          rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute;
           result = OFFalse;
         }
       }
@@ -760,7 +760,7 @@ OFBool DVPSFilmSession::printSCPSet(
         {
           DCMPSTAT_WARN("cannot update Basic Film Session: referenced presentation LUT sequence received:\n"
               << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues));
-          rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute;          
+          rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute;
           result = OFFalse;
         }
       }
@@ -768,19 +768,19 @@ OFBool DVPSFilmSession::printSCPSet(
       {
         DCMPSTAT_WARN("cannot update Basic Film Session: unsupported attribute received:\n"
             << DcmObject::PrintHelper(*stack.top(), DCMTypes::PF_shortenLongTagValues));
-       rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute;
+        rsp.msg.NSetRSP.DimseStatus = STATUS_N_NoSuchAttribute;
         result = OFFalse;
       }
     }
   }
-  
+
   // if n-set was successful, send back response dataset
   if (result && (EC_Normal == writeresult))
   {
     rsp.msg.NSetRSP.DataSetType = DIMSE_DATASET_PRESENT;
     if (overrideFilmBoxPLUTSettings)
     {
-      basicFilmBoxList.overridePresentationLUTSettings(illumination, reflectedAmbientLight, 
+      basicFilmBoxList.overridePresentationLUTSettings(illumination, reflectedAmbientLight,
         referencedPresentationLUTInstanceUID, referencedPresentationLUTAlignment);
     }
   } else {
@@ -829,6 +829,6 @@ OFCondition DVPSFilmSession::addPresentationLUTReference(DcmItem& dset)
 
 void DVPSFilmSession::copyPresentationLUTSettings(DVPSStoredPrint& sp)
 {
-  sp.overridePresentationLUTSettings(illumination, reflectedAmbientLight, 
+  sp.overridePresentationLUTSettings(illumination, reflectedAmbientLight,
      referencedPresentationLUTInstanceUID, referencedPresentationLUTAlignment);
 }
index 5cba926055faaed007bd5847f71b218e319cd6de..4496d4940cefbc05a36c277a7b9729cf2da12c00 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -55,7 +55,7 @@ OFCondition DVPSGraphicAnnotation::read(DcmItem &dset)
   OFCondition result = EC_Normal;
   DcmStack stack;
 
-  READ_FROM_DATASET(DcmCodeString, graphicAnnotationLayer)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, graphicAnnotationLayer)
   if (result==EC_Normal) result = textObjectList.read(dset);
   if (result==EC_Normal) result = graphicObjectList.read(dset);
   if (result==EC_Normal) result = referencedImageList.read(dset);
index fa3342fbef9411d1c1cacaa960dc16b3b4302653..4e2373b4019774c9f4f5e5fdd720089d8469ec2b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -56,11 +56,11 @@ OFCondition DVPSGraphicLayer::read(DcmItem &dset)
   OFCondition result = EC_Normal;
   DcmStack stack;
 
-  READ_FROM_DATASET(DcmCodeString, graphicLayer)
-  READ_FROM_DATASET(DcmIntegerString, graphicLayerOrder)
-  READ_FROM_DATASET(DcmUnsignedShort, graphicLayerRecommendedDisplayGrayscaleValue)
-  READ_FROM_DATASET(DcmUnsignedShort, graphicLayerRecommendedDisplayRGBValue)
-  READ_FROM_DATASET(DcmLongString, graphicLayerDescription)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, graphicLayer)
+  READ_FROM_DATASET(DcmIntegerString, EVR_IS, graphicLayerOrder)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, graphicLayerRecommendedDisplayGrayscaleValue)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, graphicLayerRecommendedDisplayRGBValue)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, graphicLayerDescription)
   
   /* Now perform basic sanity checks */
 
index 042f3e87308cfeffb24f3d627a0d374212b118c5..1bd837d9a238126e7abc6b38574756ab846d0907 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -55,12 +55,12 @@ OFCondition DVPSGraphicObject::read(DcmItem &dset)
   DcmStack stack;
   DcmUnsignedShort graphicDimensions(DCM_GraphicDimensions); // VR=US, VM=1, Type 1
 
-  READ_FROM_DATASET(DcmCodeString, graphicAnnotationUnits)
-  READ_FROM_DATASET(DcmUnsignedShort, graphicDimensions)
-  READ_FROM_DATASET(DcmUnsignedShort, numberOfGraphicPoints)
-  READ_FROM_DATASET(DcmFloatingPointSingle, graphicData)
-  READ_FROM_DATASET(DcmCodeString, graphicType)
-  READ_FROM_DATASET(DcmCodeString, graphicFilled)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, graphicAnnotationUnits)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, graphicDimensions)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, numberOfGraphicPoints)
+  READ_FROM_DATASET(DcmFloatingPointSingle, EVR_FL, graphicData)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, graphicType)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, graphicFilled)
 
   /* Now perform basic sanity checks */
 
index 252ba2f91290ac02e93e027550a08131c0462069..cc27733e81d5d9ac76ffdb8548001d2bfd8b9909 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -23,7 +23,7 @@
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 #include "dcmtk/dcmpstat/dvpshlp.h"
 #include "dcmtk/dcmpstat/dvpsdef.h"
-#include "dcmtk/dcmnet/dcompat.h"     /* compatability routines */
+#include "dcmtk/dcmnet/dcompat.h"     /* compatibility routines */
 #include "dcmtk/dcmdata/dctk.h"
 
 #define INCLUDE_CSTDIO
@@ -132,7 +132,7 @@ void DVPSHelper::cleanChildren()
 {
 #ifdef HAVE_WAITPID
     int stat_loc;
-#elif HAVE_WAIT3
+#elif defined(HAVE_WAIT3)
     struct rusage rusage;
 #if defined(__NeXT__)
     /* some systems need a union wait as argument to wait3 */
index d80885171c387b0899ffcc10733cf2fcacdaadf1..096c5b3e1931774e40eaa3c3affe95110fb53382 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -136,18 +136,18 @@ OFCondition DVPSImageBoxContent::read(DcmItem &dset, DVPSPresentationLUT_PList&
   DcmStack stack;
   OFString aString;
 
-  READ_FROM_DATASET(DcmUniqueIdentifier, sOPInstanceUID)
-  READ_FROM_DATASET(DcmUnsignedShort, imageBoxPosition)
-  READ_FROM_DATASET(DcmCodeString, polarity)
-  READ_FROM_DATASET(DcmCodeString, magnificationType)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sOPInstanceUID)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, imageBoxPosition)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, polarity)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, magnificationType)
         if (result==EC_TagNotFound) result = EC_Normal;
-  READ_FROM_DATASET(DcmShortText, configurationInformation)
+  READ_FROM_DATASET(DcmShortText, EVR_ST, configurationInformation)
                 if (result==EC_TagNotFound) result = EC_Normal;
-  READ_FROM_DATASET(DcmCodeString, smoothingType)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, smoothingType)
                 if (result==EC_TagNotFound) result = EC_Normal;
-  READ_FROM_DATASET(DcmDecimalString, requestedImageSize)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, requestedImageSize)
                 if (result==EC_TagNotFound) result = EC_Normal;
-  READ_FROM_DATASET(DcmCodeString, requestedDecimateCropBehavior)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, requestedDecimateCropBehavior)
                 if (result==EC_TagNotFound) result = EC_Normal;
 
   if (result==EC_Normal)
@@ -161,14 +161,14 @@ OFCondition DVPSImageBoxContent::read(DcmItem &dset, DVPSPresentationLUT_PList&
          item = seq->getItem(0);
          stack.clear();
 
-         READ_FROM_DATASET2(DcmApplicationEntity, retrieveAETitle)
-         READ_FROM_DATASET2(DcmUniqueIdentifier, referencedSOPClassUID)
-         READ_FROM_DATASET2(DcmUniqueIdentifier, referencedSOPInstanceUID)
-         READ_FROM_DATASET2(DcmUniqueIdentifier, studyInstanceUID)
-         READ_FROM_DATASET2(DcmUniqueIdentifier, seriesInstanceUID)
-         READ_FROM_DATASET2(DcmIntegerString, referencedFrameNumber)
+         READ_FROM_DATASET2(DcmApplicationEntity, EVR_AE, retrieveAETitle)
+         READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedSOPClassUID)
+         READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedSOPInstanceUID)
+         READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, studyInstanceUID)
+         READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, seriesInstanceUID)
+         READ_FROM_DATASET2(DcmIntegerString, EVR_IS, referencedFrameNumber)
                                  if (result==EC_TagNotFound) result = EC_Normal;
-         READ_FROM_DATASET2(DcmLongString, patientID)
+         READ_FROM_DATASET2(DcmLongString, EVR_LO, patientID)
       } else {
         result=EC_TagNotFound;
         DCMPSTAT_WARN("found ReferencedImageSequence in Stored Print Image Box with number of items != 1");
@@ -188,7 +188,7 @@ OFCondition DVPSImageBoxContent::read(DcmItem &dset, DVPSPresentationLUT_PList&
       {
          item = seq->getItem(0);
          stack.clear();
-         READ_FROM_DATASET2(DcmUniqueIdentifier, referencedPresentationLUTInstanceUID)
+         READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID)
          if (referencedPresentationLUTInstanceUID.getLength() > 0)
          {
            referencedPresentationLUTInstanceUID.getOFString(aString,0);
index b68aaef82ce0154fc642236260d7a72c2f8f3cbb..b0e5f27395599fe34836b1bf62a45ce20e27dee1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -34,6 +34,7 @@
 #include "dcmtk/dcmdata/dcswap.h"      /* for swapIfNecessary() */
 #include "dcmtk/dcmnet/dcmtrans.h"    /* for class DcmTransportConnection */
 #include "dcmtk/ofstd/ofsockad.h"
+#include "dcmtk/ofstd/ofstd.h"
 
 /* --------------- class DVPSIPCMessage --------------- */
 
@@ -109,9 +110,9 @@ DVPSIPCMessage& DVPSIPCMessage::operator=(const DVPSIPCMessage& copy)
   return *this;
 }
 
-void DVPSIPCMessage::resizePayload(Uint32 i)
+void DVPSIPCMessage::resizePayload(size_t i)
 {
-  Uint32 requiredSize = payloadUsed+i;
+  size_t requiredSize = payloadUsed+i;
   if (requiredSize < payloadAllocated) return;
 
   while (payloadAllocated < requiredSize) payloadAllocated += PAYLOAD_ALLOCATION_UNIT;
@@ -124,17 +125,18 @@ void DVPSIPCMessage::resizePayload(Uint32 i)
 
 void DVPSIPCMessage::addStringToPayload(const char *str)
 {
-  Uint32 length = 0;
-  if (str) length = OFstatic_cast(Uint32, strlen(str)); else str = "";
+  size_t length = 0;
+  if (str) length = strlen(str); else str = "";
   Uint32 padBytes = 4 - (length % 4);
-  resizePayload(sizeof(Uint32)+length+padBytes);
+  size_t sizeNeeded = sizeof(Uint32)+length+padBytes;
+  resizePayload(sizeNeeded);
 
   // write string length
-  addIntToPayload(length+padBytes);
+  addIntToPayload(OFstatic_cast(Uint32, length+padBytes));
 
   // write string
-  strcpy((char *)(payload + payloadUsed), str);
-  payloadUsed += length;
+  OFStandard::strlcpy((char *)(payload + payloadUsed), str, (length+padBytes));
+  payloadUsed += OFstatic_cast(Uint32, length);
 
   // write pad bytes
   for (Uint32 i=0; i < padBytes; i++) *(payload + payloadUsed++) = 0;
index 0564125fecde213c1bfc5965d00fe72667eae814..b111ac7aaf9f777ffadc5167d6855171873d79e2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -78,15 +78,15 @@ OFCondition DVPSOverlay::read(DcmItem &dset, Uint8 ovGroup, Uint8 asGroup)
   overlayData.setGTag(gtag);
   overlayDescription.setGTag(gtag);
   overlayLabel.setGTag(gtag);
-  READ_FROM_DATASET(DcmUnsignedShort, overlayRows)
-  READ_FROM_DATASET(DcmUnsignedShort, overlayColumns)
-  READ_FROM_DATASET(DcmCodeString, overlayType)
-  READ_FROM_DATASET(DcmSignedShort, overlayOrigin)
-  READ_FROM_DATASET(DcmUnsignedShort, overlayBitsAllocated)
-  READ_FROM_DATASET(DcmUnsignedShort, overlayBitPosition)
-  READ_FROM_DATASET(DcmOverlayData, overlayData)
-  READ_FROM_DATASET(DcmLongString, overlayDescription)
-  READ_FROM_DATASET(DcmLongString, overlayLabel)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, overlayRows)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, overlayColumns)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, overlayType)
+  READ_FROM_DATASET(DcmSignedShort, EVR_SS, overlayOrigin)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, overlayBitsAllocated)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, overlayBitPosition)
+  READ_FROM_DATASET(DcmOverlayData, EVR_OverlayData, overlayData)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, overlayDescription)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, overlayLabel)
 
   /* Now perform basic sanity checks and adjust use flags */
   if (overlayRows.getLength() == 0)
index 1f36af5de53a39f169771ddfc031664f59376410..ec4cccf97300a26b394dcc9c44de86dd9cf8cf05 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1999-2010, OFFIS e.V.
+ *  Copyright (C) 1999-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -71,8 +71,8 @@ OFCondition DVPSPresentationLUT::read(DcmItem &dset, OFBool withSOPInstance)
 
   DcmCodeString presentationLUTShape(DCM_PresentationLUTShape);
   
-  READ_FROM_DATASET(DcmCodeString, presentationLUTShape)
-  if (withSOPInstance) { READ_FROM_DATASET(DcmUniqueIdentifier, sOPInstanceUID) }
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, presentationLUTShape)
+  if (withSOPInstance) { READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sOPInstanceUID) }
   else sOPInstanceUID.clear();
   
   /* read Presentation LUT Sequence */
index c9f58f635031e808b7424e04941951aa73462c09..f3159de2be84364c9366d6a526f1c0bd3eb397bb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -23,6 +23,7 @@
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 
 #include "dcmtk/ofstd/ofstring.h"
+#include "dcmtk/ofstd/ofstd.h"
 #include "dcmtk/dcmpstat/dvpsdef.h"
 #include "dcmtk/dcmpstat/dvpspr.h"
 
@@ -236,10 +237,10 @@ OFCondition DVPSPrintMessageHandler::createRQ(
   // construct N-CREATE-RQ
   request.CommandField = DIMSE_N_CREATE_RQ;
   request.msg.NCreateRQ.MessageID = assoc->nextMsgID++;
-  strcpy(request.msg.NCreateRQ.AffectedSOPClassUID, sopclassUID);
+  OFStandard::strlcpy(request.msg.NCreateRQ.AffectedSOPClassUID, sopclassUID, sizeof(request.msg.NCreateRQ.AffectedSOPClassUID));
   if (sopinstanceUID.size() > 0)
   {
-    strcpy(request.msg.NCreateRQ.AffectedSOPInstanceUID, sopinstanceUID.c_str());
+    OFStandard::strlcpy(request.msg.NCreateRQ.AffectedSOPInstanceUID, sopinstanceUID.c_str(), sizeof(request.msg.NCreateRQ.AffectedSOPInstanceUID));
     request.msg.NCreateRQ.opts = O_NCREATE_AFFECTEDSOPINSTANCEUID;
   } else {
     request.msg.NCreateRQ.AffectedSOPInstanceUID[0] = 0;
@@ -289,8 +290,8 @@ OFCondition DVPSPrintMessageHandler::setRQ(
   // construct N-SET-RQ
   request.CommandField = DIMSE_N_SET_RQ;
   request.msg.NSetRQ.MessageID = assoc->nextMsgID++;
-  strcpy(request.msg.NSetRQ.RequestedSOPClassUID, sopclassUID);
-  strcpy(request.msg.NSetRQ.RequestedSOPInstanceUID, sopinstanceUID);
+  OFStandard::strlcpy(request.msg.NSetRQ.RequestedSOPClassUID, sopclassUID, sizeof(request.msg.NSetRQ.RequestedSOPClassUID));
+  OFStandard::strlcpy(request.msg.NSetRQ.RequestedSOPInstanceUID, sopinstanceUID, sizeof(request.msg.NSetRQ.RequestedSOPInstanceUID));
    
   OFCondition cond = sendNRequest(presCtx, request, modificationList, response, statusDetail, attributeListOut);
   if (cond.good()) status = response.msg.NSetRSP.DimseStatus;
@@ -328,8 +329,8 @@ OFCondition DVPSPrintMessageHandler::getRQ(
   // construct N-GET-RQ
   request.CommandField = DIMSE_N_GET_RQ;
   request.msg.NGetRQ.MessageID = assoc->nextMsgID++;
-  strcpy(request.msg.NGetRQ.RequestedSOPClassUID, sopclassUID);
-  strcpy(request.msg.NGetRQ.RequestedSOPInstanceUID, sopinstanceUID);
+  OFStandard::strlcpy(request.msg.NGetRQ.RequestedSOPClassUID, sopclassUID, sizeof(request.msg.NGetRQ.RequestedSOPClassUID));
+  OFStandard::strlcpy(request.msg.NGetRQ.RequestedSOPInstanceUID, sopinstanceUID, sizeof(request.msg.NGetRQ.RequestedSOPInstanceUID));
   request.msg.NGetRQ.ListCount = 0;
   if (attributeIdentifierList) request.msg.NGetRQ.ListCount = (int)numShorts;
   request.msg.NGetRQ.AttributeIdentifierList = (DIC_US *)attributeIdentifierList;
@@ -371,8 +372,8 @@ OFCondition DVPSPrintMessageHandler::actionRQ(
   // construct N-ACTION-RQ
   request.CommandField = DIMSE_N_ACTION_RQ;
   request.msg.NActionRQ.MessageID = assoc->nextMsgID++;
-  strcpy(request.msg.NActionRQ.RequestedSOPClassUID, sopclassUID);
-  strcpy(request.msg.NActionRQ.RequestedSOPInstanceUID, sopinstanceUID);
+  OFStandard::strlcpy(request.msg.NActionRQ.RequestedSOPClassUID, sopclassUID, sizeof(request.msg.NActionRQ.RequestedSOPClassUID));
+  OFStandard::strlcpy(request.msg.NActionRQ.RequestedSOPInstanceUID, sopinstanceUID, sizeof(request.msg.NActionRQ.RequestedSOPInstanceUID));
   request.msg.NActionRQ.ActionTypeID = (DIC_US)actionTypeID;
    
   OFCondition cond = sendNRequest(presCtx, request, actionInformation, response, statusDetail, actionReply);
@@ -409,8 +410,8 @@ OFCondition DVPSPrintMessageHandler::deleteRQ(
   // construct N-DELETE-RQ
   request.CommandField = DIMSE_N_DELETE_RQ;
   request.msg.NDeleteRQ.MessageID = assoc->nextMsgID++;
-  strcpy(request.msg.NDeleteRQ.RequestedSOPClassUID, sopclassUID);
-  strcpy(request.msg.NDeleteRQ.RequestedSOPInstanceUID, sopinstanceUID);
+  OFStandard::strlcpy(request.msg.NDeleteRQ.RequestedSOPClassUID, sopclassUID, sizeof(request.msg.NDeleteRQ.RequestedSOPClassUID));
+  OFStandard::strlcpy(request.msg.NDeleteRQ.RequestedSOPInstanceUID, sopinstanceUID, sizeof(request.msg.NDeleteRQ.RequestedSOPInstanceUID));
    
   OFCondition cond = sendNRequest(presCtx, request, NULL, response, statusDetail, attributeListOut);
   if (cond.good()) status = response.msg.NDeleteRSP.DimseStatus;
index 50e5216d3cfd6238ec50cc9fc0e2dc6edd480a70..f1766b7f4447fc3ff6b09def79e4ca74c2f6d7dc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2011, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -140,7 +140,7 @@ DVPSAssociationNegotiationResult DVPSPrintSCP::negotiateAssociation(T_ASC_Networ
     ASC_setAPTitles(assoc->params, NULL, NULL, aetitle);
 
     /* Application Context Name */
-    cond = ASC_getApplicationContextName(assoc->params, buf);
+    cond = ASC_getApplicationContextName(assoc->params, buf, sizeof(buf));
     if (cond.bad() || strcmp(buf, DICOM_STDAPPLICATIONCONTEXT) != 0)
     {
         /* reject: the application context name is not supported */
@@ -847,7 +847,7 @@ void DVPSPrintSCP::filmSessionNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rs
     {
       DIC_AE peerTitle;
       peerTitle[0]=0;
-      ASC_getAPTitles(assoc->params, peerTitle, NULL, NULL);
+      ASC_getAPTitles(assoc->params, peerTitle, sizeof(peerTitle), NULL, 0, NULL, 0);
       if (newSession->printSCPCreate(dviface, cfgname, rqDataset, rsp, rspDataset,
           peerTitle, usePLUTinFilmSession, presentationLUTList))
           filmSession = newSession;
index 14288854c7871335fe5ec5c6f331f3b416b18060..5142a03fe9dfde21afe3e448488d8fb81a378208 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2013, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -62,9 +62,9 @@ OFCondition DVPSReferencedImage::read(DcmItem &dset)
 
   flushCache();
   
-  READ_FROM_DATASET(DcmUniqueIdentifier, referencedSOPClassUID)
-  READ_FROM_DATASET(DcmUniqueIdentifier, referencedSOPInstanceUID)
-  READ_FROM_DATASET(DcmIntegerString, referencedFrameNumber)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, referencedSOPClassUID)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, referencedSOPInstanceUID)
+  READ_FROM_DATASET(DcmIntegerString, EVR_IS, referencedFrameNumber)
   
   /* Now perform basic sanity checks */
 
index 5bab3eb77686a3d8174c42904c0dd15fae4a2e1c..f7e41ab765bc7aee1626ecda0dfa955345e5f813 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -55,10 +55,10 @@ OFCondition DVPSReferencedSeries::read(DcmItem &dset)
   OFCondition result = EC_Normal;
   DcmStack stack;
 
-  READ_FROM_DATASET(DcmUniqueIdentifier, seriesInstanceUID)
-  READ_FROM_DATASET(DcmApplicationEntity, retrieveAETitle)
-  READ_FROM_DATASET(DcmShortString, storageMediaFileSetID)
-  READ_FROM_DATASET(DcmUniqueIdentifier, storageMediaFileSetUID)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, seriesInstanceUID)
+  READ_FROM_DATASET(DcmApplicationEntity, EVR_AE, retrieveAETitle)
+  READ_FROM_DATASET(DcmShortString, EVR_SH, storageMediaFileSetID)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, storageMediaFileSetUID)
   if (result==EC_Normal) result = referencedImageList.read(dset);
 
   /* Now perform basic sanity checks */
index 0248ab027986f2942eca72c88e52aed233ebe70b..780289c79c9c8b60b3fed6cea4633b9caab9c8bb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -286,7 +286,7 @@ OFCondition DVPSStoredPrint::read(DcmItem &dset)
 
   DcmUniqueIdentifier sopclassuid(DCM_SOPClassUID);
   DcmUniqueIdentifier refsopclassuid(DCM_ReferencedSOPClassUID);
-  READ_FROM_DATASET(DcmUniqueIdentifier, sopclassuid)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sopclassuid)
   sopclassuid.getOFString(aString,0);
   if (aString != UID_RETIRED_StoredPrintStorage)
   {
@@ -295,31 +295,31 @@ OFCondition DVPSStoredPrint::read(DcmItem &dset)
   }
 
   DcmCodeString modality(DCM_Modality);
-  READ_FROM_DATASET(DcmCodeString, modality)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, modality)
   if (modality.getLength() == 0)
   {
     result=EC_IllegalCall;
     DCMPSTAT_WARN("Modality missing or empty in Stored Print");
   }
 
-  READ_FROM_DATASET(DcmPersonName, patientName)
-  READ_FROM_DATASET(DcmLongString, patientID)
-  READ_FROM_DATASET(DcmDate, patientBirthDate)
-  READ_FROM_DATASET(DcmCodeString, patientSex)
-  READ_FROM_DATASET(DcmUniqueIdentifier, studyInstanceUID)
-  READ_FROM_DATASET(DcmDate, studyDate)
-  READ_FROM_DATASET(DcmTime, studyTime)
-  READ_FROM_DATASET(DcmPersonName, referringPhysicianName)
-  READ_FROM_DATASET(DcmShortString, studyID)
-  READ_FROM_DATASET(DcmShortString, accessionNumber)
-  READ_FROM_DATASET(DcmUniqueIdentifier, seriesInstanceUID)
-  READ_FROM_DATASET(DcmIntegerString, seriesNumber)
-  READ_FROM_DATASET(DcmLongString, manufacturer)
-  READ_FROM_DATASET(DcmIntegerString, instanceNumber)
-  READ_FROM_DATASET(DcmUniqueIdentifier, sOPInstanceUID)
-  READ_FROM_DATASET(DcmCodeString, specificCharacterSet)
-  READ_FROM_DATASET(DcmDate, instanceCreationDate)
-  READ_FROM_DATASET(DcmTime, instanceCreationTime)
+  READ_FROM_DATASET(DcmPersonName, EVR_PN, patientName)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, patientID)
+  READ_FROM_DATASET(DcmDate, EVR_DA, patientBirthDate)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, patientSex)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, studyInstanceUID)
+  READ_FROM_DATASET(DcmDate, EVR_DA, studyDate)
+  READ_FROM_DATASET(DcmTime, EVR_TM, studyTime)
+  READ_FROM_DATASET(DcmPersonName, EVR_PN, referringPhysicianName)
+  READ_FROM_DATASET(DcmShortString, EVR_SH, studyID)
+  READ_FROM_DATASET(DcmShortString, EVR_SH, accessionNumber)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, seriesInstanceUID)
+  READ_FROM_DATASET(DcmIntegerString, EVR_IS, seriesNumber)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, manufacturer)
+  READ_FROM_DATASET(DcmIntegerString, EVR_IS, instanceNumber)
+  READ_FROM_DATASET(DcmUniqueIdentifier, EVR_UI, sOPInstanceUID)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, specificCharacterSet)
+  READ_FROM_DATASET(DcmDate, EVR_DA, instanceCreationDate)
+  READ_FROM_DATASET(DcmTime, EVR_TM, instanceCreationTime)
 
   if (EC_Normal==result) result = presentationLUTList.read(dset);
 
@@ -334,28 +334,28 @@ OFCondition DVPSStoredPrint::read(DcmItem &dset)
          item = seq->getItem(0);
          stack.clear();
 
-         READ_FROM_DATASET2(DcmShortText, imageDisplayFormat)
-         READ_FROM_DATASET2(DcmCodeString, annotationDisplayFormatID)
+         READ_FROM_DATASET2(DcmShortText, EVR_ST, imageDisplayFormat)
+         READ_FROM_DATASET2(DcmCodeString, EVR_CS, annotationDisplayFormatID)
          if (result==EC_TagNotFound) result = EC_Normal;
-         READ_FROM_DATASET2(DcmCodeString, filmOrientation)
-         READ_FROM_DATASET2(DcmCodeString, filmSizeID)
-         READ_FROM_DATASET2(DcmCodeString, magnificationType)
-         READ_FROM_DATASET2(DcmCodeString, smoothingType)
+         READ_FROM_DATASET2(DcmCodeString, EVR_CS, filmOrientation)
+         READ_FROM_DATASET2(DcmCodeString, EVR_CS, filmSizeID)
+         READ_FROM_DATASET2(DcmCodeString, EVR_CS, magnificationType)
+         READ_FROM_DATASET2(DcmCodeString, EVR_CS, smoothingType)
          if (result==EC_TagNotFound) result = EC_Normal;
-         READ_FROM_DATASET2(DcmCodeString, borderDensity)
+         READ_FROM_DATASET2(DcmCodeString, EVR_CS, borderDensity)
          if (result==EC_TagNotFound) result = EC_Normal;
-         READ_FROM_DATASET2(DcmCodeString, emptyImageDensity)
+         READ_FROM_DATASET2(DcmCodeString, EVR_CS, emptyImageDensity)
          if (result==EC_TagNotFound) result = EC_Normal;
-         READ_FROM_DATASET2(DcmUnsignedShort, minDensity)
+         READ_FROM_DATASET2(DcmUnsignedShort, EVR_US, minDensity)
          if (result==EC_TagNotFound) result = EC_Normal;
-         READ_FROM_DATASET2(DcmUnsignedShort, maxDensity)
-         READ_FROM_DATASET2(DcmCodeString, trim)
-         READ_FROM_DATASET2(DcmShortText, configurationInformation)
-         READ_FROM_DATASET2(DcmUnsignedShort, illumination)
+         READ_FROM_DATASET2(DcmUnsignedShort, EVR_US, maxDensity)
+         READ_FROM_DATASET2(DcmCodeString, EVR_CS, trim)
+         READ_FROM_DATASET2(DcmShortText, EVR_ST, configurationInformation)
+         READ_FROM_DATASET2(DcmUnsignedShort, EVR_US, illumination)
          if (result==EC_TagNotFound) result = EC_Normal;
-         READ_FROM_DATASET2(DcmUnsignedShort, reflectedAmbientLight)
+         READ_FROM_DATASET2(DcmUnsignedShort, EVR_US, reflectedAmbientLight)
          if (result==EC_TagNotFound) result = EC_Normal;
-         READ_FROM_DATASET2(DcmCodeString, requestedResolutionID)
+         READ_FROM_DATASET2(DcmCodeString, EVR_CS, requestedResolutionID)
          if (result==EC_TagNotFound) result = EC_Normal;
          // check referenced presentation LUT sequence
          // if there is any reference, it must refer to one of the presentation LUTs we are managing.
@@ -367,7 +367,7 @@ OFCondition DVPSStoredPrint::read(DcmItem &dset)
            {
               item = seq->getItem(0);
               stack.clear();
-              READ_FROM_DATASET2(DcmUniqueIdentifier, referencedPresentationLUTInstanceUID)
+              READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID)
               if (referencedPresentationLUTInstanceUID.getLength() > 0)
               {
                 referencedPresentationLUTInstanceUID.getOFString(aString,0);
@@ -456,7 +456,7 @@ OFCondition DVPSStoredPrint::read(DcmItem &dset)
          item = seq->getItem(i);
          stack.clear();
          refsopclassuid.clear();
-         READ_FROM_DATASET2(DcmUniqueIdentifier, refsopclassuid)
+         READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refsopclassuid)
          refsopclassuid.getOFString(aString,0);
          if (aString == UID_BasicFilmBoxSOPClass)
            haveFilmBox=OFTrue;
@@ -516,9 +516,9 @@ OFCondition DVPSStoredPrint::read(DcmItem &dset)
       {
          item = seq->getItem(0);
          stack.clear();
-         READ_FROM_DATASET2(DcmApplicationEntity, originator)
-         READ_FROM_DATASET2(DcmApplicationEntity, destination)
-         READ_FROM_DATASET2(DcmLongString, printerName)
+         READ_FROM_DATASET2(DcmApplicationEntity, EVR_AE, originator)
+         READ_FROM_DATASET2(DcmApplicationEntity, EVR_AE, destination)
+         READ_FROM_DATASET2(DcmLongString, EVR_LO, printerName)
       }
     }
     if (printerName.getLength() == 0)
@@ -1530,8 +1530,8 @@ OFCondition DVPSStoredPrint::printSCUcreateBasicFilmBox(DVPSPrintMessageHandler&
         {
            item = seq->getItem(OFstatic_cast(Uint32, i));
            stack.clear();
-           READ_FROM_DATASET2(DcmUniqueIdentifier, refsopclassuid)
-           READ_FROM_DATASET2(DcmUniqueIdentifier, refsopinstanceuid)
+           READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refsopclassuid)
+           READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refsopinstanceuid)
            if (EC_Normal==result) result = refsopclassuid.getString(c);
            if ((EC_Normal==result) && c && (grayscaleIB == c))
            {
@@ -1553,8 +1553,8 @@ OFCondition DVPSStoredPrint::printSCUcreateBasicFilmBox(DVPSPrintMessageHandler&
         {
            item = seq->getItem(OFstatic_cast(Uint32, i));
            stack.clear();
-           READ_FROM_DATASET2(DcmUniqueIdentifier, refsopclassuid)
-           READ_FROM_DATASET2(DcmUniqueIdentifier, refsopinstanceuid)
+           READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refsopclassuid)
+           READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refsopinstanceuid)
            if (EC_Normal==result) result = refsopclassuid.getString(c);
            if ((EC_Normal==result) && c && (annotationB == c))
            {
@@ -1928,7 +1928,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   // filmOrientation
   if (result)
   {
-    READ_FROM_PDATASET(DcmCodeString, filmOrientation)
+    READ_FROM_PDATASET(DcmCodeString, EVR_CS, filmOrientation)
     if (filmOrientation.getLength() == 0) filmOrientation.putString(DEFAULT_filmOrientation);
     else
     {
@@ -1946,7 +1946,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   // imageDisplayFormat
   if (result)
   {
-    READ_FROM_PDATASET(DcmShortText, imageDisplayFormat)
+    READ_FROM_PDATASET(DcmShortText, EVR_ST, imageDisplayFormat)
     if (imageDisplayFormat.getLength() == 0)
     {
         DCMPSTAT_WARN("cannot create Basic Film Box: image display format missing or empty");
@@ -2007,7 +2007,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   if (result)
   {
     Uint32 numFilmSizes = cfg.getTargetPrinterNumberOfFilmSizeIDs(cfgname);
-    READ_FROM_PDATASET(DcmCodeString, filmSizeID)
+    READ_FROM_PDATASET(DcmCodeString, EVR_CS, filmSizeID)
     if (filmSizeID.getLength() == 0)
     {
       if (numFilmSizes > 0)
@@ -2046,7 +2046,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   if (result)
   {
     Uint32 numMagnifications = cfg.getTargetPrinterNumberOfMagnificationTypes(cfgname);
-    READ_FROM_PDATASET(DcmCodeString, magnificationType)
+    READ_FROM_PDATASET(DcmCodeString, EVR_CS, magnificationType)
     if (magnificationType.getLength() == 0)
     {
       if (numMagnifications > 0)
@@ -2085,7 +2085,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   if (result)
   {
     Uint32 numSmoothings = cfg.getTargetPrinterNumberOfSmoothingTypes(cfgname);
-    READ_FROM_PDATASET(DcmCodeString, smoothingType)
+    READ_FROM_PDATASET(DcmCodeString, EVR_CS, smoothingType)
     if (smoothingType.getLength() == 0)
     {
       if (numSmoothings > 0)
@@ -2129,7 +2129,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   if (result)
   {
     Uint32 numBorderDensities = cfg.getTargetPrinterNumberOfBorderDensities(cfgname);
-    READ_FROM_PDATASET(DcmCodeString, borderDensity)
+    READ_FROM_PDATASET(DcmCodeString, EVR_CS, borderDensity)
     if (borderDensity.getLength() == 0)
     {
       if (numBorderDensities > 0)
@@ -2183,7 +2183,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   if (result)
   {
     Uint32 numEmptyImageDensities = cfg.getTargetPrinterNumberOfEmptyImageDensities(cfgname);
-    READ_FROM_PDATASET(DcmCodeString, emptyImageDensity)
+    READ_FROM_PDATASET(DcmCodeString, EVR_CS, emptyImageDensity)
     if (emptyImageDensity.getLength() == 0)
     {
       if (numEmptyImageDensities > 0)
@@ -2237,7 +2237,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   if (result)
   {
     Uint32 numMaxDensities = cfg.getTargetPrinterNumberOfMaxDensities(cfgname);
-    READ_FROM_PDATASET(DcmUnsignedShort, maxDensity)
+    READ_FROM_PDATASET(DcmUnsignedShort, EVR_US, maxDensity)
     if (maxDensity.getLength() == 0)
     {
       if (numMaxDensities > 0)
@@ -2253,7 +2253,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   if (result)
   {
     Uint32 numMinDensities = cfg.getTargetPrinterNumberOfMinDensities(cfgname);
-    READ_FROM_PDATASET(DcmUnsignedShort, minDensity)
+    READ_FROM_PDATASET(DcmUnsignedShort, EVR_US, minDensity)
     if (minDensity.getLength() == 0)
     {
       if (numMinDensities > 0)
@@ -2276,7 +2276,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   // trim
   if (result)
   {
-    READ_FROM_PDATASET(DcmCodeString, trim)
+    READ_FROM_PDATASET(DcmCodeString, EVR_CS, trim)
     if (trim.getLength() == 0)
     {
       if (cfg.getTargetPrinterSupportsTrim(cfgname)) trim.putString(DEFAULT_trim);
@@ -2304,7 +2304,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   // configurationInformation
   if (result)
   {
-    READ_FROM_PDATASET(DcmShortText, configurationInformation)
+    READ_FROM_PDATASET(DcmShortText, EVR_ST, configurationInformation)
     if (configurationInformation.getLength() > 0)
     {
       // check whether we can accept the proposed configuration information
@@ -2340,7 +2340,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
   if (result)
   {
     Uint32 numResolutionIDs = cfg.getTargetPrinterNumberOfPrinterResolutionIDs(cfgname);
-    READ_FROM_PDATASET(DcmCodeString, requestedResolutionID)
+    READ_FROM_PDATASET(DcmCodeString, EVR_CS, requestedResolutionID)
     if (requestedResolutionID.getLength() == 0)
     {
       if (numResolutionIDs > 0)
@@ -2386,7 +2386,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
     // illumination
     if (result)
     {
-      READ_FROM_PDATASET(DcmUnsignedShort, illumination)
+      READ_FROM_PDATASET(DcmUnsignedShort, EVR_US, illumination)
       if (illumination.getLength() == 0) illumination.putUint16(DEFAULT_illumination, 0);
       // we don't check illumination set by the user (for now)
     }
@@ -2394,7 +2394,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
     // reflectedAmbientLight
     if (result)
     {
-      READ_FROM_PDATASET(DcmUnsignedShort, reflectedAmbientLight)
+      READ_FROM_PDATASET(DcmUnsignedShort, EVR_US, reflectedAmbientLight)
       if (reflectedAmbientLight.getLength() == 0) illumination.putUint16(DEFAULT_reflectedAmbientLight, 0);
       // we don't check reflected ambient light set by the user (for now)
     }
@@ -2412,7 +2412,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
            OFString aString;
            DcmItem *item = seq->getItem(0);
            stack.clear();
-           READ_FROM_DATASET2(DcmUniqueIdentifier, referencedPresentationLUTInstanceUID)
+           READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID)
            if (referencedPresentationLUTInstanceUID.getLength() > 0)
            {
              referencedPresentationLUTInstanceUID.getOFString(aString,0);
@@ -2426,7 +2426,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
                // check referenced SOP class UID
                DcmUniqueIdentifier refClassUID(DCM_ReferencedSOPClassUID);
                stack.clear();
-               READ_FROM_DATASET2(DcmUniqueIdentifier, refClassUID)
+               READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refClassUID)
                if (refClassUID.getLength() > 0)
                {
                   aString.clear();
@@ -2482,7 +2482,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
          OFString aString;
          DcmItem *item = refFilmSessionSequence->getItem(0);
          stack.clear();
-         READ_FROM_DATASET2(DcmUniqueIdentifier, instanceUID)
+         READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, instanceUID)
          if (instanceUID.getLength() > 0)
          {
            instanceUID.getOFString(aString,0);
@@ -2494,7 +2494,7 @@ OFBool DVPSStoredPrint::printSCPCreate(
            } else {
              // check referenced SOP class UID
              stack.clear();
-             READ_FROM_DATASET2(DcmUniqueIdentifier, classUID)
+             READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, classUID)
              if (classUID.getLength() > 0)
              {
                 aString.clear();
@@ -3005,7 +3005,7 @@ OFBool DVPSStoredPrint::printSCPSet(
            OFString aString;
            DcmItem *item = seq->getItem(0);
            stack.clear();
-           READ_FROM_DATASET2(DcmUniqueIdentifier, referencedPresentationLUTInstanceUID)
+           READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, referencedPresentationLUTInstanceUID)
            if (referencedPresentationLUTInstanceUID.getLength() > 0)
            {
              referencedPresentationLUTInstanceUID.getOFString(aString,0);
@@ -3019,7 +3019,7 @@ OFBool DVPSStoredPrint::printSCPSet(
                // check referenced SOP class UID
                DcmUniqueIdentifier refClassUID(DCM_ReferencedSOPClassUID);
                stack.clear();
-               READ_FROM_DATASET2(DcmUniqueIdentifier, refClassUID)
+               READ_FROM_DATASET2(DcmUniqueIdentifier, EVR_UI, refClassUID)
                if (refClassUID.getLength() > 0)
                {
                   aString.clear();
index 1bb9f503e161d121419bfa96dfedf1edf0e37ce0..8e3d49bd4fc7d03fbc95e6233d4c0a4a60519c02 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -67,9 +67,9 @@ OFCondition DVPSSoftcopyVOI::read(DcmItem &dset)
   DcmSequenceOfItems *seq;
   DcmItem *item;
   
-  READ_FROM_DATASET(DcmDecimalString, windowCenter)
-  READ_FROM_DATASET(DcmDecimalString, windowWidth)
-  READ_FROM_DATASET(DcmLongString, windowCenterWidthExplanation)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowCenter)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowWidth)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, windowCenterWidthExplanation)
 
   /* read VOI LUT Sequence */
   if (result==EC_Normal)
index d1d49fb6368761d7ae47fc8837e93365aeb24c45..aefb58e177083b43b041ef250412e9c0022a159d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1999-2010, OFFIS e.V.
+ *  Copyright (C) 1999-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -240,9 +240,9 @@ OFCondition DVPSSoftcopyVOI_PList::createFromImage(
   DcmDecimalString         windowWidth(DCM_WindowWidth);
   DcmLongString            windowCenterWidthExplanation(DCM_WindowCenterWidthExplanation);
 
-  READ_FROM_DATASET(DcmDecimalString, windowCenter)
-  READ_FROM_DATASET(DcmDecimalString, windowWidth)
-  READ_FROM_DATASET(DcmLongString, windowCenterWidthExplanation)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowCenter)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowWidth)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, windowCenterWidthExplanation)
 
   /* read VOI LUT Sequence */
   if (result==EC_Normal)
index 13b978b9bb46ad12bcf3fd4eb470a3df0214147f..639d355135efb620862d904137841c98ab11bbaf 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -64,14 +64,14 @@ OFCondition DVPSTextObject::read(DcmItem &dset)
   OFCondition result = EC_Normal;
   DcmStack stack;
 
-  READ_FROM_DATASET(DcmCodeString, boundingBoxAnnotationUnits)
-  READ_FROM_DATASET(DcmCodeString, anchorPointAnnotationUnits)
-  READ_FROM_DATASET(DcmShortText, unformattedTextValue)
-  READ_FROM_DATASET(DcmFloatingPointSingle, boundingBoxTLHC)
-  READ_FROM_DATASET(DcmFloatingPointSingle, boundingBoxBRHC)
-  READ_FROM_DATASET(DcmCodeString, boundingBoxTextHorizontalJustification)
-  READ_FROM_DATASET(DcmFloatingPointSingle, anchorPoint)
-  READ_FROM_DATASET(DcmCodeString, anchorPointVisibility)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, boundingBoxAnnotationUnits)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, anchorPointAnnotationUnits)
+  READ_FROM_DATASET(DcmShortText, EVR_ST, unformattedTextValue)
+  READ_FROM_DATASET(DcmFloatingPointSingle, EVR_FL, boundingBoxTLHC)
+  READ_FROM_DATASET(DcmFloatingPointSingle, EVR_FL, boundingBoxBRHC)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, boundingBoxTextHorizontalJustification)
+  READ_FROM_DATASET(DcmFloatingPointSingle, EVR_FL, anchorPoint)
+  READ_FROM_DATASET(DcmCodeString, EVR_CS, anchorPointVisibility)
   
   /* Now perform basic sanity checks */
   
index 8da24c717bbe89808cd4f90af41189111e0eb873..b10b83f20dc86a7564d66d4eeb992c0a86148649 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -59,9 +59,9 @@ OFCondition DVPSVOILUT::read(DcmItem &dset)
   OFCondition result = EC_Normal;
   DcmStack stack;
 
-  READ_FROM_DATASET(DcmUnsignedShort, voiLUTDescriptor)
-  READ_FROM_DATASET(DcmLongString, voiLUTExplanation)
-  READ_FROM_DATASET(DcmUnsignedShort, voiLUTData)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, voiLUTDescriptor)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, voiLUTExplanation)
+  READ_FROM_DATASET(DcmUnsignedShort, EVR_US, voiLUTData)
 
   if (EC_Normal == result)
   {
index 431d2ca307c4ab16b4a3a8142ef0d773a8bd8039..120dd568fad6646889103c8355d730fad1e9021d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -72,9 +72,9 @@ OFCondition DVPSVOIWindow_PList::read(DcmItem &dset)
   DcmDecimalString windowWidth(DCM_WindowWidth);
   DcmLongString windowCenterWidthExplanation(DCM_WindowCenterWidthExplanation);
 
-  READ_FROM_DATASET(DcmDecimalString, windowCenter)
-  READ_FROM_DATASET(DcmDecimalString, windowWidth)
-  READ_FROM_DATASET(DcmLongString, windowCenterWidthExplanation)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowCenter)
+  READ_FROM_DATASET(DcmDecimalString, EVR_DS, windowWidth)
+  READ_FROM_DATASET(DcmLongString, EVR_LO, windowCenterWidthExplanation)
 
   DcmLongString *expl=NULL;
   if (windowCenterWidthExplanation.getVM() > 0) expl = &windowCenterWidthExplanation;
index 16d372c30dbe5a9d0642100a40db191390f18fd8..7ff6502c2e475ab2846e95b064b1e64d566124d2 100644 (file)
@@ -35,6 +35,7 @@ msgserv.o: msgserv.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -44,6 +45,7 @@ msgserv.o: msgserv.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \
index b34b9c9804946b8965e22bfe2094dc0610e4a628..a4ed2771c50df1f7485122cb32d1f4505835d11d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -23,6 +23,7 @@
 
 #ifdef HAVE_WINDOWS_H
 #include <winsock2.h>
+#include <ws2tcpip.h>
 #elif defined(HAVE_WINSOCK_H)
 #include <winsock.h>  /* include winsock.h directly i.e. on MacOS */
 #endif
index 0c0d3aefbb2805f03f3362489ec601d82fe9fa17..b083d01aefdb5255f732b2aaff40dd23f00ceddf 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmqrdb)
+project(dcmqrdb)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmqrdb_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmnet_SOURCE_DIR}/include" ${ZLIB_INCDIR})
+include_directories("${dcmqrdb_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmnet_SOURCE_DIR}/include" ${ZLIB_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc apps include docs etc)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc apps include docs etc)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 43b593617e3669ed27cee28a2595b1c8b722857e..7dc4b3c452a6aa5bf00cb25848c9ef3718d0df0b 100644 (file)
@@ -1,9 +1,9 @@
 # declare executables
-FOREACH(PROGRAM dcmqrscp dcmqridx dcmqrti)
+foreach(PROGRAM dcmqrscp dcmqridx dcmqrti)
   DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
-ENDFOREACH(PROGRAM)
+endforeach()
 
 # make sure executables are linked to the corresponding libraries
-FOREACH(PROGRAM dcmqrscp dcmqridx dcmqrti)
+foreach(PROGRAM dcmqrscp dcmqridx dcmqrti)
   DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmqrdb dcmnet dcmdata oflog ofstd)
-ENDFOREACH(PROGRAM)
+endforeach()
index ab45577107f5a18e8019f7901a053a462cebb1a7..9b1de2523dc745da63e0ee3d04ad420201184fe6 100644 (file)
@@ -7,17 +7,19 @@ dcmqridx.o: dcmqridx.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdict.h \
  ../../dcmdata/include/dcmtk/dcmdata/dchashdi.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -85,17 +87,19 @@ dcmqrscp.o: dcmqrscp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmnet/include/dcmtk/dcmnet/dicom.h \
  ../../dcmnet/include/dcmtk/dcmnet/cond.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -216,12 +220,14 @@ dcmqrti.o: dcmqrti.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/assoc.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
index d36f1323b2577de2caa6c29db00f36ce24d4b270..bdfa25b6df6d229fe5e6df809b7ba7e10a4245be 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1993-2017, OFFIS e.V.
+ *  Copyright (C) 1993-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -155,11 +155,11 @@ int main (int argc, char *argv[])
             else
             {
                 OFLOG_INFO(dcmqridxLogger, "registering: " << opt_imageFile);
-                if (DU_findSOPClassAndInstanceInFile(opt_imageFile, sclass, sinst))
+                if (DU_findSOPClassAndInstanceInFile(opt_imageFile, sclass, sizeof(sclass), sinst, sizeof(sinst)))
                 {
 #ifdef DEBUG
                     /*** Test what filename is recommended by DB_Module **/
-                    hdl.makeNewStoreFileName (sclass, sinst, fname;
+                    hdl.makeNewStoreFileName (sclass, sinst, fname, sizeof(fname));
                     OFLOG_DEBUG(dcmqridxLogger, "DB_Module recommends " << fname << " for filename");
 #endif
                     hdl.storeRequest(sclass, sinst, opt_imageFile, &status, opt_isNewFlag) ;
index e3cad0e587816254d7da7fe0f678c5283a1c02d3..36cad869393198e103d5fa17da2e5067f952d9ce 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1993-2017, OFFIS e.V.
+ *  Copyright (C) 1993-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -138,8 +138,8 @@ main(int argc, char *argv[])
 
   cmd.setOptionColumns(LONGCOL, SHORTCOL);
   cmd.addGroup("general options:", LONGCOL, SHORTCOL + 2);
-    cmd.addOption("--help",                     "-h",        "print this help text and exit", OFCommandLine::AF_Exclusive);
-    cmd.addOption("--version",                               "print version information and exit", OFCommandLine::AF_Exclusive);
+    cmd.addOption("--help",                     "-h",      "print this help text and exit", OFCommandLine::AF_Exclusive);
+    cmd.addOption("--version",                             "print version information and exit", OFCommandLine::AF_Exclusive);
     OFLog::addOptions(cmd);
 
     if (strlen(opt_configFileName) > 16)
@@ -147,113 +147,117 @@ main(int argc, char *argv[])
         OFString opt5 = "use specific configuration file\n(default: ";
         opt5 += opt_configFileName;
         opt5 += ")";
-        cmd.addOption("--config",               "-c",     1, "[f]ilename: string", opt5.c_str());
+        cmd.addOption("--config",               "-c",   1, "[f]ilename: string",
+                                                           opt5.c_str());
     } else {
         OFString opt5 = "[f]ilename: string (default: ";
         opt5 += opt_configFileName;
         opt5 += ")";
-        cmd.addOption("--config",               "-c",     1, opt5.c_str(), "use specific configuration file");
+        cmd.addOption("--config",               "-c",   1, opt5.c_str(),
+                                                           "use specific configuration file");
     }
 #ifdef HAVE_FORK
   cmd.addGroup("multi-process options:", LONGCOL, SHORTCOL + 2);
-    cmd.addOption("--single-process",           "-s",        "single process mode");
-    cmd.addOption("--fork",                                  "fork child process for each assoc. (default)");
+    cmd.addOption("--single-process",           "-s",      "single process mode");
+    cmd.addOption("--fork",                                "fork child process for each assoc. (default)");
 #endif
 
   cmd.addGroup("database options:");
     cmd.addSubGroup("association negotiation:");
-      cmd.addOption("--require-find",                        "reject all MOVE/GET presentation contexts for\nwhich no correspond. FIND context is proposed");
-      cmd.addOption("--no-parallel-store",                   "reject multiple simultaneous STORE presentat.\ncontexts for one application entity title");
-      cmd.addOption("--disable-get",                         "disable C-GET support");
-      cmd.addOption("--allow-shutdown",                      "allow external shutdown via private SOP class");
+      cmd.addOption("--require-find",                      "reject all MOVE/GET presentation contexts for\nwhich no correspond. FIND context is proposed");
+      cmd.addOption("--no-parallel-store",                 "reject multiple simultaneous STORE presentat.\ncontexts for one application entity title");
+      cmd.addOption("--disable-get",                       "disable C-GET support");
+      cmd.addOption("--allow-shutdown",                    "allow external shutdown via private SOP class");
     cmd.addSubGroup("checking identifier validity:");
-      cmd.addOption("--check-find",             "-XF",       "check C-FIND identifier validity");
-      cmd.addOption("--no-check-find",                       "do not check C-FIND identifier validity (def.)");
-      cmd.addOption("--check-move",             "-XM",       "check C-MOVE identifier validity");
-      cmd.addOption("--no-check-move",                       "do not check C-MOVE identifier validity (def.)");
+      cmd.addOption("--check-find",             "-XF",     "check C-FIND identifier validity");
+      cmd.addOption("--no-check-find",                     "do not check C-FIND identifier validity (def.)");
+      cmd.addOption("--check-move",             "-XM",     "check C-MOVE identifier validity");
+      cmd.addOption("--no-check-move",                     "do not check C-MOVE identifier validity (def.)");
     cmd.addSubGroup("restriction of move targets:");
-      cmd.addOption("--move-unrestricted",                   "do not restrict move destination (default)");
-      cmd.addOption("--move-aetitle",           "-ZA",       "restrict move dest. to requesting AE title");
-      cmd.addOption("--move-host",              "-ZH",       "restrict move destination to requesting host");
-      cmd.addOption("--move-vendor",            "-ZV",       "restrict move destination to requesting vendor");
+      cmd.addOption("--move-unrestricted",                 "do not restrict move destination (default)");
+      cmd.addOption("--move-aetitle",           "-ZA",     "restrict move dest. to requesting AE title");
+      cmd.addOption("--move-host",              "-ZH",     "restrict move destination to requesting host");
+      cmd.addOption("--move-vendor",            "-ZV",     "restrict move destination to requesting vendor");
     cmd.addSubGroup("restriction of query/retrieve models:");
-      cmd.addOption("--no-patient-root",        "-QP",       "do not support Patient Root Q/R models");
-      cmd.addOption("--no-study-root",          "-QS",       "do not support Study Root Q/R models");
+      cmd.addOption("--no-patient-root",        "-QP",     "do not support Patient Root Q/R models");
+      cmd.addOption("--no-study-root",          "-QS",     "do not support Study Root Q/R models");
 #ifndef NO_PATIENTSTUDYONLY_SUPPORT
-      cmd.addOption("--no-patient-study",       "-QO",       "do not support Patient/Study Only Q/R models");
+      cmd.addOption("--no-patient-study",       "-QO",     "do not support Patient/Study Only Q/R models");
 #endif
 
   cmd.addGroup("network options:");
     cmd.addSubGroup("association negotiation profiles from configuration file:");
-      cmd.addOption("--assoc-config-file",      "-xf",  3,   "[f]ilename, [i]n-profile, [o]ut-profile: string",
-                                                             "use profile i from f for incoming associations\n"
-                                                             "use profile o from f for outgoing associations");
+      cmd.addOption("--assoc-config-file",      "-xf",  3, "[f]ilename, [i]n-profile, [o]ut-profile: string",
+                                                           "use profile i from f for incoming associations\nuse profile o from f for outgoing associations");
     cmd.addSubGroup("preferred network transfer syntaxes (incoming associations):");
-      cmd.addOption("--prefer-uncompr",         "+x=",       "prefer explicit VR local byte order (default)");
-      cmd.addOption("--prefer-little",          "+xe",       "prefer explicit VR little endian TS");
-      cmd.addOption("--prefer-big",             "+xb",       "prefer explicit VR big endian TS");
+      cmd.addOption("--prefer-uncompr",         "+x=",     "prefer explicit VR local byte order (default)");
+      cmd.addOption("--prefer-little",          "+xe",     "prefer explicit VR little endian TS");
+      cmd.addOption("--prefer-big",             "+xb",     "prefer explicit VR big endian TS");
 #ifndef DISABLE_COMPRESSION_EXTENSION
-      cmd.addOption("--prefer-lossless",        "+xs",       "prefer default JPEG lossless TS");
-      cmd.addOption("--prefer-jpeg8",           "+xy",       "prefer default JPEG lossy TS for 8 bit data");
-      cmd.addOption("--prefer-jpeg12",          "+xx",       "prefer default JPEG lossy TS for 12 bit data");
-      cmd.addOption("--prefer-j2k-lossless",    "+xv",       "prefer JPEG 2000 lossless TS");
-      cmd.addOption("--prefer-j2k-lossy",       "+xw",       "prefer JPEG 2000 lossy TS");
-      cmd.addOption("--prefer-jls-lossless",    "+xt",       "prefer JPEG-LS lossless TS");
-      cmd.addOption("--prefer-jls-lossy",       "+xu",       "prefer JPEG-LS lossy TS");
-      cmd.addOption("--prefer-mpeg2",           "+xm",       "prefer MPEG2 Main Profile @ Main Level TS");
-      cmd.addOption("--prefer-mpeg2-high",      "+xh",       "prefer MPEG2 Main Profile @ High Level TS");
-      cmd.addOption("--prefer-mpeg4",           "+xn",       "prefer MPEG4 AVC/H.264 HP / Level 4.1 TS");
-      cmd.addOption("--prefer-mpeg4-bd",        "+xl",       "prefer MPEG4 AVC/H.264 BD-compatible TS");
-      cmd.addOption("--prefer-mpeg4-2-2d",      "+x2",       "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (2D)");
-      cmd.addOption("--prefer-mpeg4-2-3d",      "+x3",       "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (3D)");
-      cmd.addOption("--prefer-mpeg4-2-st",      "+xo",       "prefer MPEG4 AVC/H.264 Stereo / Level 4.2 TS");
-      cmd.addOption("--prefer-hevc",            "+x4",       "prefer HEVC/H.265 Main Profile / Level 5.1 TS");
-      cmd.addOption("--prefer-hevc10",          "+x5",       "prefer HEVC/H.265 Main 10 Profile / Level 5.1 TS");
-      cmd.addOption("--prefer-rle",             "+xr",       "prefer RLE lossless TS");
+      cmd.addOption("--prefer-lossless",        "+xs",     "prefer default JPEG lossless TS");
+      cmd.addOption("--prefer-jpeg8",           "+xy",     "prefer default JPEG lossy TS for 8 bit data");
+      cmd.addOption("--prefer-jpeg12",          "+xx",     "prefer default JPEG lossy TS for 12 bit data");
+      cmd.addOption("--prefer-j2k-lossless",    "+xv",     "prefer JPEG 2000 lossless TS");
+      cmd.addOption("--prefer-j2k-lossy",       "+xw",     "prefer JPEG 2000 lossy TS");
+      cmd.addOption("--prefer-jls-lossless",    "+xt",     "prefer JPEG-LS lossless TS");
+      cmd.addOption("--prefer-jls-lossy",       "+xu",     "prefer JPEG-LS lossy TS");
+      cmd.addOption("--prefer-mpeg2",           "+xm",     "prefer MPEG2 Main Profile @ Main Level TS");
+      cmd.addOption("--prefer-mpeg2-high",      "+xh",     "prefer MPEG2 Main Profile @ High Level TS");
+      cmd.addOption("--prefer-mpeg4",           "+xn",     "prefer MPEG4 AVC/H.264 HP / Level 4.1 TS");
+      cmd.addOption("--prefer-mpeg4-bd",        "+xl",     "prefer MPEG4 AVC/H.264 BD-compatible TS");
+      cmd.addOption("--prefer-mpeg4-2-2d",      "+x2",     "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (2D)");
+      cmd.addOption("--prefer-mpeg4-2-3d",      "+x3",     "prefer MPEG4 AVC/H.264 HP / Level 4.2 TS (3D)");
+      cmd.addOption("--prefer-mpeg4-2-st",      "+xo",     "prefer MPEG4 AVC/H.264 Stereo / Level 4.2 TS");
+      cmd.addOption("--prefer-hevc",            "+x4",     "prefer HEVC/H.265 Main Profile / Level 5.1 TS");
+      cmd.addOption("--prefer-hevc10",          "+x5",     "prefer HEVC/H.265 Main 10 Profile / Level 5.1 TS");
+      cmd.addOption("--prefer-rle",             "+xr",     "prefer RLE lossless TS");
 #ifdef WITH_ZLIB
-      cmd.addOption("--prefer-deflated",        "+xd",       "prefer deflated expl. VR little endian TS");
+      cmd.addOption("--prefer-deflated",        "+xd",     "prefer deflated expl. VR little endian TS");
 #endif
 #endif
-      cmd.addOption("--implicit",               "+xi",       "accept implicit VR little endian TS only");
+      cmd.addOption("--implicit",               "+xi",     "accept implicit VR little endian TS only");
 
 #ifndef DISABLE_COMPRESSION_EXTENSION
     cmd.addSubGroup("proposed transmission transfer syntaxes (outgoing associations):");
-      cmd.addOption("--propose-uncompr",        "-x=",       "propose all uncompressed TS, explicit VR\nwith local byte ordering first (default)");
-      cmd.addOption("--propose-little",         "-xe",       "propose all uncompressed TS, explicit VR\nlittle endian first");
-      cmd.addOption("--propose-big",            "-xb",       "propose all uncompressed TS, explicit VR\nbig endian first");
-      cmd.addOption("--propose-implicit",       "-xi",       "propose implicit VR little endian TS only");
-      cmd.addOption("--propose-lossless",       "-xs",       "propose default JPEG lossless TS\nand all uncompressed transfer syntaxes");
-      cmd.addOption("--propose-jpeg8",          "-xy",       "propose default JPEG lossy TS for 8 bit data\nand all uncompressed transfer syntaxes");
-      cmd.addOption("--propose-jpeg12",         "-xx",       "propose default JPEG lossy TS for 12 bit data\nand all uncompressed transfer syntaxes");
-      cmd.addOption("--propose-j2k-lossless",   "-xv",       "propose JPEG 2000 lossless TS\nand all uncompressed transfer syntaxes");
-      cmd.addOption("--propose-j2k-lossy",      "-xw",       "propose JPEG 2000 lossy TS\nand all uncompressed transfer syntaxes");
-      cmd.addOption("--propose-jls-lossless",   "-xt",       "propose JPEG-LS lossless TS\nand all uncompressed transfer syntaxes");
-      cmd.addOption("--propose-jls-lossy",      "-xu",       "propose JPEG-LS lossy TS\nand all uncompressed transfer syntaxes");
-      cmd.addOption("--propose-mpeg2",          "-xm",       "propose MPEG2 Main Profile @ Main Level TS");
-      cmd.addOption("--propose-mpeg2-high",     "-xh",       "propose MPEG2 Main Profile @ High Level TS");
-      cmd.addOption("--propose-mpeg4",          "-xn",       "propose MPEG4 AVC/H.264 HP / Level 4.1 TS");
-      cmd.addOption("--propose-mpeg4-bd",       "-xl",       "propose MPEG4 AVC/H.264 BD-compatible TS");
-      cmd.addOption("--propose-mpeg4-2-2d",     "-x2",       "propose MPEG4 AVC/H.264 HP / Level 4.2 TS (2D)");
-      cmd.addOption("--propose-mpeg4-2-3d",     "-x3",       "propose MPEG4 AVC/H.264 HP / Level 4.2 TS (3D)");
-      cmd.addOption("--propose-mpeg4-2-st",     "-xo",       "propose MPEG4 AVC/H.264 Stereo / Level 4.2 TS");
-      cmd.addOption("--propose-hevc",           "-x4",       "propose HEVC/H.265 Main Profile / Level 5.1 TS");
-      cmd.addOption("--propose-hevc10",         "-x5",       "propose HEVC/H.265 Main 10 Profile / Level 5.1 TS");
-      cmd.addOption("--propose-rle",            "-xr",       "propose RLE lossless TS\nand all uncompressed transfer syntaxes");
+      cmd.addOption("--propose-uncompr",        "-x=",     "propose all uncompressed TS, explicit VR\nwith local byte ordering first (default)");
+      cmd.addOption("--propose-little",         "-xe",     "propose all uncompressed TS, explicit VR\nlittle endian first");
+      cmd.addOption("--propose-big",            "-xb",     "propose all uncompressed TS, explicit VR\nbig endian first");
+      cmd.addOption("--propose-implicit",       "-xi",     "propose implicit VR little endian TS only");
+      cmd.addOption("--propose-lossless",       "-xs",     "propose default JPEG lossless TS\nand all uncompressed transfer syntaxes");
+      cmd.addOption("--propose-jpeg8",          "-xy",     "propose default JPEG lossy TS for 8 bit data\nand all uncompressed transfer syntaxes");
+      cmd.addOption("--propose-jpeg12",         "-xx",     "propose default JPEG lossy TS for 12 bit data\nand all uncompressed transfer syntaxes");
+      cmd.addOption("--propose-j2k-lossless",   "-xv",     "propose JPEG 2000 lossless TS\nand all uncompressed transfer syntaxes");
+      cmd.addOption("--propose-j2k-lossy",      "-xw",     "propose JPEG 2000 lossy TS\nand all uncompressed transfer syntaxes");
+      cmd.addOption("--propose-jls-lossless",   "-xt",     "propose JPEG-LS lossless TS\nand all uncompressed transfer syntaxes");
+      cmd.addOption("--propose-jls-lossy",      "-xu",     "propose JPEG-LS lossy TS\nand all uncompressed transfer syntaxes");
+      cmd.addOption("--propose-mpeg2",          "-xm",     "propose MPEG2 Main Profile @ Main Level TS");
+      cmd.addOption("--propose-mpeg2-high",     "-xh",     "propose MPEG2 Main Profile @ High Level TS");
+      cmd.addOption("--propose-mpeg4",          "-xn",     "propose MPEG4 AVC/H.264 HP / Level 4.1 TS");
+      cmd.addOption("--propose-mpeg4-bd",       "-xl",     "propose MPEG4 AVC/H.264 BD-compatible TS");
+      cmd.addOption("--propose-mpeg4-2-2d",     "-x2",     "propose MPEG4 AVC/H.264 HP / Level 4.2 TS (2D)");
+      cmd.addOption("--propose-mpeg4-2-3d",     "-x3",     "propose MPEG4 AVC/H.264 HP / Level 4.2 TS (3D)");
+      cmd.addOption("--propose-mpeg4-2-st",     "-xo",     "propose MPEG4 AVC/H.264 Stereo / Level 4.2 TS");
+      cmd.addOption("--propose-hevc",           "-x4",     "propose HEVC/H.265 Main Profile / Level 5.1 TS");
+      cmd.addOption("--propose-hevc10",         "-x5",     "propose HEVC/H.265 Main 10 Profile / Level 5.1 TS");
+      cmd.addOption("--propose-rle",            "-xr",     "propose RLE lossless TS\nand all uncompressed transfer syntaxes");
 #ifdef WITH_ZLIB
-      cmd.addOption("--propose-deflated",       "-xd",       "propose deflated expl. VR little endian TS\nand all uncompressed transfer syntaxes");
+      cmd.addOption("--propose-deflated",       "-xd",     "propose deflated expl. VR little endian TS\nand all uncompressed transfer syntaxes");
 #endif
 #endif
 
 #ifdef WITH_TCPWRAPPER
     cmd.addSubGroup("network host access control (tcp wrapper):");
-      cmd.addOption("--access-full",            "-ac",       "accept connections from any host (default)");
-      cmd.addOption("--access-control",         "+ac",       "enforce host access control rules");
+      cmd.addOption("--access-full",            "-ac",     "accept connections from any host (default)");
+      cmd.addOption("--access-control",         "+ac",     "enforce host access control rules");
 #endif
 
     cmd.addSubGroup("other network options:");
-      cmd.addOption("--timeout",                "-to",    1, "[s]econds: integer (default: unlimited)", "timeout for connection requests");
-      cmd.addOption("--acse-timeout",           "-ta",    1, "[s]econds: integer (default: 30)", "timeout for ACSE messages");
-      cmd.addOption("--dimse-timeout",          "-td",    1, "[s]econds: integer (default: unlimited)", "timeout for DIMSE messages");
+      cmd.addOption("--timeout",                "-to",  1, "[s]econds: integer (default: unlimited)",
+                                                           "timeout for connection requests");
+      cmd.addOption("--acse-timeout",           "-ta",  1, "[s]econds: integer (default: 30)",
+                                                           "timeout for ACSE messages");
+      cmd.addOption("--dimse-timeout",          "-td",  1, "[s]econds: integer (default: unlimited)",
+                                                           "timeout for DIMSE messages");
       OFString opt4 = "[n]umber of bytes: integer (";
       sprintf(tempstr, "%ld", (long)ASC_MINIMUMPDUSIZE);
       opt4 += tempstr;
@@ -261,73 +265,68 @@ main(int argc, char *argv[])
       sprintf(tempstr, "%ld", (long)ASC_MAXIMUMPDUSIZE);
       opt4 += tempstr;
       opt4 += ")";
-      cmd.addOption("--max-pdu",                "-pdu",   1, opt4.c_str(), "set max receive pdu to n bytes\n(default: use value from configuration file)");
-      cmd.addOption("--disable-host-lookup",    "-dhl",      "disable hostname lookup");
-      cmd.addOption("--refuse",                              "refuse association");
-      cmd.addOption("--reject",                              "reject association if no implement. class UID");
-      cmd.addOption("--ignore",                              "ignore store data, receive but do not store");
-      cmd.addOption("--uid-padding",            "-up",       "silently correct space-padded UIDs");
-
-  cmd.addGroup("encoding options:");
-    cmd.addSubGroup("post-1993 value representations:");
-      cmd.addOption("--enable-new-vr",          "+u",        "enable support for new VRs (UN/UT) (default)");
-      cmd.addOption("--disable-new-vr",         "-u",        "disable support for new VRs, convert to OB");
+      cmd.addOption("--max-pdu",                "-pdu", 1, opt4.c_str(),
+                                                           "set max receive pdu to n bytes\n(default: use value from configuration file)");
+      cmd.addOption("--disable-host-lookup",    "-dhl",    "disable hostname lookup");
+      cmd.addOption("--refuse",                            "refuse association");
+      cmd.addOption("--reject",                            "reject association if no implement. class UID");
+      cmd.addOption("--ignore",                            "ignore store data, receive but do not store");
+      cmd.addOption("--uid-padding",            "-up",     "silently correct space-padded UIDs");
+
+#ifdef DCMTK_ENABLE_CHARSET_CONVERSION
+  cmd.addGroup("processing options:");
+    cmd.addSubGroup("specific character set:");
+      cmd.addOption("--use-request-charset",    "+Cr",     "try to convert all element values that are\naffected by Specific Character Set (0008,0005)\n"
+                                                           "to the one specified in the request data set,\nfall back to the one specified via\n"
+                                                           "--convert-to-xxx if that is not possible\n(default, unless overridden by config file)");
+      cmd.addOption("--override-charset",       "-Cr",     "convert affected element values to the\ncharacter set specified via --convert-to-xxx,\n"
+                                                           "ignoring the one specified in the request");
+      cmd.addOption("--convert-to-ascii",       "+A7",     "convert affected element values to 7-bit ASCII\n(default, unless overridden by config file)");
+      cmd.addOption("--convert-to-utf8",        "+U8",     "convert affected element values to UTF-8");
+      cmd.addOption("--convert-to-latin1",      "+L1",     "convert affected element values to ISO 8859-1");
+      cmd.addOption("--convert-to-charset",     "+C",   1, "[c]harset: string",
+                                                           "convert affected element values to the char.\nset specified by the DICOM defined term c");
+      cmd.addOption("--transliterate",          "-Ct",     "try to approximate characters that cannot be\nrepresented through similar looking characters");
+      cmd.addOption("--discard-illegal",        "-Cd",     "discard characters that cannot be represented\nin destination character set");
+#endif
 
   cmd.addGroup("output options:");
     cmd.addSubGroup("bit preserving mode:");
-      cmd.addOption("--normal",                 "-B",        "allow implicit format conversions (default)");
-      cmd.addOption("--bit-preserving",         "+B",        "write data exactly as read");
+      cmd.addOption("--normal",                 "-B",      "allow implicit format conversions (default)");
+      cmd.addOption("--bit-preserving",         "+B",      "write data exactly as read");
     cmd.addSubGroup("output file format:");
-      cmd.addOption("--write-file",             "+F",        "write file format (default)");
-      cmd.addOption("--write-dataset",          "-F",        "write data set without file meta information");
+      cmd.addOption("--write-file",             "+F",      "write file format (default)");
+      cmd.addOption("--write-dataset",          "-F",      "write data set without file meta information");
     cmd.addSubGroup("output transfer syntax (not with --bit-preserving or compressed transmission):");
-      cmd.addOption("--write-xfer-same",        "+t=",       "write with same TS as input (default)");
-      cmd.addOption("--write-xfer-little",      "+te",       "write with explicit VR little endian TS");
-      cmd.addOption("--write-xfer-big",         "+tb",       "write with explicit VR big endian TS");
-      cmd.addOption("--write-xfer-implicit",    "+ti",       "write with implicit VR little endian TS");
+      cmd.addOption("--write-xfer-same",        "+t=",     "write with same TS as input (default)");
+      cmd.addOption("--write-xfer-little",      "+te",     "write with explicit VR little endian TS");
+      cmd.addOption("--write-xfer-big",         "+tb",     "write with explicit VR big endian TS");
+      cmd.addOption("--write-xfer-implicit",    "+ti",     "write with implicit VR little endian TS");
 #ifdef WITH_ZLIB
-      cmd.addOption("--write-xfer-deflated",    "+td",       "write with deflated expl. VR little endian TS");
+      cmd.addOption("--write-xfer-deflated",    "+td",     "write with deflated expl. VR little endian TS");
 #endif
+    cmd.addSubGroup("post-1993 value representations:");
+      cmd.addOption("--enable-new-vr",          "+u",      "enable support for new VRs (UN/UT) (default)");
+      cmd.addOption("--disable-new-vr",         "-u",      "disable support for new VRs, convert to OB");
     cmd.addSubGroup("group length encoding (not with --bit-preserving):");
-      cmd.addOption("--group-length-recalc",    "+g=",       "recalculate group lengths if present (default)");
-      cmd.addOption("--group-length-create",    "+g",        "always write with group length elements");
-      cmd.addOption("--group-length-remove",    "-g",        "always write without group length elements");
+      cmd.addOption("--group-length-recalc",    "+g=",     "recalculate group lengths if present (default)");
+      cmd.addOption("--group-length-create",    "+g",      "always write with group length elements");
+      cmd.addOption("--group-length-remove",    "-g",      "always write without group length elements");
     cmd.addSubGroup("length encoding in sequences and items (not with --bit-preserving):");
-      cmd.addOption("--length-explicit",        "+e",        "write with explicit lengths (default)");
-      cmd.addOption("--length-undefined",       "-e",        "write with undefined lengths");
+      cmd.addOption("--length-explicit",        "+e",      "write with explicit lengths (default)");
+      cmd.addOption("--length-undefined",       "-e",      "write with undefined lengths");
     cmd.addSubGroup("data set trailing padding (not with --write-dataset or --bit-preserving):");
-      cmd.addOption("--padding-off",            "-p",        "no padding (default)");
-      cmd.addOption("--padding-create",         "+p",    2,  "[f]ile-pad [i]tem-pad: integer", "align file on multiple of f bytes\nand items on multiple of i bytes");
+      cmd.addOption("--padding-off",            "-p",      "no padding (default)");
+      cmd.addOption("--padding-create",         "+p",   2, "[f]ile-pad [i]tem-pad: integer",
+                                                           "align file on multiple of f bytes\nand items on multiple of i bytes");
 #ifdef WITH_ZLIB
 #ifdef DISABLE_COMPRESSION_EXTENSION
     cmd.addSubGroup("deflate compression level (only with --write-xfer-deflated/same):");
 #else
     cmd.addSubGroup("deflate compression level (only with -xd or --write-xfer-deflated/same):");
 #endif
-      cmd.addOption("--compression-level",      "+cl",   1, "[l]evel: integer (default: 6)",
-                                                            "0=uncompressed, 1=fastest, 9=best compression");
-#endif
-
-#ifdef DCMTK_ENABLE_CHARSET_CONVERSION
-    cmd.addSubGroup("specific character set:");
-      cmd.addOption("--use-request-charset",    "+Cr",    "try to convert all element values that are\n"
-                                                          "affected by Specific Character Set (0008,0005)\n"
-                                                          "to the one specified in the request data set,\n"
-                                                          "fall back to the one specified via\n"
-                                                          "--convert-to-xxx if that is not possible\n"
-                                                          "(default, unless overridden by config file)");
-      cmd.addOption("--override-charset",       "-Cr",    "convert affected element values to the character\n"
-                                                          "set specified via --convert-to-xxx, ignoring\n"
-                                                          "the one specified in the request");
-      cmd.addOption("--convert-to-ascii",       "+A7",    "convert affected element values to 7-bit ASCII\n"
-                                                          "(default, unless overridden by config file)");
-      cmd.addOption("--convert-to-utf8",        "+U8",    "convert affected element values to UTF-8");
-      cmd.addOption("--convert-to-latin1",      "+L1",    "convert affected element values to ISO 8859-1");
-      cmd.addOption("--convert-to-charset",     "+C",  1, "[c]harset: string",
-                                                          "convert affected element values to the character\n"
-                                                          "set specified by the DICOM defined term c");
-      cmd.addOption("--transliterate",          "-Ct",    "try to approximate characters that cannot be\nrepresented through similar looking characters");
-      cmd.addOption("--discard-illegal",        "-Cd",    "discard characters that cannot be represented\nin destination character set");
+      cmd.addOption("--compression-level",      "+cl",  1, "[l]evel: integer (default: 6)",
+                                                           "0=uncompressed, 1=fastest, 9=best compression");
 #endif
 
     /* evaluate command line */
@@ -589,11 +588,6 @@ main(int argc, char *argv[])
         }
       }
 
-      cmd.beginOptionBlock();
-      if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs();
-      if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs();
-      cmd.endOptionBlock();
-
       cmd.beginOptionBlock();
       if (cmd.findOption("--normal")) options.bitPreserving_ = OFFalse;
       if (cmd.findOption("--bit-preserving")) options.bitPreserving_ = OFTrue;
@@ -709,6 +703,11 @@ main(int argc, char *argv[])
 #endif
       cmd.endOptionBlock();
 
+      cmd.beginOptionBlock();
+      if (cmd.findOption("--enable-new-vr")) dcmEnableGenerationOfNewVRs();
+      if (cmd.findOption("--disable-new-vr")) dcmDisableGenerationOfNewVRs();
+      cmd.endOptionBlock();
+
       cmd.beginOptionBlock();
       if (cmd.findOption("--group-length-recalc"))
       {
index 06cbf5f55b56598baa97326e832f262398bbed6a..ec15335fd100e672ddecec23223213e185bc6fd0 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES dcmqrcnf.txt dcmqrset.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc)
+install(FILES dcmqrcnf.txt dcmqrset.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc)
index 37eb07b043c2e10aba38acdb78d088ab92d686f8..eeb7d7b9b6a56ff5bdd90965644dbe8407fe08b7 100644 (file)
@@ -3,11 +3,11 @@ Configuration
 
 1. Configuration File
 
-The dcmqrscp and dcmqrti applications are configured via a configuration file. 
-This configuration file defines global options, known Peer Application 
-Entities (AEs), groups of Peer AEs belonging to the same vendor, local AEs 
-(storage areas) and options specific to individual storage areas (file system 
-path, read/write premission, quota and access permission for Peer AEs).
+The dcmqrscp and dcmqrti applications are configured via a configuration file.
+This configuration file defines global options, known Peer Application
+Entities (AEs), groups of Peer AEs belonging to the same vendor, local AEs
+(storage areas) and options specific to individual storage areas (file system
+path, read/write permission, quota and access permission for Peer AEs).
 
 There are four different parts in the configuration file:
 
@@ -16,14 +16,14 @@ There are four different parts in the configuration file:
  3. Vendor Table
  4. Application Entity Table
 
-All lines in this parts define one option and the entries in one line are 
-seperated by white spaces.  Blank lines and lines which begin with a "#" will 
-be ignored.  They can be used for structuring and as comments. The first entry 
-in one line is the keyword.  All the other entries in the line will be the 
-desired values.  A string value which should include spaces must be enclosed 
-with quotes.  Known quote characters are """, "'", "(" and ")". An integer 
-value must not enclosed with quotes.  A "=" may be used in addition to the 
-white spaces between the two different entry types, a "," may be used in a 
+All lines in this parts define one option and the entries in one line are
+separated by white spaces.  Blank lines and lines which begin with a "#" will
+be ignored.  They can be used for structuring and as comments. The first entry
+in one line is the keyword.  All the other entries in the line will be the
+desired values.  A string value which should include spaces must be enclosed
+with quotes.  Known quote characters are """, "'", "(" and ")". An integer
+value must not enclosed with quotes.  A "=" may be used in addition to the
+white spaces between the two different entry types, a "," may be used in a
 value list.
 
 1.1. Global Parameters
@@ -37,7 +37,7 @@ SpecificCharacterSet - comma separated list of string options
 UserName             - string value
 GroupName            - string value
 
-There are default values for all these keywords hardcoded in the configuration 
+There are default values for all these keywords hardcoded in the configuration
 module.
 
 Example:
@@ -59,11 +59,11 @@ Available options for specific character sets are:
   transliterate     - enable transliteration of unsupported characters
   discard           - discard unsupported characters
 
-NOTE: You must have root privileges to bind port 104 for DICOM association 
-requests on Unix/Linux/Posix platforms as this is a privileged port number 
-(i.e., a port number less than 1024.)  If you wish dcmqrscp to run as user/ 
-group different from root, you must invoke dcmqrscp as root initially. 
-dcmqrscp will switch to unprivileged user/group as specified by UserName/ 
+NOTE: You must have root privileges to bind port 104 for DICOM association
+requests on Unix/Linux/Posix platforms as this is a privileged port number
+(i.e., a port number less than 1024.)  If you wish dcmqrscp to run as user/
+group different from root, you must invoke dcmqrscp as root initially.
+dcmqrscp will switch to unprivileged user/group as specified by UserName/
 GroupName keywords once it has successfully established the listen socket.
 
 
@@ -72,7 +72,7 @@ GroupName keywords once it has successfully established the listen socket.
 The Host Table part must be enclosed with the keywords "HostTable BEGIN" and
 "HostTable END".  It is used to define symbolic names for a number of DICOM
 peers.  A peer is a structure with the three values AETitle, HostName,
-PortNumber seperated with white spaces and commas and enclosed with "(" and
+PortNumber separated with white spaces and commas and enclosed with "(" and
 ")".
 
 The right hand side of each entry effectively defines a mapping between
@@ -97,14 +97,14 @@ HostTable END
 
 1.3. Vendor Table
 
-The Vendor Table part must be enclosed with the keywords "VendorTable BEGIN" 
-and "VendorTable END".  The vendor table is used by the dcmqrscp and dcmqrti 
-programs.  You can give a vendor name to the dcmqrti program and it will talk 
-to all hosts and AEs of the vendor.  The dcmqrscp program can use the vendor 
-table to restrict move destination to hosts belonging to a vendor.  A vendor 
-name may be defined with a list of symbolic names.  The vendor name defined on 
-the left hand side of an entry was used for the annotation of images in the 
-CTN Display Program (ctndisp) which existed in earlier DCMTK releases. 
+The Vendor Table part must be enclosed with the keywords "VendorTable BEGIN"
+and "VendorTable END".  The vendor table is used by the dcmqrscp and dcmqrti
+programs.  You can give a vendor name to the dcmqrti program and it will talk
+to all hosts and AEs of the vendor.  The dcmqrscp program can use the vendor
+table to restrict move destination to hosts belonging to a vendor.  A vendor
+name may be defined with a list of symbolic names.  The vendor name defined on
+the left hand side of an entry was used for the annotation of images in the
+CTN Display Program (ctndisp) which existed in earlier DCMTK releases.
 Currently the value is not used.
 
 Example:
@@ -115,13 +115,13 @@ VendorTable END
 
 1.4. Application Entity Table
 
-The Application Entity Table defines the local Application Entities managed by 
-the dcmqrscp application.  Each local AE is associated with a separate storage 
-area and defines a set of peer AE's which may communicate with the local AE. 
-Peers attempting to associate with a local AE will be refused if they are not 
+The Application Entity Table defines the local Application Entities managed by
+the dcmqrscp application.  Each local AE is associated with a separate storage
+area and defines a set of peer AE's which may communicate with the local AE.
+Peers attempting to associate with a local AE will be refused if they are not
 explicitly or implicitly mentioned.
 
-The Application Entity Table part must be enclosed with the keywords "AETable 
+The Application Entity Table part must be enclosed with the keywords "AETable
 BEGIN" and "AETable END".  The entry format is held in a very simple style:
 
 ApplicationTitle        StorageArea     Access  Quota   Peers
index 019321773f0d90b17a3ea24c3eddd8b2776c80a3..2e7192fccee10b8e60ee2ed38d752020cbbb37de 100644 (file)
@@ -381,20 +381,46 @@ other network options:
           silently correct space-padded UIDs
 \endverbatim
 
-\subsection dcmqrscp_encoding_options encoding options
+\subsection dcmqrscp_processing_options processing options
 \verbatim
-post-1993 value representations:
+specific character set:
 
-  +u    --enable-new-vr
-          enable support for new VRs (UN/UT) (default)
+  # the following options require support from an underlying character
+  # encoding library (see output of --version on which one is available)
 
-  -u    --disable-new-vr
-          disable support for new VRs, convert to OB
+  +Cr   --use-request-charset
+          try to convert all element values that are affected by
+          Specific Character Set (0008,0005) to the one specified
+          in the request data set, fall back to the one specified
+          via --convert-to-xxx if that is not possible
+          (default, unless overridden by config file)
+
+  -Cr   --override-charset
+          convert affected element values to the character set
+          specified via --convert-to-xxx, ignoring the one
+          specified in the request
+
+  +A7   --convert-to-ascii
+          convert affected element values to 7-bit ASCII
+          (default, unless overridden by config file)
 
-  # This option disables generation of new VRs (UN/UT) when writing
-  # DICOM encoded data to a file to the network.  This option can be
-  # used to force compatibility with applications which do not support
-  # these value representations.
+  +U8   --convert-to-utf8
+          convert affected element values to UTF-8
+
+  +L1   --convert-to-latin1
+          convert affected element values to ISO 8859-1
+
+  +C    --convert-to-charset  [c]harset: string
+          convert affected element values to the character set
+          specified by the DICOM defined term c
+
+  -Ct   --transliterate
+          try to approximate characters that cannot be
+          represented through similar looking characters
+
+  -Cd   --discard-illegal
+          discard characters that cannot be represented
+          in destination character set
 \endverbatim
 
 \subsection dcmqrscp_output_options output options
@@ -433,6 +459,14 @@ output transfer syntax:
   +td   --write-xfer-deflated
           write with deflated explicit VR little endian TS
 
+post-1993 value representations:
+
+  +u    --enable-new-vr
+          enable support for new VRs (UN/UT) (default)
+
+  -u    --disable-new-vr
+          disable support for new VRs, convert to OB
+
 group length encoding (not with --bit-preserving):
 
   +g=   --group-length-recalc
@@ -466,45 +500,6 @@ deflate compression level (only with --propose-deflated or
 
   +cl   --compression-level  [l]evel: integer (default: 6)
           0=uncompressed, 1=fastest, 9=best compression
-
-specific character set:
-
-  # the following options require support from an underlying character
-  # encoding library (see output of --version on which one is available)
-
-  +Cr   --use-request-charset
-          try to convert all element values that are affected by
-          Specific Character Set (0008,0005) to the one specified
-          in the request data set, fall back to the one specified
-          via --convert-to-xxx if that is not possible
-          (default, unless overridden by config file)
-
-  -Cr   --override-charset
-          convert affected element values to the character
-          set specified via --convert-to-xxx, ignoring
-          the one specified in the request
-
-  +A7   --convert-to-ascii
-          convert affected element values to 7-bit ASCII
-          (default, unless overridden by config file)
-
-  +U8   --convert-to-utf8
-          convert affected element values to UTF-8
-
-  +L1   --convert-to-latin1
-          convert affected element values to ISO 8859-1
-
-  +C    --convert-to-charset  [c]harset: string
-          convert affected element values to the character set
-          specified by the DICOM defined term c
-
-  -Ct   --transliterate
-          try to approximate characters that cannot be
-          represented through similar looking characters
-
-  -Cd   --discard-illegal
-          discard characters that cannot be represented
-          in destination character set
 \endverbatim
 
 \section dcmqrscp_notes NOTES
@@ -623,7 +618,7 @@ OphthalmicPhotography16BitImageStorage               1.2.840.10008.5.1.4.1.1.77.
 StereometricRelationshipStorage                      1.2.840.10008.5.1.4.1.1.77.1.5.3
 OphthalmicTomographyImageStorage                     1.2.840.10008.5.1.4.1.1.77.1.5.4
 VLWholeSlideMicroscopyImageStorage                   1.2.840.10008.5.1.4.1.1.77.1.6
-RETIRED_VLMultiFrameImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
+RETIRED_VLMultiframeImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
 LensometryMeasurementsStorage                        1.2.840.10008.5.1.4.1.1.78.1
 AutorefractionMeasurementsStorage                    1.2.840.10008.5.1.4.1.1.78.2
 KeratometryMeasurementsStorage                       1.2.840.10008.5.1.4.1.1.78.3
@@ -820,7 +815,7 @@ WideFieldOphthalmicPhotogr.3DCoordinatesImageStorage 1.2.840.10008.5.1.4.1.1.77.
 OphthalmicOpticalCoherenceTomogr.EnFaceImageStorage  1.2.840.10008.5.1.4.1.1.77.1.5.7
 OphthalmicOpticalCoh.Tomogr.BscanVolumeAnalysisStor. 1.2.840.10008.5.1.4.1.1.77.1.5.8
 VLWholeSlideMicroscopyImageStorage                   1.2.840.10008.5.1.4.1.1.77.1.6
-RETIRED_VLMultiFrameImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
+RETIRED_VLMultiframeImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
 LensometryMeasurementsStorage                        1.2.840.10008.5.1.4.1.1.78.1
 AutorefractionMeasurementsStorage                    1.2.840.10008.5.1.4.1.1.78.2
 KeratometryMeasurementsStorage                       1.2.840.10008.5.1.4.1.1.78.3
@@ -856,6 +851,7 @@ PatientRadiationDoseSRStorage                        1.2.840.10008.5.1.4.1.1.88.
 ContentAssessmentResultsStorage                      1.2.840.10008.5.1.4.1.1.90.1
 EncapsulatedPDFStorage                               1.2.840.10008.5.1.4.1.1.104.1
 EncapsulatedCDAStorage                               1.2.840.10008.5.1.4.1.1.104.2
+EncapsulatedSTLStorage                               1.2.840.10008.5.1.4.1.1.104.3
 PositronEmissionTomographyImageStorage               1.2.840.10008.5.1.4.1.1.128
 LegacyConvertedEnhancedPETImageStorage               1.2.840.10008.5.1.4.1.1.128.1
 RETIRED_StandalonePETCurveStorage                    1.2.840.10008.5.1.4.1.1.129
@@ -1075,6 +1071,6 @@ It is an error if no data dictionary can be loaded.
 
 \section dcmqrscp_copyright COPYRIGHT
 
-Copyright (C) 1993-2017 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 1993-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index 47ba9066865abd04ce14df19b85f67aee5c54d3f..f64f09a7955d550720ea0f4df1d69626e45f77e3 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES dcmqrscp.cfg DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/dcmtk" COMPONENT etc)
+install(FILES dcmqrscp.cfg DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/dcmtk" COMPONENT etc)
index 83cb1d02b27ee208782ecedf2338785c989955c1..33e489be38087639b61d8f443a0faa606faaa209 100644 (file)
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2017, OFFIS e.V.
+#  Copyright (C) 2017-2018, OFFIS e.V.
 #  All rights reserved.  See COPYRIGHT file for details.
 #
 #  This software and supporting documentation were developed by
@@ -146,7 +146,7 @@ PresentationContext50  = RETIRED_NuclearMedicineImageStorage\AnyTransferSyntax
 PresentationContext51  = RETIRED_UltrasoundImageStorage\AnyTransferSyntax
 PresentationContext52  = RETIRED_UltrasoundMultiframeImageStorage\AnyTransferSyntax
 PresentationContext53  = RETIRED_VLImageStorage\AnyTransferSyntax
-PresentationContext54  = RETIRED_VLMultiFrameImageStorage\AnyTransferSyntax
+PresentationContext54  = RETIRED_VLMultiframeImageStorage\AnyTransferSyntax
 PresentationContext55  = RETIRED_XRayAngiographicBiPlaneImageStorage\AnyTransferSyntax
 #
 # the following presentation contexts are for non-image SOP classes
@@ -238,6 +238,7 @@ PresentationContext128 = DRAFT_WaveformStorage\UncompressedOrZlib
 # - ContentAssessmentResultsStorage
 # - CTDefinedProcedureProtocolStorage
 # - CTPerformedProcedureProtocolStorage
+# - EncapsulatedSTLStorage
 # - ExtensibleSRStorage
 # - GrayscalePlanarMPRVolumetricPresentationStateStorage
 # - HangingProtocolStorage
@@ -417,6 +418,7 @@ PresentationContext128 = XRayRadiationDoseSRStorage\UncompressedOrZlib
 #
 # - AdvancedBlendingPresentationStateStorage
 # - ColorPaletteStorage
+# - EncapsulatedSTLStorage
 # - MultipleVolumeRenderingVolumetricPresentationStateStorage
 # - OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage
 # - OphthalmicOpticalCoherenceTomographyEnFaceImageStorage
@@ -431,7 +433,7 @@ PresentationContext128 = XRayRadiationDoseSRStorage\UncompressedOrZlib
 # - RETIRED_UltrasoundImageStorage
 # - RETIRED_UltrasoundMultiframeImageStorage
 # - RETIRED_VLImageStorage
-# - RETIRED_VLMultiFrameImageStorage
+# - RETIRED_VLMultiframeImageStorage
 # - RETIRED_XRayAngiographicBiPlaneImageStorage
 #
 # - RETIRED_StandaloneCurveStorage
@@ -620,6 +622,7 @@ PresentationContext128 = VideoPhotographicImageStorage\MPEG2
 # - CTPerformedProcedureProtocolStorage
 # - DeformableSpatialRegistrationStorage
 # - EncapsulatedCDAStorage
+# - EncapsulatedSTLStorage
 # - EnhancedMRColorImageStorage
 # - EnhancedPETImageStorage
 # - EnhancedUSVolumeStorage
@@ -757,7 +760,7 @@ Role49  = RETIRED_NuclearMedicineImageStorage\BOTH
 Role50  = RETIRED_UltrasoundImageStorage\BOTH
 Role51  = RETIRED_UltrasoundMultiframeImageStorage\BOTH
 Role52  = RETIRED_VLImageStorage\BOTH
-Role53  = RETIRED_VLMultiFrameImageStorage\BOTH
+Role53  = RETIRED_VLMultiframeImageStorage\BOTH
 Role54  = RETIRED_XRayAngiographicBiPlaneImageStorage\BOTH
 #
 # the following presentation contexts are for non-image SOP classes
@@ -849,6 +852,7 @@ Role127 = DRAFT_WaveformStorage\BOTH
 # - ContentAssessmentResultsStorage
 # - CTDefinedProcedureProtocolStorage
 # - CTPerformedProcedureProtocolStorage
+# - EncapsulatedSTLStorage
 # - ExtensibleSRStorage
 # - GrayscalePlanarMPRVolumetricPresentationStateStorage
 # - HangingProtocolStorage
@@ -1017,6 +1021,7 @@ Role127 = XRayRadiationDoseSRStorage\BOTH
 #
 # - AdvancedBlendingPresentationStateStorage
 # - ColorPaletteStorage
+# - EncapsulatedSTLStorage
 # - MultipleVolumeRenderingVolumetricPresentationStateStorage
 # - OphthalmicOpticalCoherenceTomographyBscanVolumeAnalysisStorage
 # - OphthalmicOpticalCoherenceTomographyEnFaceImageStorage
@@ -1031,7 +1036,7 @@ Role127 = XRayRadiationDoseSRStorage\BOTH
 # - RETIRED_UltrasoundImageStorage
 # - RETIRED_UltrasoundMultiframeImageStorage
 # - RETIRED_VLImageStorage
-# - RETIRED_VLMultiFrameImageStorage
+# - RETIRED_VLMultiframeImageStorage
 # - RETIRED_XRayAngiographicBiPlaneImageStorage
 #
 # - RETIRED_StandaloneCurveStorage
index 2d82575ea6455e95098d3b37a61ece859ed489ac..567088e46dbddbb851d7268dd194c347b9b498d2 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmqrdb DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmqrdb DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 256a692e4c87a22bd36e0c61590f3ab604d3e562..538dae3c8de0742f1a25a8feabf03d705440f041 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1993-2017, OFFIS e.V.
+ *  Copyright (C) 1993-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -123,7 +123,7 @@ private:
     void buildFailedInstanceList(DcmDataset ** rspIds);
     OFBool mapMoveDestination(
       const char *origPeer, const char *origAE,
-      const char *dstAE, char *dstPeer, int *dstPort);
+      const char *dstAE, char *dstPeer, size_t dstPeerLen, int *dstPort);
     OFCondition addAllStoragePresentationContexts(T_ASC_Parameters *params);
 
     /// reference to database handle
index b84892c40595b3ffb3acea8683939fb401ac0816..9a3cec58e92bbcc361705c034719e73acb6640c5 100644 (file)
@@ -63,12 +63,14 @@ public:
    *  @param newImageFileName file name is returned in this parameter.
    *    Memory must be provided by the caller and should be at least MAXPATHLEN+1
    *    characters. The file name generated should be an absolute file name.
+   *  @param newImageFileNameLen length of buffer pointed to by newImageFileName
    *  @return EC_Normal upon normal completion, or some other OFCondition code upon failure.
    */
   virtual OFCondition makeNewStoreFileName(
       const char *SOPClassUID,
       const char *SOPInstanceUID,
-      char *newImageFileName) = 0;
+      char       *newImageFileName,
+      size_t      newImageFileNameLen) = 0;
 
   /** register the given DICOM object, which has been received through a C-STORE
    *  operation and stored in a file, in the database.
@@ -154,10 +156,13 @@ public:
    *  imageFileName containing the requested data).
    *  @param SOPClassUID pointer to string of at least 65 characters into
    *    which the SOP class UID for the next DICOM object to be transferred is copied.
+   *  @param SOPClassUIDSize size of SOPClassUID element
    *  @param SOPInstanceUID pointer to string of at least 65 characters into
    *    which the SOP instance UID for the next DICOM object to be transferred is copied.
+   *  @param SOPInstanceUIDSize size of SOPInstanceUID element
    *  @param imageFileName pointer to string of at least MAXPATHLEN+1 characters into
    *    which the file path for the next DICOM object to be transferred is copied.
+   *  @param imageFileNameSize size of imageFileName element
    *  @param numberOfRemainingSubOperations On return, this parameter will contain
    *     the number of suboperations still remaining for the request
    *     (this number is needed by move responses with PENDING status).
@@ -170,8 +175,11 @@ public:
    */
   virtual OFCondition nextMoveResponse(
       char *SOPClassUID,
+      size_t SOPClassUIDSize,
       char *SOPInstanceUID,
+      size_t SOPInstanceUIDSize,
       char *imageFileName,
+      size_t imageFileNameSize,
       unsigned short *numberOfRemainingSubOperations,
       DcmQueryRetrieveDatabaseStatus *status) = 0;
 
index 20b86befc1b026b5a499e775d4de91bd8cdbc424..371f342b302272f196118f35cb3c85aaa800f398 100644 (file)
@@ -142,12 +142,14 @@ public:
    *  @param newImageFileName file name is returned in this parameter.
    *    Memory must be provided by the caller and should be at least MAXPATHLEN+1 
    *    characters. The file name generated should be an absolute file name.
+   *  @param newImageFileNameLen length of buffer pointed to by newImageFileName
    *  @return EC_Normal upon normal completion, or some other OFCondition code upon failure.
    */
   OFCondition makeNewStoreFileName(
       const char *SOPClassUID,
       const char *SOPInstanceUID,
-      char *newImageFileName);
+      char       *newImageFileName,
+      size_t      newImageFileNameLen);
   
   /** register the given DICOM object, which has been received through a C-STORE 
    *  operation and stored in a file, in the database.
@@ -212,10 +214,13 @@ public:
    *  imageFileName containing the requested data). 
    *  @param SOPClassUID pointer to string of at least 65 characters into 
    *    which the SOP class UID for the next DICOM object to be transferred is copied.
+   *  @param SOPClassUIDSize size of SOPClassUID element
    *  @param SOPInstanceUID pointer to string of at least 65 characters into 
    *    which the SOP instance UID for the next DICOM object to be transferred is copied.
+   *  @param SOPInstanceUIDSize size of SOPInstanceUID element
    *  @param imageFileName pointer to string of at least MAXPATHLEN+1 characters into 
    *    which the file path for the next DICOM object to be transferred is copied.
+   *  @param imageFileNameSize size of imageFileName element
    *  @param numberOfRemainingSubOperations On return, this parameter will contain
    *     the number of suboperations still remaining for the request
    *     (this number is needed by move responses with PENDING status).
@@ -228,11 +233,14 @@ public:
    */  
   OFCondition nextMoveResponse(
       char *SOPClassUID,
+      size_t SOPClassUIDSize,
       char *SOPInstanceUID,
+      size_t SOPInstanceUIDSize,
       char *imageFileName,
+      size_t imageFileNameSize,
       unsigned short *numberOfRemainingSubOperations,
       DcmQueryRetrieveDatabaseStatus *status);
-  
+
   /** cancel the ongoing MOVE request, stop and reset every running operation
    *  associated with this request, delete existing temporary files.
    *  @param status pointer to DB status object in which a DIMSE status code 
index 1614ac5850b4b5e6d8523c3b968f7d2466892a87..38d65e84e335c5a84956afaf5d8e97fb7ced3fa6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1993-2017, OFFIS e.V.
+ *  Copyright (C) 1993-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -40,6 +40,12 @@ BEGIN_EXTERN_C
 #endif
 END_EXTERN_C
 
+// include this file in doxygen documentation
+
+/** @file dcmqridx.h
+ *  @brief type definitions and constants for the database index file
+ */
+
 /** types of query keys
  */
 enum DB_KEY_TYPE
index 15bcfb1354d44619c891046d872d8f355b07bb5c..6761dde936f165ba31186a6ec9150d672e79120b 100644 (file)
@@ -46,12 +46,14 @@ dcmqrcbf.o: dcmqrcbf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
  ../../dcmnet/include/dcmtk/dcmnet/dul.h \
@@ -128,12 +130,14 @@ dcmqrcbg.o: dcmqrcbg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
  ../../dcmnet/include/dcmtk/dcmnet/dul.h \
@@ -210,12 +214,14 @@ dcmqrcbm.o: dcmqrcbm.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
  ../../dcmnet/include/dcmtk/dcmnet/dul.h \
@@ -300,12 +306,14 @@ dcmqrcbs.o: dcmqrcbs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
  ../../dcmnet/include/dcmtk/dcmnet/dul.h \
@@ -343,13 +351,14 @@ dcmqrcnf.o: dcmqrcnf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
@@ -379,6 +388,7 @@ dcmqrcnf.o: dcmqrcnf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmqrdb/qrdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h \
  ../../ofstd/include/dcmtk/ofstd/ofchrenc.h
@@ -435,7 +445,9 @@ dcmqrdbi.o: dcmqrdbi.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/dimse.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
@@ -516,8 +528,10 @@ dcmqrdbs.o: dcmqrdbs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -567,6 +581,7 @@ dcmqropt.o: dcmqropt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -576,6 +591,7 @@ dcmqropt.o: dcmqropt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -650,12 +666,14 @@ dcmqrptb.o: dcmqrptb.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
  ../../dcmnet/include/dcmtk/dcmnet/dul.h \
@@ -724,12 +742,14 @@ dcmqrsrv.o: dcmqrsrv.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
  ../../dcmnet/include/dcmtk/dcmnet/dul.h \
@@ -813,12 +833,14 @@ dcmqrtis.o: dcmqrtis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/assoc.h \
  ../../dcmnet/include/dcmtk/dcmnet/lst.h \
index f5a20be14cad66893cbd61a281d207526c78a92e..a7ec702a569bda286a314e17842eee50880375cb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1993-2017, OFFIS e.V.
+ *  Copyright (C) 1993-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -29,6 +29,7 @@
 #include "dcmtk/dcmdata/dcfilefo.h"
 #include "dcmtk/dcmqrdb/dcmqrdbs.h"
 #include "dcmtk/dcmqrdb/dcmqrdbi.h"
+#include "dcmtk/ofstd/ofstd.h"
 
 BEGIN_EXTERN_C
 #ifdef HAVE_FCNTL_H
@@ -141,23 +142,23 @@ void DcmQueryRetrieveGetContext::callbackHandler(
 void DcmQueryRetrieveGetContext::addFailedUIDInstance(const char *sopInstance)
 {
     size_t len;
-
+    size_t buflen = DIC_UI_LEN+1;
     if (failedUIDs == NULL) {
-        if ((failedUIDs = (char*)malloc(DIC_UI_LEN+1)) == NULL) {
+        if ((failedUIDs = (char*)malloc(buflen)) == NULL) {
             DCMQRDB_ERROR("malloc failure: addFailedUIDInstance");
             return;
         }
-        strcpy(failedUIDs, sopInstance);
+        OFStandard::strlcpy(failedUIDs, sopInstance, buflen);
     } else {
         len = strlen(failedUIDs);
-        if ((failedUIDs = (char*)realloc(failedUIDs,
-            (len+strlen(sopInstance)+2))) == NULL) {
+        buflen = len+strlen(sopInstance)+2;
+        if ((failedUIDs = (char*)realloc(failedUIDs, buflen)) == NULL) {
             DCMQRDB_ERROR("realloc failure: addFailedUIDInstance");
             return;
         }
         /* tag sopInstance onto end of old with '\' between */
-        strcat(failedUIDs, "\\");
-        strcat(failedUIDs, sopInstance);
+        OFStandard::strlcat(failedUIDs, "\\", buflen);
+        OFStandard::strlcat(failedUIDs, sopInstance, buflen);
     }
 }
 
@@ -215,8 +216,8 @@ OFCondition DcmQueryRetrieveGetContext::performGetSubOp(DIC_UI sopClass, DIC_UI
     }
 
     req.MessageID = msgId;
-    strcpy(req.AffectedSOPClassUID, sopClass);
-    strcpy(req.AffectedSOPInstanceUID, sopInstance);
+    OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, DIC_UI_LEN + 1);
+    OFStandard::strlcpy(req.AffectedSOPInstanceUID, sopInstance, DIC_UI_LEN + 1);
     req.DataSetType = DIMSE_DATASET_PRESENT;
     req.Priority = priority;
     req.opts = 0;
@@ -291,7 +292,7 @@ void DcmQueryRetrieveGetContext::getNextImage(DcmQueryRetrieveDatabaseStatus * d
 
     /* get DB response */
     dbcond = dbHandle.nextMoveResponse(
-        subImgSOPClass, subImgSOPInstance, subImgFileName, &nRemaining, dbStatus);
+        subImgSOPClass, sizeof(subImgSOPClass), subImgSOPInstance, sizeof(subImgSOPInstance), subImgFileName, sizeof(subImgFileName), &nRemaining, dbStatus);
     if (dbcond.bad()) {
         DCMQRDB_ERROR("getSCP: Database: nextMoveResponse Failed ("
             << DU_cmoveStatusString(dbStatus->status()) << "):");
index eb96c05e560c3ef023575018982a8c819c85d61a..d542db8bc7155fef981d78ba68a81530ef4aeb95 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1993-2017, OFFIS e.V.
+ *  Copyright (C) 1993-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -30,6 +30,7 @@
 #include "dcmtk/dcmdata/dcfilefo.h"
 #include "dcmtk/dcmqrdb/dcmqrdbs.h"
 #include "dcmtk/dcmqrdb/dcmqrdbi.h"
+#include "dcmtk/ofstd/ofstd.h"
 
 BEGIN_EXTERN_C
 #ifdef HAVE_FCNTL_H
@@ -166,23 +167,23 @@ void DcmQueryRetrieveMoveContext::callbackHandler(
 void DcmQueryRetrieveMoveContext::addFailedUIDInstance(const char *sopInstance)
 {
     size_t len;
-
+    size_t buflen = DIC_UI_LEN+1;
     if (failedUIDs == NULL) {
-        if ((failedUIDs = (char*)malloc(DIC_UI_LEN+1)) == NULL) {
+        if ((failedUIDs = (char*)malloc(buflen)) == NULL) {
             DCMQRDB_ERROR("malloc failure: addFailedUIDInstance");
             return;
         }
-        strcpy(failedUIDs, sopInstance);
+        OFStandard::strlcpy(failedUIDs, sopInstance, buflen);
     } else {
         len = strlen(failedUIDs);
-        if ((failedUIDs = (char*)realloc(failedUIDs,
-            (len+strlen(sopInstance)+2))) == NULL) {
+        buflen = len+strlen(sopInstance)+2;
+        if ((failedUIDs = (char*)realloc(failedUIDs, buflen)) == NULL) {
             DCMQRDB_ERROR("realloc failure: addFailedUIDInstance");
             return;
         }
         /* tag sopInstance onto end of old with '\' between */
-        strcat(failedUIDs, "\\");
-        strcat(failedUIDs, sopInstance);
+        OFStandard::strlcat(failedUIDs, "\\", buflen);
+        OFStandard::strlcat(failedUIDs, sopInstance, buflen);
     }
 }
 
@@ -228,12 +229,12 @@ OFCondition DcmQueryRetrieveMoveContext::performMoveSubOp(DIC_UI sopClass, DIC_U
     }
 
     req.MessageID = msgId;
-    strcpy(req.AffectedSOPClassUID, sopClass);
-    strcpy(req.AffectedSOPInstanceUID, sopInstance);
+    OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, DIC_UI_LEN + 1); // see declaration of DIC_UI in dcmtk/dcmnet/dicom.h
+    OFStandard::strlcpy(req.AffectedSOPInstanceUID, sopInstance, DIC_UI_LEN + 1);
     req.DataSetType = DIMSE_DATASET_PRESENT;
     req.Priority = priority;
     req.opts = (O_STORE_MOVEORIGINATORAETITLE | O_STORE_MOVEORIGINATORID);
-    strcpy(req.MoveOriginatorApplicationEntityTitle, origAETitle);
+    OFStandard::strlcpy(req.MoveOriginatorApplicationEntityTitle, origAETitle, DIC_AE_LEN + 1);
     req.MoveOriginatorID = origMsgId;
 
     DCMQRDB_INFO("Store SCU RQ: MsgID " << msgId << ", ("
@@ -290,7 +291,7 @@ OFCondition DcmQueryRetrieveMoveContext::buildSubAssociation(T_DIMSE_C_MoveRQ *r
     T_ASC_Parameters *params;
     OFString temp_str;
 
-    strcpy(dstAETitle, request->MoveDestination);
+    OFStandard::strlcpy(dstAETitle, request->MoveDestination, DIC_AE_LEN + 1);
 
     /*
      * We must map the destination AE Title into a host name and port
@@ -300,13 +301,13 @@ OFCondition DcmQueryRetrieveMoveContext::buildSubAssociation(T_DIMSE_C_MoveRQ *r
 
     DIC_AE aeTitle;
     aeTitle[0] = '\0';
-    ASC_getAPTitles(origAssoc->params, origAETitle, aeTitle, NULL);
+    ASC_getAPTitles(origAssoc->params, origAETitle, sizeof(origAETitle), aeTitle, sizeof(aeTitle), NULL, 0);
     ourAETitle = aeTitle;
 
-    ASC_getPresentationAddresses(origAssoc->params, origHostName, NULL);
+    ASC_getPresentationAddresses(origAssoc->params, origHostName, sizeof(origHostName), NULL, 0);
 
     if (!mapMoveDestination(origHostName, origAETitle,
-        request->MoveDestination, dstHostName, &dstPortNumber)) {
+        request->MoveDestination, dstHostName, DIC_NODENAME_LEN + 1, &dstPortNumber)) {
         return QR_EC_InvalidPeer;
     }
     if (cond.good()) {
@@ -316,7 +317,7 @@ OFCondition DcmQueryRetrieveMoveContext::buildSubAssociation(T_DIMSE_C_MoveRQ *r
         }
     }
     if (cond.good()) {
-        sprintf(dstHostNamePlusPort, "%s:%d", dstHostName, dstPortNumber);
+        OFStandard::snprintf(dstHostNamePlusPort, sizeof(DIC_NODENAME), "%s:%d", dstHostName, dstPortNumber);
         ASC_setPresentationAddresses(params, OFStandard::getHostName().c_str(),
             dstHostNamePlusPort);
         ASC_setAPTitles(params, ourAETitle.c_str(), dstAETitle,NULL);
@@ -397,7 +398,7 @@ void DcmQueryRetrieveMoveContext::moveNextImage(DcmQueryRetrieveDatabaseStatus *
 
     /* get DB response */
     dbcond = dbHandle.nextMoveResponse(
-        subImgSOPClass, subImgSOPInstance, subImgFileName, &nRemaining, dbStatus);
+        subImgSOPClass, sizeof(subImgSOPClass), subImgSOPInstance, sizeof(subImgSOPInstance), subImgFileName, sizeof(subImgFileName), &nRemaining, dbStatus);
     if (dbcond.bad()) {
         DCMQRDB_ERROR("moveSCP: Database: nextMoveResponse Failed ("
                 << DU_cmoveStatusString(dbStatus->status()) << "):");
@@ -429,7 +430,7 @@ void DcmQueryRetrieveMoveContext::failAllSubOperations(DcmQueryRetrieveDatabaseS
     while (dbStatus->status() == STATUS_Pending) {
         /* get DB response */
         dbcond = dbHandle.nextMoveResponse(
-            subImgSOPClass, subImgSOPInstance, subImgFileName, &nRemaining, dbStatus);
+            subImgSOPClass, sizeof(subImgSOPClass), subImgSOPInstance, sizeof(subImgSOPInstance), subImgFileName, sizeof(subImgFileName), &nRemaining, dbStatus);
         if (dbcond.bad()) {
             DCMQRDB_ERROR("moveSCP: Database: nextMoveResponse Failed ("
                 << DU_cmoveStatusString(dbStatus->status()) << "):");
@@ -460,7 +461,7 @@ void DcmQueryRetrieveMoveContext::buildFailedInstanceList(DcmDataset ** rspIds)
 
 OFBool DcmQueryRetrieveMoveContext::mapMoveDestination(
   const char *origPeer, const char *origAE,
-  const char *dstAE, char *dstPeer, int *dstPort)
+  const char *dstAE, char *dstPeer, size_t dstPeerLen, int *dstPort)
 {
     /*
      * This routine enforces RSNA'93 Demo Requirements regarding
@@ -485,7 +486,7 @@ OFBool DcmQueryRetrieveMoveContext::mapMoveDestination(
         return OFFalse;     /* dstAE not known */
     }
 
-    strcpy(dstPeer, dstPeerName);
+    OFStandard::strlcpy(dstPeer, dstPeerName, dstPeerLen);
 
     if (options_.restrictMoveToSameHost_) {
         /* hosts the same ? */
index a621bf337851c8838bc8086cd405c99711fe062f..94b36cc91c1790f8b463781b94824d2f296d2d97 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1993-2017, OFFIS e.V.
+ *  Copyright (C) 1993-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -134,7 +134,7 @@ void DcmQueryRetrieveStoreContext::checkRequestAgainstDataset(
     DIC_UI sopClass;
     DIC_UI sopInstance;
 
-    if (!DU_findSOPClassAndInstanceInDataSet(dataSet, sopClass, sopInstance, uidPadding))
+    if (!DU_findSOPClassAndInstanceInDataSet(dataSet, sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), uidPadding))
     {
         DCMQRDB_ERROR("Bad image file: " << fname);
         rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand;
index 1a64a828b69768195653f46a5445e54ed37d8ae9..51abe781a116a3be85bbd8aabccf165acdd45baa 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1993-2017, OFFIS e.V.
+ *  Copyright (C) 1993-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -108,8 +108,9 @@ static int NbFindAttr = ((sizeof (TbFindAttr)) / (sizeof (TbFindAttr [0])));
 static char *DB_strdup(const char* str)
 {
     if (str == NULL) return NULL;
-    char* s = (char*)malloc(strlen(str)+1);
-    strcpy(s, str);
+    size_t buflen = strlen(str)+1;
+    char* s = (char*)malloc(buflen);
+    OFStandard::strlcpy(s, str, buflen);
     return s;
 }
 
@@ -1372,7 +1373,8 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::startFindRequest(
                 /* only char string type tags are supported at the moment */
                 char *s = NULL;
                 dcelem->getString(s);
-                strcpy(elem.PValueField, s);
+                /* the available space is always elem.ValueLength+1 */
+                OFStandard::strlcpy(elem.PValueField, s, elem.ValueLength+1);
             }
             /** If element is the Query Level, store it in handle
              */
@@ -2048,7 +2050,8 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::startMoveRequest(
                 /* only char string type tags are supported at the moment */
                 char *s = NULL;
                 dcelem->getString(s);
-                strcpy(elem.PValueField, s);
+                /* the available space is always elem.ValueLength+1 */
+                OFStandard::strlcpy(elem.PValueField, s, elem.ValueLength+1);
             }
 
             /** If element is the Query Level, store it in handle
@@ -2240,11 +2243,14 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::startMoveRequest(
 }
 
 OFCondition DcmQueryRetrieveIndexDatabaseHandle::nextMoveResponse(
-                char            *SOPClassUID,
-                char            *SOPInstanceUID,
-                char            *imageFileName,
-                unsigned short  *numberOfRemainingSubOperations,
-                DcmQueryRetrieveDatabaseStatus  *status)
+    char *SOPClassUID,
+    size_t SOPClassUIDSize,
+    char *SOPInstanceUID,
+    size_t SOPInstanceUIDSize,
+    char *imageFileName,
+    size_t imageFileNameSize,
+    unsigned short *numberOfRemainingSubOperations,
+    DcmQueryRetrieveDatabaseStatus *status)
 {
     IdxRecord           idxRec ;
     DB_CounterList              *nextlist ;
@@ -2275,9 +2281,9 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::nextMoveResponse(
         return (QR_EC_IndexDatabaseError) ;
     }
 
-    strcpy (SOPClassUID, (char *) idxRec. SOPClassUID) ;
-    strcpy (SOPInstanceUID, (char *) idxRec. SOPInstanceUID) ;
-    strcpy (imageFileName, (char *) idxRec. filename) ;
+    OFStandard::strlcpy(SOPClassUID, (char *) idxRec. SOPClassUID, SOPClassUIDSize) ;
+    OFStandard::strlcpy(SOPInstanceUID, (char *) idxRec. SOPInstanceUID, SOPInstanceUIDSize) ;
+    OFStandard::strlcpy(imageFileName, (char *) idxRec. filename, imageFileNameSize) ;
 
     *numberOfRemainingSubOperations = --handle_->NumberRemainOperations ;
 
@@ -2590,7 +2596,7 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::checkupinStudyDesc(StudyDescRec
     pStudyDesc[s]. LastRecordedDate =  (double) time(NULL);
 
     pStudyDesc[s]. NumberofRegistratedImages++ ;
-    strcpy(pStudyDesc[s].StudyInstanceUID,StudyUID) ;
+    OFStandard::strlcpy(pStudyDesc[s].StudyInstanceUID, StudyUID, UI_MAX_LENGTH+1) ;
 
     if ( DB_StudyDescChange (pStudyDesc) == EC_Normal)
         return ( EC_Normal ) ;
@@ -2723,7 +2729,7 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::storeRequest (
             descrTag = DCM_ContentDescription;
         } else if (strcmp(SOPClassUID, UID_RETIRED_HardcopyGrayscaleImageStorage) == 0)
         {
-            strcpy(idxRec.InstanceDescription, "Hardcopy Grayscale Image");
+            OFStandard::strlcpy(idxRec.InstanceDescription, "Hardcopy Grayscale Image", DESCRIPTION_MAX_LENGTH+1);
             useDescrTag = OFFalse;
         } else if ((strcmp(SOPClassUID, UID_BasicTextSRStorage) == 0) ||
                    (strcmp(SOPClassUID, UID_EnhancedSRStorage) == 0) ||
@@ -2764,11 +2770,11 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::storeRequest (
                 description += ", ";
                 description += string;
             }
-            strncpy(idxRec.InstanceDescription, description.c_str(), DESCRIPTION_MAX_LENGTH);
+            OFStandard::strlcpy(idxRec.InstanceDescription, description.c_str(), DESCRIPTION_MAX_LENGTH+1);
             useDescrTag = OFFalse;
         } else if (strcmp(SOPClassUID, UID_RETIRED_StoredPrintStorage) == 0)
         {
-            strcpy(idxRec.InstanceDescription, "Stored Print");
+            OFStandard::strlcpy(idxRec.InstanceDescription, "Stored Print", DESCRIPTION_MAX_LENGTH+1);
             useDescrTag = OFFalse;
         }
     }
@@ -2790,9 +2796,9 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::storeRequest (
             if (((DcmSequenceOfItems *)stack.top())->card() > 0)
             {
                 if (strlen(idxRec.InstanceDescription) > 0)
-                    strcat(idxRec.InstanceDescription, " (Signed)");
+                    OFStandard::strlcat(idxRec.InstanceDescription, " (Signed)", DESCRIPTION_MAX_LENGTH+1);
                 else
-                    strcpy(idxRec.InstanceDescription, "Signed Instance");
+                    OFStandard::strlcpy(idxRec.InstanceDescription, "Signed Instance", DESCRIPTION_MAX_LENGTH+1);
             }
         }
     }
@@ -3221,7 +3227,8 @@ DcmQueryRetrieveIndexDatabaseHandle::~DcmQueryRetrieveIndexDatabaseHandle()
 OFCondition DcmQueryRetrieveIndexDatabaseHandle::makeNewStoreFileName(
                 const char      *SOPClassUID,
                 const char      * /* SOPInstanceUID */ ,
-                char            *newImageFileName)
+                char            *newImageFileName,
+                size_t          newImageFileNameLen)
 {
 
     OFString filename;
@@ -3236,7 +3243,7 @@ OFCondition DcmQueryRetrieveIndexDatabaseHandle::makeNewStoreFileName(
     if (! fnamecreator.makeFilename(seed, handle_->storageArea, prefix, ".dcm", filename))
         return QR_EC_IndexDatabaseError;
 
-    strcpy(newImageFileName, filename.c_str());
+    OFStandard::strlcpy(newImageFileName, filename.c_str(), newImageFileNameLen);
     return EC_Normal;
 }
 
index 3de8cc07816d357a32021a8a26284852190f2ab3..b2fbdca82795bcd949bd4e0779cbf8d331ad3f7a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1993-2017, OFFIS e.V.
+ *  Copyright (C) 1993-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -128,8 +128,8 @@ void DcmQueryRetrieveProcessTable::addProcessToTable(int pid, T_ASC_Association
     DIC_AE       calledAETitle;
     OFBool hasStorageAbility = OFFalse;
 
-    ASC_getPresentationAddresses(assoc->params, peerName, NULL);
-    ASC_getAPTitles(assoc->params, callingAETitle, calledAETitle, NULL);
+    ASC_getPresentationAddresses(assoc->params, peerName, sizeof(peerName), NULL, 0);
+    ASC_getAPTitles(assoc->params, callingAETitle, sizeof(callingAETitle), calledAETitle, sizeof(calledAETitle), NULL, 0);
 
     for (int i=0; i<numberOfDcmAllStorageSOPClassUIDs; i++)
     {
index a32aae86adfe59c8a1878ba23f5db39fd4584f0d..7f01409c5dd3bb28bd65b676df48e0b327502cef 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1993-2017, OFFIS e.V.
+ *  Copyright (C) 1993-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -213,8 +213,8 @@ OFCondition DcmQueryRetrieveSCP::handleAssociation(T_ASC_Association * assoc, OF
     DIC_AE              myAETitle;
     OFString            temp_str;
 
-    ASC_getPresentationAddresses(assoc->params, peerHostName, NULL);
-    ASC_getAPTitles(assoc->params, peerAETitle, myAETitle, NULL);
+    ASC_getPresentationAddresses(assoc->params, peerHostName, sizeof(peerHostName), NULL, 0);
+    ASC_getAPTitles(assoc->params, peerAETitle, sizeof(peerAETitle), myAETitle, sizeof(myAETitle), NULL, 0);
 
     /* now do the real work */
     cond = dispatch(assoc, correctUIDPadding);
@@ -273,7 +273,7 @@ OFCondition DcmQueryRetrieveSCP::findSCP(T_ASC_Association * assoc, T_DIMSE_C_Fi
 
     DIC_AE aeTitle;
     aeTitle[0] = '\0';
-    ASC_getAPTitles(assoc->params, NULL, aeTitle, NULL);
+    ASC_getAPTitles(assoc->params, NULL, 0, aeTitle, sizeof(aeTitle), NULL, 0);
     context.setOurAETitle(aeTitle);
 
     OFString temp_str;
@@ -296,7 +296,7 @@ OFCondition DcmQueryRetrieveSCP::getSCP(T_ASC_Association * assoc, T_DIMSE_C_Get
 
     DIC_AE aeTitle;
     aeTitle[0] = '\0';
-    ASC_getAPTitles(assoc->params, NULL, aeTitle, NULL);
+    ASC_getAPTitles(assoc->params, NULL, 0, aeTitle, sizeof(aeTitle), NULL, 0);
     context.setOurAETitle(aeTitle);
 
     OFString temp_str;
@@ -319,7 +319,7 @@ OFCondition DcmQueryRetrieveSCP::moveSCP(T_ASC_Association * assoc, T_DIMSE_C_Mo
 
     DIC_AE aeTitle;
     aeTitle[0] = '\0';
-    ASC_getAPTitles(assoc->params, NULL, aeTitle, NULL);
+    ASC_getAPTitles(assoc->params, NULL, 0, aeTitle, sizeof(aeTitle), NULL, 0);
     context.setOurAETitle(aeTitle);
 
     OFString temp_str;
@@ -353,18 +353,18 @@ OFCondition DcmQueryRetrieveSCP::storeSCP(T_ASC_Association * assoc, T_DIMSE_C_S
         /* callback will send back sop class not supported status */
         context.setStatus(STATUS_STORE_Refused_SOPClassNotSupported);
         /* must still receive data */
-        strcpy(imageFileName, NULL_DEVICE_NAME);
+        OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName));
     } else if (options_.ignoreStoreData_) {
-        strcpy(imageFileName, NULL_DEVICE_NAME);
+        OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName));
     } else {
         dbcond = dbHandle.makeNewStoreFileName(
             request->AffectedSOPClassUID,
             request->AffectedSOPInstanceUID,
-            imageFileName);
+            imageFileName, sizeof(imageFileName));
         if (dbcond.bad()) {
             DCMQRDB_ERROR("storeSCP: Database: makeNewStoreFileName Failed");
             /* must still receive data */
-            strcpy(imageFileName, NULL_DEVICE_NAME);
+            OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName));
             /* callback will send back out of resources status */
             context.setStatus(STATUS_STORE_Refused_OutOfResources);
         }
@@ -382,7 +382,7 @@ OFCondition DcmQueryRetrieveSCP::storeSCP(T_ASC_Association * assoc, T_DIMSE_C_S
         DCMQRDB_ERROR("storeSCP: file locking failed, cannot create file");
 
         /* must still receive data */
-        strcpy(imageFileName, NULL_DEVICE_NAME);
+        OFStandard::strlcpy(imageFileName, NULL_DEVICE_NAME, sizeof(imageFileName));
 
         /* callback will send back out of resources status */
         context.setStatus(STATUS_STORE_Refused_OutOfResources);
@@ -564,7 +564,7 @@ OFCondition DcmQueryRetrieveSCP::negotiateAssociation(T_ASC_Association * assoc)
     };
 
     DIC_AE calledAETitle;
-    ASC_getAPTitles(assoc->params, NULL, calledAETitle, NULL);
+    ASC_getAPTitles(assoc->params, NULL, 0, calledAETitle, sizeof(calledAETitle), NULL, 0);
 
     const char* transferSyntaxes[] = { NULL, NULL, NULL, NULL };
     int numTransferSyntaxes = 0;
@@ -1007,7 +1007,7 @@ OFCondition DcmQueryRetrieveSCP::waitForAssociation(T_ASC_Network * theNet)
     if (! go_cleanup)
     {
         /* Application Context Name */
-        cond = ASC_getApplicationContextName(assoc->params, buf);
+        cond = ASC_getApplicationContextName(assoc->params, buf, sizeof(buf));
         if (cond.bad() || strcmp(buf, DICOM_STDAPPLICATIONCONTEXT) != 0)
         {
             /* reject: the application context name is not supported */
index b7b09a24ca9f6fa2ba62620ade058d9e52e9495e..f11a2b1ad1723e1a61c97c71b0101f85a62d3573 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1993-2017, OFFIS e.V.
+ *  Copyright (C) 1993-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -51,15 +51,15 @@ static void
 TI_getInfoFromDataset(DcmDataset *dset, DIC_PN patientName, DIC_CS studyId,
     DIC_IS seriesNumber, DIC_CS modality, DIC_IS imageNumber)
 {
-    DU_getStringDOElement(dset, DCM_PatientName, patientName);
+    DU_getStringDOElement(dset, DCM_PatientName, patientName, sizeof(DIC_PN));
     DU_stripLeadingAndTrailingSpaces(patientName);
-    DU_getStringDOElement(dset, DCM_StudyID, studyId);
+    DU_getStringDOElement(dset, DCM_StudyID, studyId, sizeof(DIC_CS));
     DU_stripLeadingAndTrailingSpaces(studyId);
-    DU_getStringDOElement(dset, DCM_SeriesNumber, seriesNumber);
+    DU_getStringDOElement(dset, DCM_SeriesNumber, seriesNumber, sizeof(DIC_IS));
     DU_stripLeadingAndTrailingSpaces(seriesNumber);
-    DU_getStringDOElement(dset, DCM_Modality, modality);
+    DU_getStringDOElement(dset, DCM_Modality, modality, sizeof(DIC_CS));
     DU_stripLeadingAndTrailingSpaces(modality);
-    DU_getStringDOElement(dset, DCM_InstanceNumber, imageNumber);
+    DU_getStringDOElement(dset, DCM_InstanceNumber, imageNumber, sizeof(DIC_IS));
     DU_stripLeadingAndTrailingSpaces(imageNumber);
 }
 
@@ -291,9 +291,9 @@ TI_addSeriesEntry(TI_StudyEntry *study, DcmDataset *reply)
     bzero((char*)series, sizeof(TI_SeriesEntry)); /* make sure its clean */
 
     /* extract info from reply */
-    ok = DU_getStringDOElement(reply, DCM_SeriesInstanceUID, series->seriesInstanceUID);
-    if (ok) ok = DU_getStringDOElement(reply, DCM_SeriesNumber, series->seriesNumber);
-    if (ok) ok = DU_getStringDOElement(reply, DCM_Modality, series->modality);
+    ok = DU_getStringDOElement(reply, DCM_SeriesInstanceUID, series->seriesInstanceUID, sizeof(series->seriesInstanceUID));
+    if (ok) ok = DU_getStringDOElement(reply, DCM_SeriesNumber, series->seriesNumber, sizeof(series->seriesNumber));
+    if (ok) ok = DU_getStringDOElement(reply, DCM_Modality, series->modality, sizeof(series->modality));
 
     if (!ok) {
         DCMQRDB_ERROR("TI_addSeriesEntry: missing data in DB reply");
@@ -368,9 +368,8 @@ TI_addImageEntry(TI_SeriesEntry *series, DcmDataset *reply)
     bzero((char*)studyID, sizeof(DIC_CS));
 
     /* extract info from reply */
-    ok = DU_getStringDOElement(reply, DCM_SOPInstanceUID,
-        image->sopInstanceUID);
-    if (ok) ok = DU_getStringDOElement(reply, DCM_InstanceNumber, image->imageNumber);
+    ok = DU_getStringDOElement(reply, DCM_SOPInstanceUID, image->sopInstanceUID, sizeof(image->sopInstanceUID));
+    if (ok) ok = DU_getStringDOElement(reply, DCM_InstanceNumber, image->imageNumber, sizeof(image->imageNumber));
 
     if (!ok) {
         DCMQRDB_ERROR("TI_addImageEntry: missing data in DB reply");
@@ -446,10 +445,10 @@ TI_addStudyEntry(TI_DBEntry *db, DcmDataset *reply)
     bzero((char*)se, sizeof(TI_StudyEntry));  /* make sure its clean */
 
     /* extract info from reply */
-    ok = DU_getStringDOElement(reply, DCM_StudyInstanceUID, se->studyInstanceUID);
-    if (ok) ok = DU_getStringDOElement(reply, DCM_StudyID, se->studyID);
-    if (ok) ok = DU_getStringDOElement(reply, DCM_PatientName, se->patientName);
-    if (ok) ok = DU_getStringDOElement(reply, DCM_PatientID, se->patientID);
+    ok = DU_getStringDOElement(reply, DCM_StudyInstanceUID, se->studyInstanceUID, sizeof(se->studyInstanceUID));
+    if (ok) ok = DU_getStringDOElement(reply, DCM_StudyID, se->studyID, sizeof(se->studyID));
+    if (ok) ok = DU_getStringDOElement(reply, DCM_PatientName, se->patientName, sizeof(se->patientName));
+    if (ok) ok = DU_getStringDOElement(reply, DCM_PatientID, se->patientID, sizeof(se->patientID));
 
     if (!ok) {
         DCMQRDB_ERROR("TI_addStudyEntry: missing data in DB reply");
@@ -501,9 +500,9 @@ OFBool DcmQueryRetrieveTelnetInitiator::TI_detachAssociation(OFBool abortFlag)
       return OFTrue;  /* nothing to do */
     }
 
-    ASC_getPresentationAddresses(assoc->params, NULL,
-        presentationAddress);
-    ASC_getAPTitles(assoc->params, NULL, peerTitle, NULL);
+    ASC_getPresentationAddresses(assoc->params, NULL, 0,
+        presentationAddress, sizeof(presentationAddress));
+    ASC_getAPTitles(assoc->params, NULL, 0, peerTitle, sizeof(peerTitle), NULL, 0);
 
     if (abortFlag) {
         /* abort association */
@@ -617,9 +616,9 @@ OFBool DcmQueryRetrieveTelnetInitiator::TI_attachAssociation()
     }
 
     if (dbEntries[currentdb]->isRemoteDB) {
-        strcpy(currentAETitle, myAETitle);
+        OFStandard::strlcpy(currentAETitle, myAETitle, sizeof(currentAETitle));
     } else {
-        strcpy(currentAETitle, dbEntries[currentdb]->title);
+        OFStandard::strlcpy(currentAETitle, dbEntries[currentdb]->title, sizeof(currentAETitle));
     }
 
     cond = ASC_createAssociationParameters(&params, maxReceivePDULength);
@@ -700,7 +699,7 @@ OFBool DcmQueryRetrieveTelnetInitiator::TI_changeAssociation()
 
     if (assoc != NULL) {
         /* do we really need to change the association */
-        ASC_getAPTitles(assoc->params, NULL, actualPeerAETitle, NULL);
+        ASC_getAPTitles(assoc->params, NULL, 0, actualPeerAETitle, sizeof(actualPeerAETitle), NULL, 0);
         if (strcmp(actualPeerAETitle, currentPeerTitle) == 0) {
             /* no need to change */
             return OFTrue;
@@ -814,8 +813,8 @@ OFBool DcmQueryRetrieveTelnetInitiator::TI_storeImage(char *sopClass, char *sopI
     fflush(stdout);
     bzero((char*)&req, sizeof(req));
     req.MessageID = msgId;
-    strcpy(req.AffectedSOPClassUID, sopClass);
-    strcpy(req.AffectedSOPInstanceUID, sopInstance);
+    OFStandard::strlcpy(req.AffectedSOPClassUID, sopClass, sizeof(req.AffectedSOPClassUID));
+    OFStandard::strlcpy(req.AffectedSOPInstanceUID, sopInstance, sizeof(req.AffectedSOPInstanceUID));
     req.DataSetType = DIMSE_DATASET_PRESENT;
     req.Priority = DIMSE_PRIORITY_MEDIUM;
 
@@ -866,6 +865,7 @@ OFBool DcmQueryRetrieveTelnetInitiator::TI_remoteFindQuery(TI_DBEntry *db, DcmDa
     T_DIMSE_C_FindRQ  req;
     T_DIMSE_C_FindRSP rsp;
     DcmDataset    *stDetail = NULL;
+    int responseCount = 0;
 
     currentPeerTitle = db->title;
 
@@ -889,11 +889,11 @@ OFBool DcmQueryRetrieveTelnetInitiator::TI_remoteFindQuery(TI_DBEntry *db, DcmDa
     DCMQRDB_INFO("Sending Find SCU RQ: MsgID " << msgId << ":" << OFendl << DcmObject::PrintHelper(*query));
 
     req.MessageID = msgId;
-    strcpy(req.AffectedSOPClassUID,
-        UID_FINDStudyRootQueryRetrieveInformationModel);
+    OFStandard::strlcpy(req.AffectedSOPClassUID,
+        UID_FINDStudyRootQueryRetrieveInformationModel, sizeof(req.AffectedSOPClassUID));
     req.Priority = DIMSE_PRIORITY_MEDIUM;
 
-    cond = DIMSE_findUser(assoc, presId, &req, query,
+    cond = DIMSE_findUser(assoc, presId, &req, query, responseCount,
         findCallback, &cbd, blockMode_, dimse_timeout_, &rsp, &stDetail);
 
     if (cond.good()) {
@@ -960,7 +960,7 @@ OFBool DcmQueryRetrieveTelnetInitiator::TI_title(int arg, const char * /*cmdbuf*
 
     bzero(peerTitle, sizeof(peerTitle));
     if (assoc) {
-        ASC_getAPTitles(assoc->params, NULL, peerTitle, NULL);
+        ASC_getAPTitles(assoc->params, NULL, 0, peerTitle, sizeof(peerTitle), NULL, 0);
     }
 
     db = dbEntries[currentdb];
@@ -1456,8 +1456,8 @@ OFBool DcmQueryRetrieveTelnetInitiator::TI_sendStudy(int arg, const char * /*cmd
     }
 
     while (ok && dbStatus.status() == STATUS_Pending) {
-        dbcond = db->dbHandle->nextMoveResponse(sopClass, sopInstance,
-            imgFile, &nRemaining, &dbStatus);
+        dbcond = db->dbHandle->nextMoveResponse(sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance),
+            imgFile, sizeof(imgFile), &nRemaining, &dbStatus);
         if (dbcond.bad()) {
             DCMQRDB_ERROR("TI_sendStudy: database error");
             return OFFalse;
@@ -1539,8 +1539,8 @@ OFBool DcmQueryRetrieveTelnetInitiator::TI_sendSeries(int arg, const char * /*cm
     }
 
     while (ok && dbStatus.status() == STATUS_Pending) {
-        dbcond = db->dbHandle->nextMoveResponse(sopClass, sopInstance,
-            imgFile, &nRemaining, &dbStatus);
+        dbcond = db->dbHandle->nextMoveResponse(sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance),
+            imgFile, sizeof(imgFile), &nRemaining, &dbStatus);
         if (dbcond.bad()) {
             DCMQRDB_ERROR("TI_sendSeries: database error");
             return OFFalse;
@@ -1631,8 +1631,8 @@ OFBool DcmQueryRetrieveTelnetInitiator::TI_sendImage(int arg, const char * /*cmd
      * the database).
      */
     while (ok && dbStatus.status() == STATUS_Pending) {
-        dbcond = db->dbHandle->nextMoveResponse(sopClass, sopInstance,
-            imgFile, &nRemaining, &dbStatus);
+        dbcond = db->dbHandle->nextMoveResponse(sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance),
+            imgFile, sizeof(imgFile), &nRemaining, &dbStatus);
         if (dbcond.bad()) {
             DCMQRDB_ERROR("TI_sendImage: database error");
             return OFFalse;
index 1f387384b8c68fdea9f2f0dd893477951c554adb..fe09c8900babfa10e30e765b4395faac948cfcd8 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmrt)
+project(dcmrt)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmrt_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR})
+include_directories("${dcmrt_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc apps tests include)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc apps tests include)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 816a7084460a1e37ecb91558aefbfa8a188962f1..90e64b050b631a0e4f69e28d04956fdd90c421ea 100644 (file)
@@ -7,17 +7,19 @@ drtdump.o: drtdump.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmrt/drtdose.h ../include/dcmtk/dcmrt/drttypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofvector.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
index 40d36015d00fdd8ef07c844fd8abc7d08e465615..0370f56ecc480d73ce8e03ad4731f45c0b1de265 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmrt DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmrt DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 3a55c7a1fd18dc53324e37b1f085ac3656ee3742..ee5b4dacdd5bc377e0ff28bd8182eba55b439c2a 100644 (file)
@@ -36,6 +36,7 @@ drmdose.o: drmdose.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -44,6 +45,7 @@ drmdose.o: drmdose.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -235,6 +237,7 @@ drmimage.o: drmimage.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -243,6 +246,7 @@ drmimage.o: drmimage.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -447,6 +451,7 @@ drmplan.o: drmplan.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -455,6 +460,7 @@ drmplan.o: drmplan.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -656,6 +662,7 @@ drmstrct.o: drmstrct.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -664,6 +671,7 @@ drmstrct.o: drmstrct.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -853,6 +861,7 @@ drtaadcs.o: drtaadcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -860,6 +869,7 @@ drtaadcs.o: drtaadcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -970,6 +980,7 @@ drtadcs.o: drtadcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -977,6 +988,7 @@ drtadcs.o: drtadcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -1087,6 +1099,7 @@ drtads.o: drtads.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1094,6 +1107,7 @@ drtads.o: drtads.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -1204,6 +1218,7 @@ drtafs.o: drtafs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1211,6 +1226,7 @@ drtafs.o: drtafs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -1320,6 +1336,7 @@ drtags.o: drtags.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1327,6 +1344,7 @@ drtags.o: drtags.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -1436,6 +1454,7 @@ drtajcs.o: drtajcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1443,6 +1462,7 @@ drtajcs.o: drtajcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -1553,6 +1573,7 @@ drtas1.o: drtas1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1560,6 +1581,7 @@ drtas1.o: drtas1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -1670,6 +1692,7 @@ drtas5.o: drtas5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1677,6 +1700,7 @@ drtas5.o: drtas5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -1787,6 +1811,7 @@ drtas6.o: drtas6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1794,6 +1819,7 @@ drtas6.o: drtas6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -1903,6 +1929,7 @@ drtas7.o: drtas7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1910,6 +1937,7 @@ drtas7.o: drtas7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2019,6 +2047,7 @@ drtass.o: drtass.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2026,6 +2055,7 @@ drtass.o: drtass.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2140,6 +2170,7 @@ drtbads.o: drtbads.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2147,6 +2178,7 @@ drtbads.o: drtbads.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2256,6 +2288,7 @@ drtbas.o: drtbas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2263,6 +2296,7 @@ drtbas.o: drtbas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2373,6 +2407,7 @@ drtbcps.o: drtbcps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2380,6 +2415,7 @@ drtbcps.o: drtbcps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2490,6 +2526,7 @@ drtbl2.o: drtbl2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2497,6 +2534,7 @@ drtbl2.o: drtbl2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2606,6 +2644,7 @@ drtbl5.o: drtbl5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2613,6 +2652,7 @@ drtbl5.o: drtbl5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2722,6 +2762,7 @@ drtbldls.o: drtbldls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2729,6 +2770,7 @@ drtbldls.o: drtbldls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2838,6 +2880,7 @@ drtbldps.o: drtbldps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2845,6 +2888,7 @@ drtbldps.o: drtbldps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -2954,6 +2998,7 @@ drtblds1.o: drtblds1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2961,6 +3006,7 @@ drtblds1.o: drtblds1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -3070,6 +3116,7 @@ drtblds5.o: drtblds5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3077,6 +3124,7 @@ drtblds5.o: drtblds5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -3186,6 +3234,7 @@ drtblds6.o: drtblds6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3193,6 +3242,7 @@ drtblds6.o: drtblds6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -3302,6 +3352,7 @@ drtbldts.o: drtbldts.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3309,6 +3360,7 @@ drtbldts.o: drtbldts.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -3418,6 +3470,7 @@ drtbrcss.o: drtbrcss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3425,6 +3478,7 @@ drtbrcss.o: drtbrcss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -3535,6 +3589,7 @@ drtbrdrs.o: drtbrdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3542,6 +3597,7 @@ drtbrdrs.o: drtbrdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -3651,6 +3707,7 @@ drtbrs.o: drtbrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3658,6 +3715,7 @@ drtbrs.o: drtbrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -3769,6 +3827,7 @@ drtbs.o: drtbs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3776,6 +3835,7 @@ drtbs.o: drtbs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -3897,6 +3957,7 @@ drtbss.o: drtbss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3904,6 +3965,7 @@ drtbss.o: drtbss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -4013,6 +4075,7 @@ drtbvcps.o: drtbvcps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4020,6 +4083,7 @@ drtbvcps.o: drtbvcps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -4129,6 +4193,7 @@ drtcbars.o: drtcbars.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4136,6 +4201,7 @@ drtcbars.o: drtcbars.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -4246,6 +4312,7 @@ drtccs.o: drtccs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4253,6 +4320,7 @@ drtccs.o: drtccs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -4363,6 +4431,7 @@ drtcctus.o: drtcctus.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4370,6 +4439,7 @@ drtcctus.o: drtcctus.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -4479,6 +4549,7 @@ drtcdrs.o: drtcdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4486,6 +4557,7 @@ drtcdrs.o: drtcdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -4595,6 +4667,7 @@ drtces.o: drtces.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4602,6 +4675,7 @@ drtces.o: drtces.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -4714,6 +4788,7 @@ drtcgis.o: drtcgis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4721,6 +4796,7 @@ drtcgis.o: drtcgis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -4830,6 +4906,7 @@ drtchs.o: drtchs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4837,6 +4914,7 @@ drtchs.o: drtchs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -4949,6 +5027,7 @@ drtcims.o: drtcims.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4956,6 +5035,7 @@ drtcims.o: drtcims.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -5069,6 +5149,7 @@ drtcis.o: drtcis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -5076,6 +5157,7 @@ drtcis.o: drtcis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -5185,6 +5267,7 @@ drtcncs.o: drtcncs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -5192,6 +5275,7 @@ drtcncs.o: drtcncs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -5302,6 +5386,7 @@ drtcos.o: drtcos.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -5309,6 +5394,7 @@ drtcos.o: drtcos.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -5418,6 +5504,7 @@ drtcpas.o: drtcpas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -5425,6 +5512,7 @@ drtcpas.o: drtcpas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -5534,6 +5622,7 @@ drtcpis.o: drtcpis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -5541,6 +5630,7 @@ drtcpis.o: drtcpis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -5652,6 +5742,7 @@ drtcps.o: drtcps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -5659,6 +5750,7 @@ drtcps.o: drtcps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -5733,8 +5825,8 @@ drtcps.o: drtcps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmrt/seq/drtrdrs1.h \
  ../include/dcmtk/dcmrt/seq/drtbvcps.h \
  ../include/dcmtk/dcmrt/seq/drtrds.h ../include/dcmtk/dcmrt/seq/drtwps.h
-drtcsas.o: drtcsas.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtcsas.h \
+drtcs.o: drtcs.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtcs.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -5772,6 +5864,7 @@ drtcsas.o: drtcsas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -5779,6 +5872,7 @@ drtcsas.o: drtcsas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -5848,9 +5942,10 @@ drtcsas.o: drtcsas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
- ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
-drtcs.o: drtcs.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtcs.h \
+ ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
+ ../include/dcmtk/dcmrt/seq/drtcis.h
+drtcsas.o: drtcsas.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtcsas.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -5888,6 +5983,7 @@ drtcs.o: drtcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -5895,6 +5991,7 @@ drtcs.o: drtcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -5964,8 +6061,7 @@ drtcs.o: drtcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
- ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
- ../include/dcmtk/dcmrt/seq/drtcis.h
+ ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
 drtcshs.o: drtcshs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmrt/seq/drtcshs.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
@@ -6005,6 +6101,7 @@ drtcshs.o: drtcshs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -6012,6 +6109,7 @@ drtcshs.o: drtcshs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -6121,6 +6219,7 @@ drtcsis.o: drtcsis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -6128,6 +6227,7 @@ drtcsis.o: drtcsis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -6238,6 +6338,7 @@ drtcsrs.o: drtcsrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -6245,6 +6346,7 @@ drtcsrs.o: drtcsrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -6354,6 +6456,7 @@ drtcss.o: drtcss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -6361,6 +6464,7 @@ drtcss.o: drtcss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -6471,6 +6575,7 @@ drtdcs.o: drtdcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -6478,6 +6583,7 @@ drtdcs.o: drtdcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -6588,6 +6694,7 @@ drtdddps.o: drtdddps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -6595,6 +6702,7 @@ drtdddps.o: drtdddps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -6704,6 +6812,7 @@ drtddps.o: drtddps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -6711,6 +6820,7 @@ drtddps.o: drtddps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -6820,6 +6930,7 @@ drtdias.o: drtdias.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -6827,6 +6938,7 @@ drtdias.o: drtdias.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -6936,6 +7048,7 @@ drtdimcs.o: drtdimcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -6943,6 +7056,7 @@ drtdimcs.o: drtdimcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -7053,6 +7167,7 @@ drtdimrs.o: drtdimrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -7060,6 +7175,7 @@ drtdimrs.o: drtdimrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -7169,6 +7285,7 @@ drtdirs.o: drtdirs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -7176,6 +7293,7 @@ drtdirs.o: drtdirs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -7283,6 +7401,7 @@ drtdose.o: drtdose.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -7291,6 +7410,7 @@ drtdose.o: drtdose.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -7482,6 +7602,7 @@ drtdrs.o: drtdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -7489,6 +7610,7 @@ drtdrs.o: drtdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -7598,6 +7720,7 @@ drtds.o: drtds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -7605,6 +7728,7 @@ drtds.o: drtds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -7715,6 +7839,7 @@ drtdspcs.o: drtdspcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -7722,6 +7847,7 @@ drtdspcs.o: drtdspcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -7832,6 +7958,7 @@ drtdss.o: drtdss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -7839,6 +7966,7 @@ drtdss.o: drtdss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -7950,6 +8078,7 @@ drtdvhs.o: drtdvhs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -7957,6 +8086,7 @@ drtdvhs.o: drtdvhs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -8067,6 +8197,7 @@ drtdvrrs.o: drtdvrrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -8074,6 +8205,7 @@ drtdvrrs.o: drtdvrrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -8183,6 +8315,7 @@ drteas.o: drteas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -8190,6 +8323,7 @@ drteas.o: drteas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -8299,6 +8433,7 @@ drtecs.o: drtecs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -8306,6 +8441,7 @@ drtecs.o: drtecs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -8415,6 +8551,7 @@ drtes.o: drtes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -8422,6 +8559,7 @@ drtes.o: drtes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -8535,6 +8673,7 @@ drtfds.o: drtfds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -8542,6 +8681,7 @@ drtfds.o: drtfds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -8651,6 +8791,7 @@ drtfes.o: drtfes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -8658,6 +8799,7 @@ drtfes.o: drtfes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -8767,6 +8909,7 @@ drtfgs.o: drtfgs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -8774,6 +8917,7 @@ drtfgs.o: drtfgs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -8887,6 +9031,7 @@ drtfgss.o: drtfgss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -8894,6 +9039,7 @@ drtfgss.o: drtfgss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -9004,6 +9150,7 @@ drtfms.o: drtfms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -9011,6 +9158,7 @@ drtfms.o: drtfms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -9120,6 +9268,7 @@ drtfsss.o: drtfsss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -9127,6 +9276,7 @@ drtfsss.o: drtfsss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -9236,6 +9386,7 @@ drtgas.o: drtgas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -9243,6 +9394,7 @@ drtgas.o: drtgas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -9352,6 +9504,7 @@ drtgmcs.o: drtgmcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -9359,6 +9512,7 @@ drtgmcs.o: drtgmcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -9469,6 +9623,7 @@ drtgms.o: drtgms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -9476,6 +9631,7 @@ drtgms.o: drtgms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -9586,6 +9742,7 @@ drtgpis.o: drtgpis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -9593,6 +9750,7 @@ drtgpis.o: drtgpis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -9706,6 +9864,7 @@ drthsdrs.o: drthsdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -9713,6 +9872,7 @@ drthsdrs.o: drthsdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -9822,6 +9982,7 @@ drtiais.o: drtiais.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -9829,6 +9990,7 @@ drtiais.o: drtiais.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -9938,6 +10100,7 @@ drtians.o: drtians.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -9945,6 +10108,7 @@ drtians.o: drtians.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -10054,6 +10218,7 @@ drtiblds.o: drtiblds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -10061,6 +10226,7 @@ drtiblds.o: drtiblds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -10170,6 +10336,7 @@ drtibls.o: drtibls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -10177,6 +10344,7 @@ drtibls.o: drtibls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -10287,6 +10455,7 @@ drtibs.o: drtibs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -10294,6 +10463,7 @@ drtibs.o: drtibs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -10421,6 +10591,7 @@ drticpds.o: drticpds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -10428,6 +10599,7 @@ drticpds.o: drticpds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -10545,6 +10717,7 @@ drticps.o: drticps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -10552,6 +10725,7 @@ drticps.o: drticps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -10667,6 +10841,7 @@ drtics.o: drtics.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -10674,6 +10849,7 @@ drtics.o: drtics.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -10784,6 +10960,7 @@ drtiis.o: drtiis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -10791,6 +10968,7 @@ drtiis.o: drtiis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -10898,6 +11076,7 @@ drtimage.o: drtimage.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -10906,6 +11085,7 @@ drtimage.o: drtimage.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -11092,6 +11272,7 @@ drtionpl.o: drtionpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -11100,6 +11281,7 @@ drtionpl.o: drtionpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -11299,6 +11481,7 @@ drtiontr.o: drtiontr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -11307,6 +11490,7 @@ drtiontr.o: drtiontr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -11514,6 +11698,7 @@ drtipiqs.o: drtipiqs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -11521,6 +11706,7 @@ drtipiqs.o: drtipiqs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -11633,6 +11819,7 @@ drtircs.o: drtircs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -11640,6 +11827,7 @@ drtircs.o: drtircs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -11749,6 +11937,7 @@ drtiseis.o: drtiseis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -11756,6 +11945,7 @@ drtiseis.o: drtiseis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -11865,6 +12055,7 @@ drtitts.o: drtitts.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -11872,6 +12063,7 @@ drtitts.o: drtitts.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -11982,6 +12174,7 @@ drtiwps.o: drtiwps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -11989,6 +12182,7 @@ drtiwps.o: drtiwps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -12098,6 +12292,7 @@ drtiws.o: drtiws.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -12105,6 +12300,7 @@ drtiws.o: drtiws.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -12175,8 +12371,8 @@ drtiws.o: drtiws.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
-drtlsds6.o: drtlsds6.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtlsds6.h \
+drtlsds.o: drtlsds.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtlsds.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -12214,6 +12410,7 @@ drtlsds6.o: drtlsds6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -12221,6 +12418,7 @@ drtlsds6.o: drtlsds6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -12291,8 +12489,8 @@ drtlsds6.o: drtlsds6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
-drtlsds7.o: drtlsds7.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtlsds7.h \
+drtlsds6.o: drtlsds6.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtlsds6.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -12330,6 +12528,7 @@ drtlsds7.o: drtlsds7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -12337,6 +12536,7 @@ drtlsds7.o: drtlsds7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -12407,8 +12607,8 @@ drtlsds7.o: drtlsds7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
-drtlsds.o: drtlsds.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtlsds.h \
+drtlsds7.o: drtlsds7.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtlsds7.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -12446,6 +12646,7 @@ drtlsds.o: drtlsds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -12453,6 +12654,7 @@ drtlsds.o: drtlsds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -12562,6 +12764,7 @@ drtmacds.o: drtmacds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -12569,6 +12772,7 @@ drtmacds.o: drtmacds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -12679,6 +12883,7 @@ drtmas.o: drtmas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -12686,6 +12891,7 @@ drtmas.o: drtmas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -12795,6 +13001,7 @@ drtmdrs.o: drtmdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -12802,6 +13009,7 @@ drtmdrs.o: drtmdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -12911,6 +13119,7 @@ drtmls.o: drtmls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -12918,6 +13127,7 @@ drtmls.o: drtmls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -13027,6 +13237,7 @@ drtmps.o: drtmps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -13034,6 +13245,7 @@ drtmps.o: drtmps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -13143,6 +13355,7 @@ drtmris.o: drtmris.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -13150,6 +13363,7 @@ drtmris.o: drtmris.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -13259,6 +13473,7 @@ drtmss.o: drtmss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -13266,6 +13481,7 @@ drtmss.o: drtmss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -13375,6 +13591,7 @@ drtmucs.o: drtmucs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -13382,6 +13599,7 @@ drtmucs.o: drtmucs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -13492,6 +13710,7 @@ drtoas.o: drtoas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -13499,6 +13718,7 @@ drtoas.o: drtoas.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -13609,6 +13829,7 @@ drtois.o: drtois.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -13616,6 +13837,7 @@ drtois.o: drtois.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -13727,6 +13949,7 @@ drtopis.o: drtopis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -13734,6 +13957,7 @@ drtopis.o: drtopis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -13847,6 +14071,7 @@ drtos.o: drtos.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -13854,6 +14079,7 @@ drtos.o: drtos.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -13965,6 +14191,7 @@ drtpbcs.o: drtpbcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -13972,6 +14199,7 @@ drtpbcs.o: drtpbcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -14082,6 +14310,7 @@ drtpcs.o: drtpcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -14089,6 +14318,7 @@ drtpcs.o: drtpcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -14199,6 +14429,7 @@ drtpcxs.o: drtpcxs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -14206,6 +14437,7 @@ drtpcxs.o: drtpcxs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -14320,6 +14552,7 @@ drtpdecs.o: drtpdecs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -14327,6 +14560,7 @@ drtpdecs.o: drtpdecs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -14438,6 +14672,7 @@ drtpdeds.o: drtpdeds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -14445,6 +14680,7 @@ drtpdeds.o: drtpdeds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -14554,6 +14790,7 @@ drtpfms.o: drtpfms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -14561,6 +14798,7 @@ drtpfms.o: drtpfms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -14670,6 +14908,7 @@ drtpics.o: drtpics.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -14677,6 +14916,7 @@ drtpics.o: drtpics.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -14785,6 +15025,7 @@ drtplan.o: drtplan.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -14793,6 +15034,7 @@ drtplan.o: drtplan.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -14995,6 +15237,7 @@ drtporcs.o: drtporcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -15002,6 +15245,7 @@ drtporcs.o: drtporcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -15112,6 +15356,7 @@ drtporis.o: drtporis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -15119,6 +15364,7 @@ drtporis.o: drtporis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -15230,6 +15476,7 @@ drtppcs.o: drtppcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -15237,6 +15484,7 @@ drtppcs.o: drtppcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -15351,6 +15599,7 @@ drtprsis.o: drtprsis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -15358,6 +15607,7 @@ drtprsis.o: drtprsis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -15469,6 +15719,7 @@ drtpscs.o: drtpscs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -15476,6 +15727,7 @@ drtpscs.o: drtpscs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -15586,6 +15838,7 @@ drtpsics.o: drtpsics.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -15593,6 +15846,7 @@ drtpsics.o: drtpsics.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -15703,6 +15957,7 @@ drtpss.o: drtpss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -15710,6 +15965,7 @@ drtpss.o: drtpss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -15822,6 +16078,7 @@ drtpsss.o: drtpsss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -15829,6 +16086,7 @@ drtpsss.o: drtpsss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -15938,6 +16196,7 @@ drtpvis.o: drtpvis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -15945,6 +16204,7 @@ drtpvis.o: drtpvis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -16054,6 +16314,7 @@ drtqds.o: drtqds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -16061,6 +16322,7 @@ drtqds.o: drtqds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -16174,6 +16436,7 @@ drtras.o: drtras.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -16181,6 +16444,7 @@ drtras.o: drtras.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -16300,6 +16564,7 @@ drtrbas2.o: drtrbas2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -16307,6 +16572,7 @@ drtrbas2.o: drtrbas2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -16416,6 +16682,7 @@ drtrbas8.o: drtrbas8.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -16423,6 +16690,7 @@ drtrbas8.o: drtrbas8.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -16532,6 +16800,7 @@ drtrbls.o: drtrbls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -16539,6 +16808,7 @@ drtrbls.o: drtrbls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -16648,6 +16918,7 @@ drtrbos1.o: drtrbos1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -16655,6 +16926,7 @@ drtrbos1.o: drtrbos1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -16764,6 +17036,7 @@ drtrbos6.o: drtrbos6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -16771,6 +17044,7 @@ drtrbos6.o: drtrbos6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -16880,6 +17154,7 @@ drtrbos7.o: drtrbos7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -16887,6 +17162,7 @@ drtrbos7.o: drtrbos7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -16996,6 +17272,7 @@ drtrbs2.o: drtrbs2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -17003,6 +17280,7 @@ drtrbs2.o: drtrbs2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -17113,6 +17391,7 @@ drtrbs4.o: drtrbs4.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -17120,6 +17399,7 @@ drtrbs4.o: drtrbs4.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -17229,6 +17509,7 @@ drtrbs8.o: drtrbs8.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -17236,6 +17517,7 @@ drtrbs8.o: drtrbs8.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -17345,6 +17627,7 @@ drtrcdrs.o: drtrcdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -17352,6 +17635,7 @@ drtrcdrs.o: drtrcdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -17461,6 +17745,7 @@ drtrcos.o: drtrcos.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -17468,6 +17753,7 @@ drtrcos.o: drtrcos.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -17577,6 +17863,7 @@ drtrcps.o: drtrcps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -17584,6 +17871,7 @@ drtrcps.o: drtrcps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -17693,6 +17981,7 @@ drtrcs.o: drtrcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -17700,6 +17989,7 @@ drtrcs.o: drtrcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -17810,6 +18100,7 @@ drtrdros.o: drtrdros.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -17817,6 +18108,7 @@ drtrdros.o: drtrdros.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -17926,6 +18218,7 @@ drtrdrs1.o: drtrdrs1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -17933,6 +18226,7 @@ drtrdrs1.o: drtrdrs1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -18043,6 +18337,7 @@ drtrdrs6.o: drtrdrs6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -18050,6 +18345,7 @@ drtrdrs6.o: drtrdrs6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -18159,6 +18455,7 @@ drtrdrs8.o: drtrdrs8.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -18166,6 +18463,7 @@ drtrdrs8.o: drtrdrs8.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -18275,6 +18573,7 @@ drtrds.o: drtrds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -18282,6 +18581,7 @@ drtrds.o: drtrds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -18391,6 +18691,7 @@ drtrecs.o: drtrecs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -18398,6 +18699,7 @@ drtrecs.o: drtrecs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -18507,6 +18809,7 @@ drtrfgs.o: drtrfgs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -18514,6 +18817,7 @@ drtrfgs.o: drtrfgs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -18626,6 +18930,7 @@ drtrfors.o: drtrfors.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -18633,6 +18938,7 @@ drtrfors.o: drtrfors.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -18744,6 +19050,7 @@ drtrics.o: drtrics.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -18751,6 +19058,7 @@ drtrics.o: drtrics.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -18862,6 +19170,7 @@ drtrims.o: drtrims.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -18869,6 +19178,7 @@ drtrims.o: drtrims.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -18980,6 +19290,7 @@ drtris.o: drtris.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -18987,6 +19298,7 @@ drtris.o: drtris.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -19098,6 +19410,7 @@ drtrlsds.o: drtrlsds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -19105,6 +19418,7 @@ drtrlsds.o: drtrlsds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -19214,6 +19528,7 @@ drtrmdrs.o: drtrmdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -19221,6 +19536,7 @@ drtrmdrs.o: drtrmdrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -19330,6 +19646,7 @@ drtrms.o: drtrms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -19337,6 +19654,7 @@ drtrms.o: drtrms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -19446,6 +19764,7 @@ drtrmss6.o: drtrmss6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -19453,6 +19772,7 @@ drtrmss6.o: drtrmss6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -19562,6 +19882,7 @@ drtrmss7.o: drtrmss7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -19569,6 +19890,7 @@ drtrmss7.o: drtrmss7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -19678,6 +20000,7 @@ drtrpcs.o: drtrpcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -19685,6 +20008,7 @@ drtrpcs.o: drtrpcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -19795,6 +20119,7 @@ drtrpis.o: drtrpis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -19802,6 +20127,7 @@ drtrpis.o: drtrpis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -19913,6 +20239,7 @@ drtrppcs.o: drtrppcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -19920,6 +20247,7 @@ drtrppcs.o: drtrppcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -20030,6 +20358,7 @@ drtrpphs.o: drtrpphs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -20037,6 +20366,7 @@ drtrpphs.o: drtrpphs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -20151,6 +20481,7 @@ drtrpps.o: drtrpps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -20158,6 +20489,7 @@ drtrpps.o: drtrpps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -20268,6 +20600,7 @@ drtrppss.o: drtrppss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -20275,6 +20608,7 @@ drtrppss.o: drtrppss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -20384,6 +20718,7 @@ drtrps.o: drtrps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -20391,6 +20726,7 @@ drtrps.o: drtrps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -20500,6 +20836,7 @@ drtrris1.o: drtrris1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -20507,6 +20844,7 @@ drtrris1.o: drtrris1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -20616,6 +20954,7 @@ drtrris6.o: drtrris6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -20623,6 +20962,7 @@ drtrris6.o: drtrris6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -20732,6 +21072,7 @@ drtrris9.o: drtrris9.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -20739,6 +21080,7 @@ drtrris9.o: drtrris9.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -20848,6 +21190,7 @@ drtrrms.o: drtrrms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -20855,6 +21198,7 @@ drtrrms.o: drtrrms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -20964,6 +21308,7 @@ drtrros.o: drtrros.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -20971,6 +21316,7 @@ drtrros.o: drtrros.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -21087,6 +21433,7 @@ drtrrpcs.o: drtrrpcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -21094,6 +21441,7 @@ drtrrpcs.o: drtrrpcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -21204,6 +21552,7 @@ drtrrros.o: drtrrros.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -21211,6 +21560,7 @@ drtrrros.o: drtrrros.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -21320,6 +21670,7 @@ drtrrs.o: drtrrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -21327,6 +21678,7 @@ drtrrs.o: drtrrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -21436,6 +21788,7 @@ drtrrshs.o: drtrrshs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -21443,6 +21796,7 @@ drtrrshs.o: drtrrshs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -21513,8 +21867,8 @@ drtrrshs.o: drtrrshs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
-drtrrtps3.o: drtrrtps3.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtrrtps3.h \
+drtrrtps.o: drtrrtps.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtrrtps.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -21552,6 +21906,7 @@ drtrrtps3.o: drtrrtps3.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -21559,6 +21914,7 @@ drtrrtps3.o: drtrrtps3.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -21628,9 +21984,13 @@ drtrrtps3.o: drtrrtps3.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
- ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
-drtrrtps4.o: drtrrtps4.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtrrtps4.h \
+ ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
+ ../include/dcmtk/dcmrt/seq/drtrfgs.h \
+ ../include/dcmtk/dcmrt/seq/drtrbs2.h \
+ ../include/dcmtk/dcmrt/seq/drtrcps.h \
+ ../include/dcmtk/dcmrt/seq/drtrbas2.h
+drtrrtps3.o: drtrrtps3.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtrrtps3.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -21668,6 +22028,7 @@ drtrrtps4.o: drtrrtps4.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -21675,6 +22036,7 @@ drtrrtps4.o: drtrrtps4.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -21745,8 +22107,8 @@ drtrrtps4.o: drtrrtps4.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
-drtrrtps5.o: drtrrtps5.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtrrtps5.h \
+drtrrtps4.o: drtrrtps4.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtrrtps4.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -21784,6 +22146,7 @@ drtrrtps5.o: drtrrtps5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -21791,6 +22154,7 @@ drtrrtps5.o: drtrrtps5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -21861,8 +22225,8 @@ drtrrtps5.o: drtrrtps5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
-drtrrtps.o: drtrrtps.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtrrtps.h \
+drtrrtps5.o: drtrrtps5.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtrrtps5.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -21900,6 +22264,7 @@ drtrrtps.o: drtrrtps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -21907,6 +22272,7 @@ drtrrtps.o: drtrrtps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -21976,11 +22342,7 @@ drtrrtps.o: drtrrtps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrof.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
- ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
- ../include/dcmtk/dcmrt/seq/drtrfgs.h \
- ../include/dcmtk/dcmrt/seq/drtrbs2.h \
- ../include/dcmtk/dcmrt/seq/drtrcps.h \
- ../include/dcmtk/dcmrt/seq/drtrbas2.h
+ ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
 drtrscs.o: drtrscs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmrt/seq/drtrscs.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
@@ -22020,6 +22382,7 @@ drtrscs.o: drtrscs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -22027,6 +22390,7 @@ drtrscs.o: drtrscs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -22137,6 +22501,7 @@ drtrsers.o: drtrsers.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -22144,6 +22509,7 @@ drtrsers.o: drtrsers.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -22256,6 +22622,7 @@ drtrses.o: drtrses.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -22263,6 +22630,7 @@ drtrses.o: drtrses.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -22334,8 +22702,8 @@ drtrses.o: drtrses.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h \
  ../include/dcmtk/dcmrt/seq/drtcis.h
-drtrshs6.o: drtrshs6.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtrshs6.h \
+drtrshs.o: drtrshs.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtrshs.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -22373,6 +22741,7 @@ drtrshs6.o: drtrshs6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -22380,6 +22749,7 @@ drtrshs6.o: drtrshs6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -22450,8 +22820,8 @@ drtrshs6.o: drtrshs6.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
-drtrshs7.o: drtrshs7.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtrshs7.h \
+drtrshs6.o: drtrshs6.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtrshs6.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -22489,6 +22859,7 @@ drtrshs7.o: drtrshs7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -22496,6 +22867,7 @@ drtrshs7.o: drtrshs7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -22566,8 +22938,8 @@ drtrshs7.o: drtrshs7.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrod.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrol.h \
  ../../dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
-drtrshs.o: drtrshs.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmrt/seq/drtrshs.h \
+drtrshs7.o: drtrshs7.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmrt/seq/drtrshs7.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -22605,6 +22977,7 @@ drtrshs.o: drtrshs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -22612,6 +22985,7 @@ drtrshs.o: drtrshs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -22721,6 +23095,7 @@ drtrsis.o: drtrsis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -22728,6 +23103,7 @@ drtrsis.o: drtrsis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -22837,6 +23213,7 @@ drtrsns.o: drtrsns.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -22844,6 +23221,7 @@ drtrsns.o: drtrsns.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -22953,6 +23331,7 @@ drtrsos.o: drtrsos.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -22960,6 +23339,7 @@ drtrsos.o: drtrsos.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -23069,6 +23449,7 @@ drtrsrs.o: drtrsrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -23076,6 +23457,7 @@ drtrsrs.o: drtrsrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -23185,6 +23567,7 @@ drtrss.o: drtrss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -23192,6 +23575,7 @@ drtrss.o: drtrss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -23301,6 +23685,7 @@ drtrsss.o: drtrsss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -23308,6 +23693,7 @@ drtrsss.o: drtrsss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -23417,6 +23803,7 @@ drtrsts.o: drtrsts.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -23424,6 +23811,7 @@ drtrsts.o: drtrsts.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -23534,6 +23922,7 @@ drtrtrs2.o: drtrtrs2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -23541,6 +23930,7 @@ drtrtrs2.o: drtrtrs2.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -23652,6 +24042,7 @@ drtrtrs4.o: drtrtrs4.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -23659,6 +24050,7 @@ drtrtrs4.o: drtrtrs4.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -23768,6 +24160,7 @@ drtrvis.o: drtrvis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -23775,6 +24168,7 @@ drtrvis.o: drtrvis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -23884,6 +24278,7 @@ drtrws.o: drtrws.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -23891,6 +24286,7 @@ drtrws.o: drtrws.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -24000,6 +24396,7 @@ drtrwvms.o: drtrwvms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -24007,6 +24404,7 @@ drtrwvms.o: drtrwvms.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -24120,6 +24518,7 @@ drtscris.o: drtscris.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -24127,6 +24526,7 @@ drtscris.o: drtscris.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -24240,6 +24640,7 @@ drtscs.o: drtscs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -24247,6 +24648,7 @@ drtscs.o: drtscs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -24357,6 +24759,7 @@ drtsdcs.o: drtsdcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -24364,6 +24767,7 @@ drtsdcs.o: drtsdcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -24474,6 +24878,7 @@ drtsds.o: drtsds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -24481,6 +24886,7 @@ drtsds.o: drtsds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -24590,6 +24996,7 @@ drtshds.o: drtshds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -24597,6 +25004,7 @@ drtshds.o: drtshds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -24706,6 +25114,7 @@ drtsins.o: drtsins.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -24713,6 +25122,7 @@ drtsins.o: drtsins.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -24824,6 +25234,7 @@ drtsis.o: drtsis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -24831,6 +25242,7 @@ drtsis.o: drtsis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -24942,6 +25354,7 @@ drtsns.o: drtsns.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -24949,6 +25362,7 @@ drtsns.o: drtsns.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -25058,6 +25472,7 @@ drtspccs.o: drtspccs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -25065,6 +25480,7 @@ drtspccs.o: drtspccs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -25175,6 +25591,7 @@ drtspcs.o: drtspcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -25182,6 +25599,7 @@ drtspcs.o: drtspcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -25296,6 +25714,7 @@ drtspgis.o: drtspgis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -25303,6 +25722,7 @@ drtspgis.o: drtspgis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -25416,6 +25836,7 @@ drtsptcs.o: drtsptcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -25423,6 +25844,7 @@ drtsptcs.o: drtsptcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -25533,6 +25955,7 @@ drtss.o: drtss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -25540,6 +25963,7 @@ drtss.o: drtss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -25649,6 +26073,7 @@ drtssrcs.o: drtssrcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -25656,6 +26081,7 @@ drtssrcs.o: drtssrcs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -25766,6 +26192,7 @@ drtssrs.o: drtssrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -25773,6 +26200,7 @@ drtssrs.o: drtssrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -25883,6 +26311,7 @@ drtsss.o: drtsss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -25890,6 +26319,7 @@ drtsss.o: drtsss.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -25999,6 +26429,7 @@ drtstrct.o: drtstrct.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -26007,6 +26438,7 @@ drtstrct.o: drtstrct.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -26196,6 +26628,7 @@ drttms0.o: drttms0.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -26203,6 +26636,7 @@ drttms0.o: drttms0.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -26312,6 +26746,7 @@ drttms9.o: drttms9.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -26319,6 +26754,7 @@ drttms9.o: drttms9.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -26426,6 +26862,7 @@ drttreat.o: drttreat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -26434,6 +26871,7 @@ drttreat.o: drttreat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -26614,6 +27052,7 @@ drttscds.o: drttscds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -26621,6 +27060,7 @@ drttscds.o: drttscds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -26730,6 +27170,7 @@ drttsibs.o: drttsibs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -26737,6 +27178,7 @@ drttsibs.o: drttsibs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -26869,6 +27311,7 @@ drttsmds.o: drttsmds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -26876,6 +27319,7 @@ drttsmds.o: drttsmds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -26985,6 +27429,7 @@ drttts.o: drttts.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -26992,6 +27437,7 @@ drttts.o: drttts.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -27100,6 +27546,7 @@ drttypes.o: drttypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -27108,6 +27555,7 @@ drttypes.o: drttypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -27217,6 +27665,7 @@ drtudis.o: drtudis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -27224,6 +27673,7 @@ drtudis.o: drtudis.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -27333,6 +27783,7 @@ drtvls.o: drtvls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -27340,6 +27791,7 @@ drtvls.o: drtvls.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -27449,6 +27901,7 @@ drtwps.o: drtwps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -27456,6 +27909,7 @@ drtwps.o: drtwps.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -27565,6 +28019,7 @@ drtwrs.o: drtwrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -27572,6 +28027,7 @@ drtwrs.o: drtwrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -27681,6 +28137,7 @@ drtwrsrs.o: drtwrsrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -27688,6 +28145,7 @@ drtwrsrs.o: drtwrsrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -27797,6 +28255,7 @@ drtws.o: drtws.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -27804,6 +28263,7 @@ drtws.o: drtws.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -27913,6 +28373,7 @@ drtxrs.o: drtxrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -27920,6 +28381,7 @@ drtxrs.o: drtxrs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
index fdfaae8db6ad94eb7dd23639b44bee2d59ebf670..375723b1a8b69f84e60259a3efd1cbcdfb76d36c 100644 (file)
@@ -35,6 +35,7 @@ drttest.o: drttest.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -43,6 +44,7 @@ drttest.o: drttest.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
@@ -258,17 +260,19 @@ tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -305,17 +309,19 @@ tsearch.o: tsearch.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
index 7d32432def6e002a38e3997c0c2a05651875a220..37bd9d6c25f3fec3299664e7c5b2c4db9784183c 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmseg)
+project(dcmseg)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmseg_SOURCE_DIR}/include" "${dcmfg_SOURCE_DIR}/include" "${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
+include_directories("${dcmseg_SOURCE_DIR}/include" "${dcmfg_SOURCE_DIR}/include" "${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc include tests)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc include tests)
+  add_subdirectory(${SUBDIR})
+endforeach()
index e6564111ca449c7e4e2a4abb0d1bf9dc7fd24c2f..3dd090ae594921cf203c6e5df885a2d041419a20 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmseg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h" PATTERN "CVS" EXCLUDE)
+install(DIRECTORY dcmtk/dcmseg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 98be26644b43cd59c83daf779f7d0107787c466f..f71cbc8799ece733b1801ddceaf6d8c8d4ef90b7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -335,6 +335,45 @@ public:
   virtual OFCondition setContentIdentification(const ContentIdentificationMacro& contentIdentification,
                                                const OFBool checkValue = OFTrue);
 
+  /** Import Patient, Study, and Frame of Reference level information from the
+   *  given item. The method does only import Frame of Reference if Frame of
+   *  Reference (FoR) UID is found in the image (and no error is reported if not).
+   *  The reason is that if the source images of the segmentation do have an
+   *  FoR, the segmentation object must have the same one, so we must import it.
+   *  If the images do not have an FoR, we must not try at all importing it.
+   *  If the log stream is set and valid the, the reason for any error might be
+   *  obtained from the error/warning output.
+   *  @param  dataset Reference to DICOM dataset from which the document
+   *          should be read
+   *  @param  takeOverCharset If OFTrue (default), Specific Character Set is
+   *                          taken over from imported dataset. If it's not
+   *                          present or empty (invalid), the attribute will
+   *                          not be present in this class either.
+   *  @return EC_Normal if successful, an error code otherwise
+   */
+  virtual OFCondition importFromSourceImage(DcmItem& dataset,
+                                            const OFBool takeOverCharset = OFTrue);
+
+  /** Import Patient, Study, and Frame of Reference level information from the
+   *  given item. The method does only import Frame of Reference if Frame of
+   *  Reference UID is found in the image (and no error is reported if not).
+   *  The reason is that if the source images of the segmentation do have an
+   *  FoR, the segmentation object must have the same one, so we must import it.
+   *  If the images do not have an FoR, we must not try at all importing it.
+   *  The current content of this object is not deleted before reading.
+   *  If the log stream is set and valid the, the reason for any error might be
+   *  obtained from the error/warning output.
+   *  @param  filename Reference to DICOM dataset from which the document
+   *          should be read
+   *  @param  takeOverCharset If OFTrue (default), Specific Character Set is
+   *                          taken over from imported dataset. If it's not
+   *                          present or empty (invalid), the attribute will
+   *                          not be present in this class either.
+   *  @return EC_Normal if successful, an error code otherwise
+   */
+  virtual OFCondition importFromSourceImage(const OFString& filename,
+                                            const OFBool takeOverCharset = OFTrue);
+
 protected:
 
   /** Protected default constructor. Library users should the factory create..()
@@ -464,11 +503,12 @@ protected:
    *  @param  bitsPerFrame The number of bits per frame (usually rows * columns)
    *  @param  results The resulting frames. Memory for the frames is allocated
    *          by the method, so the Vector can/should be empty before calling.
+   *  @result Return EC_Normal on success, error otherwise
    */
-  virtual void extractFrames(Uint8* pixData,
-                             const size_t numFrames,
-                             const size_t bitsPerFrame,
-                             OFVector< DcmIODTypes::Frame* >& results);
+  virtual OFCondition extractFrames(Uint8* pixData,
+                                   const size_t numFrames,
+                                   const size_t bitsPerFrame,
+                                   OFVector< DcmIODTypes::Frame* >& results);
 
   /** This is the counterpart to the extractFrames() function. It takes a number
    *  of frames that are in binary segmentation format (i.e. "bit-packed") and
@@ -492,14 +532,6 @@ protected:
    */
   virtual OFCondition addFrame(Uint8* pixData);
 
-  /// Constant code (required by Segmentation IOD) used to fill Derivation
-  /// Image Functional Group
-  const CodeSequenceMacro  DERIVATION_CODE;
-
-  /// Constant code (required by Segmentation IOD) used to fill Derivation
-  /// Image Functional Group
-  const CodeSequenceMacro PURPOSE_OF_REFERENCE_CODE;
-
 private:
 
   // Modules supported:
@@ -588,27 +620,22 @@ private:
                               const OFString& filename,
                               DcmDataset*& dset);
 
-  /** Returns the number of bits per frame, taking into account binary versus
-   *  fractional segmentation (member variables) and the dimensions of the
-   *  image (parameters)
-   *  @param  rows The number of rows returned
-   *  @param  cols The number of columns returned
-   *  @return Bits used by a single frame of the segmentation
-   */
-  size_t getBitsPerFrame(const Uint16& rows,
-                         const Uint16& cols);
-
-  /** Returns the number of total bytes required for the frame data of this
+  /** Computes the number of total bytes required for the frame data of this
    *  segmentation object. Takes into account dimensions and number of frames,
-   *  as well as the type of segmentation (member variables).
+   *  as well as the type of segmentation (member variables). May file if
+   *  size_t type is not able to hold the result of intermediate computations.
    *  @param  rows Number of rows of a frame
    *  @param  cols Number of cols of a frame
    *  @param  numberOfFrames The number of frames of the object
-   *  @return Number of bytes used by all frames of this segmentation
-   */
-  size_t getTotalBytesRequired(const Uint16& rows,
-                               const Uint16& cols,
-                               const Uint16& numberOfFrames);
+   *  @param  bytesRequired Will hold the result of the computation,
+   *          if successful. Does not any padding into account.
+   *  @return EC_Normal if computation was possible, EC_TooManyBytesRequested
+   *          otherwise.
+   */
+  OFCondition getTotalBytesRequired(const Uint16& rows,
+                                    const Uint16& cols,
+                                    const Uint32& numberOfFrames,
+                                    size_t& bytesRequired);
 
   /** Read Fractional Type of segmentation.
    *  @param  item The item to read from
index ce253e3ae3e9ca723f32c6e34b1bab570712e83c..f2f0d444131963568acea662e781b8579d9df272 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -272,7 +272,7 @@ public:
   virtual OFCondition setTrackingUID(const OFString& value,
                                      const OFBool checkValue = OFTrue);
 
-  // The utility class must access the protected default constructor
+  /// The utility class must access the protected default constructor
   friend class DcmIODUtil;
 
 protected:
@@ -295,6 +295,15 @@ protected:
 
 private:
 
+  /** Private undefined copy constructor
+   */
+  DcmSegment(const DcmSegment&);
+
+  /** Private undefined assignment operator
+   *  @return Reference to "this" class
+   */
+  DcmSegment& operator=(const DcmSegment&);
+
   /// The segmentation document where this segment is located in
   DcmSegmentation* m_SegmentationDoc;
 
index cf1645e9c2b10b79eae44c0f43f497b5282c624c..283beb4d8659c1f0929baefc1607cd4865faa00e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -41,6 +41,12 @@ extern DCMTK_DCMSEG_EXPORT OFLogger DCM_dcmsegLogger;
 #define DCMSEG_ERROR(msg) OFLOG_ERROR(DCM_dcmsegLogger, msg)
 #define DCMSEG_FATAL(msg) OFLOG_FATAL(DCM_dcmsegLogger, msg)
 
+// include this file in doxygen documentation
+
+/** @file segtypes.h
+ *  @brief type definitions, constants and helper classes for the dcmseg module
+ */
+
 /*-----------------------*
  *  constant definitions  *
  *-----------------------*/
@@ -162,7 +168,7 @@ class DCMTK_DCMSEG_EXPORT SegmentedPropertyTypeCodeItem
 
 public:
 
-  // Easy access to containing class
+  /// Easy access to containing class
   friend class SegmentDescriptionMacro;
 
   /** Constructor
index 74bf3d76f76dcc6f47bdc15decb5586f1e94cca2..91d4cde1d4eec08f1990b962b3e9dd5f8c4a5853 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -40,7 +40,7 @@ public:
    *   @param  columns The number of columns in the pixel data
    *   @return The frame data if successful, NULL if an error occurs
    */
-  static DcmIODTypes::Frame* packBinaryFrame(Uint8* pixelData,
+  static DcmIODTypes::Frame* packBinaryFrame(const Uint8* pixelData,
                                              const Uint16 rows,
                                              const Uint16 columns);
 
@@ -64,25 +64,55 @@ public:
                                                Uint16 rows,
                                                Uint16 cols);
 
-  /** Shifts the given memory block some defined number of bits to the right
-   *  Bits that fall off the last byte are lost (i.e. no "cycled" shift).
+  /** Aligns 1 bit per pixel frame data to make the frame start at a
+   *  specific bit position within the first byte. This is used in the context
+   *  that dcmseg holds the frames in memory aligned to exact byte positions,
+   *  while the DICOM encoding might require a frame to start at an arbitrary
+   *  bit position since all (1 bit per pixel) frames are directly concatenated
+   *  one after another (i.e. if one frame does not occupy a number of bits
+   *  dividable by 8, not all frames will be aligned at exact byte positions).
+   *  Note that each byte is filled from the right, i.e. the first pixel will
+   *  represented by the bit at the very right of the first byte, and the 9th
+   *  pixel will be in the very right position of the following byte.
+   *  This is not a regular bit shift operation since the bits from the previous
+   *  frame are on the left of the byte, but must be aligned at the right. The
+   *  current frame starts from the first bit, occupying the unused bits of
+   *  the last frame and then continuing in the next byte at the first bit
+   *  from the left.
+   *  Example for two bit shift:
+   *    Input buffer bytes: hgfedcba 87654321
+   *    Result:   fedcba00 654321hg
+   *    The 00 in the first byte must be handled by the caller (will
+   *    contain the two bits of the previous frame).
+   *    See also dcmseg/tests/tutils.cc for more examples.
    *  @param  buf The address of the memory buffer to shift
    *  @param  bufLen The length of the buf memory block in bytes
    *  @param  numBits The number of bits to shift. Must be 0 <= numBits <= 7.
    */
-  static void shiftRight(Uint8* buf,
-                         size_t bufLen,
-                         Uint8 numBits);
+  static void alignFrameOnBitPosition(Uint8* buf,
+                                      size_t bufLen,
+                                      Uint8 numBits);
 
-  /** Shifts the given memory block some defined number of bits to the left.
-   *  Bits that fall off the first byte are lost (i.e. no "cycled" shift).
+  /** Aligns 1 bit per pixel frame data starting at a given bit position in the
+   *  provided buffer with the start of that buffer. This is used to create
+   *  a frame structure where all the bytes (including the first one) only
+   *  contain data from the frame at hand.
+   *  Note that each byte is filled from the right, i.e. the first pixel will
+   *  represented by the bit at the very right of the first byte, and the 9th
+   *  pixel will be in the very right position of the following byte.
+   *  Example:
+   *    3 bytes input buffer: edcbaZYX mlkjihgf utsrqpon
+   *    Result after aligning 3 bits: fghedcba ponmlkji 000utsrq
+   *    The 000 are unused bits and therefore zeroed out in the last byte. Bits
+   *    ZYX will be shifted out which is ok since it does not belong to the
+   *    current frame. See also dcmseg/tests/tutils.cc for more examples.
    *  @param  buf The address of the memory buffer to shift
    *  @param  bufLen The length of the buf memory block in bytes
    *  @param  numBits The number of bits to shift. Must be 0 <= numBits <= 7.
    */
-  static void shiftLeft(Uint8* buf,
-                        size_t bufLen,
-                        Uint8 numBits);
+  static void alignFrameOnByteBoundary(Uint8* buf,
+                                       size_t bufLen,
+                                       Uint8 numBits);
 
   /** Dumps a byte as binary number to a string. Only useful for
    *  debugging purposes.
index 37463be22bf6cd4a29acd04b6cf87a15545cd7d5..0e3d9e230c4d9e176405bacc509271efad235e27 100644 (file)
@@ -53,6 +53,7 @@ segdoc.o: segdoc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -60,6 +61,7 @@ segdoc.o: segdoc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmiod/include/dcmtk/dcmiod/ioddef.h \
  ../../dcmiod/include/dcmtk/dcmiod/cielabutil.h \
  ../../dcmiod/include/dcmtk/dcmiod/modpatient.h \
@@ -208,6 +210,7 @@ segment.o: segment.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -215,6 +218,7 @@ segment.o: segment.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -368,6 +372,7 @@ segtypes.o: segtypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -375,6 +380,7 @@ segtypes.o: segtypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -483,6 +489,7 @@ segutils.o: segutils.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -492,6 +499,7 @@ segutils.o: segutils.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmiod/include/dcmtk/dcmiod/iodmacro.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
index 064142a456a5f36714d639035121a1fd2e6fc14f..b639d353c3609405c4192a71cf9f1a6283588f1b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -679,6 +679,34 @@ OFCondition DcmSegmentation::getModality(OFString& value,
 }
 
 
+OFCondition DcmSegmentation::importFromSourceImage(const OFString& filename,
+                                                   const bool takeOverCharset)
+{
+  DcmFileFormat dcmff;
+  OFCondition result = dcmff.loadFile(filename);
+  if (result.good())
+  {
+    return importFromSourceImage(*(dcmff.getDataset()), takeOverCharset);
+  }
+  return result;
+}
+
+
+OFCondition DcmSegmentation::importFromSourceImage(DcmItem& dataset,
+                                                   const bool takeOverCharset)
+{
+  OFString FoR;
+  dataset.findAndGetOFStringArray(DCM_FrameOfReferenceUID, FoR);
+  return DcmIODCommon::importHierarchy(
+    dataset,
+    OFTrue,       // Patient
+    OFTrue,       // Study
+    !FoR.empty(), // Frame of Reference
+    OFFalse,      // Series
+    takeOverCharset);
+}
+
+
 /* protected functions */
 
 OFCondition DcmSegmentation::writeSegments(DcmItem& item)
@@ -725,18 +753,28 @@ OFCondition DcmSegmentation::readFrames(DcmItem& dataset)
   }
 
   /* Read all frames into dedicated data structure */
-  size_t pixelsPerFrame = rows * cols;
+  size_t pixelsPerFrame = OFstatic_cast(size_t, rows) * cols;
   if (m_SegmentationType == DcmSegTypes::ST_BINARY)
   {
-      extractFrames(pixels, numberOfFrames, pixelsPerFrame, m_Frames);
+      result = extractFrames(pixels, numberOfFrames, pixelsPerFrame, m_Frames);
+      if (result.bad())
+      {
+        return result;
+    }
   }
   else if (m_SegmentationType == DcmSegTypes::ST_FRACTIONAL)
   {
     for (size_t count = 0; count < numberOfFrames; count++)
     {
       DcmIODTypes::Frame *frame = new DcmIODTypes::Frame();
+      if (!frame) return EC_MemoryExhausted;
       frame->length = pixelsPerFrame;
       frame->pixData= new Uint8[pixelsPerFrame];
+      if (!frame->pixData)
+      {
+          delete frame;
+          return EC_MemoryExhausted;
+      }
       memcpy(frame->pixData, pixels + count* pixelsPerFrame, pixelsPerFrame);
       m_Frames.push_back(frame);
     }
@@ -859,7 +897,7 @@ OFCondition DcmSegmentation::writeDataset(DcmItem& dataset)
 
 OFCondition DcmSegmentation::writeMultiFrameFunctionalGroupsModule(DcmItem& dataset)
 {
-  Uint16 numFrames = DcmIODUtil::limitMaxFrames(m_Frames.size(), "More than 65535 frames provided, limiting Number of Frames to 65535");
+  Uint32 numFrames = DcmIODUtil::limitMaxFrames(m_Frames.size(), "More than 2147483647 frames provided, limiting Number of Frames to 2147483647");
   m_FG.setNumberOfFrames(numFrames);
   OFCondition result = m_FG.write(dataset);
   if (result.good())
@@ -881,13 +919,20 @@ OFCondition DcmSegmentation::writeMultiFrameDimensionModule(DcmItem& dataset)
 
 OFCondition DcmSegmentation::writeFractionalFrames(DcmItem& dataset)
 {
-  Uint16 numFrames = DcmIODUtil::limitMaxFrames(m_Frames.size(), "More than 65535 fractional frames provided, will only write 65535");
+  Uint32 numFrames = DcmIODUtil::limitMaxFrames(m_Frames.size(), "More than 2147483647 frames provided, will only write 2147483647");
   OFCondition result;
   Uint16 rows,cols;
   rows = cols = 0;
   getImagePixel().getRows(rows);
   getImagePixel().getColumns(cols);
-  size_t numBytes = getTotalBytesRequired(rows, cols, numFrames);
+  size_t numBytes = 0;
+  result = getTotalBytesRequired(rows, cols, numFrames, numBytes);
+  if (result.bad()) return result;
+  if (numBytes >= 4294967295UL)
+  {
+    DCMSEG_ERROR("Cannot store Segmentation objects with more than 4 GB pixel data (compression for writing not supported)");
+    return EC_TooManyBytesRequested;
+  }
   Uint8* pixdata = new Uint8[numBytes];
   OFVector<DcmIODTypes::Frame*>::iterator it = m_Frames.begin();
   // Just copy bytes for each frame as is
@@ -904,13 +949,21 @@ OFCondition DcmSegmentation::writeFractionalFrames(DcmItem& dataset)
 
 OFCondition DcmSegmentation::writeBinaryFrames(DcmItem& dataset)
 {
-  Uint16 numFrames, rows, cols;
+  Uint16 rows, cols;
   rows = cols = 0;
-  numFrames = DcmIODUtil::limitMaxFrames(m_Frames.size(), "More than 65535 binary frames provided, will only write 65535");
+  Uint32 numFrames = 0;
+  numFrames = DcmIODUtil::limitMaxFrames(m_Frames.size(), "More than 2147483647 frames provided, will only write 2147483647");
   OFCondition result;
   getImagePixel().getRows(rows);
   getImagePixel().getColumns(cols);
-  size_t numBytes = getTotalBytesRequired(rows, cols, numFrames);
+  size_t numBytes = 0;
+  result = getTotalBytesRequired(rows, cols, numFrames, numBytes);
+  if (result.bad()) return result;
+  if (numBytes >= 4294967295UL)
+  {
+    DCMSEG_ERROR("Cannot store Segmentation objects with more than 4 GB pixel data (compression for writing not supported)");
+    return EC_TooManyBytesRequested;
+  }
   // Holds the pixels for all frames. Each bit represents a pixel which is either
   // 1 (part of segment) or 0 (not part of segment. All frames are directly
   // concatenated, i.e. there are no unused bits between the frames.
@@ -1040,7 +1093,9 @@ OFBool DcmSegmentation::checkPixDataLength(DcmElement* pixelData,
   size_t length = pixelData->getLengthField();
 
   // Find out how many bytes are needed
-  size_t bytesRequired = getTotalBytesRequired(rows, cols, numberOfFrames);
+  size_t bytesRequired = 0;
+  OFCondition result = getTotalBytesRequired(rows, cols, numberOfFrames, bytesRequired);
+  if (result.bad()) return OFFalse;
   // Length found in Pixel Data element is always even
   if (bytesRequired % 2 == 1) bytesRequired++;
   /* Compare expected and actual length */
@@ -1062,31 +1117,25 @@ OFBool DcmSegmentation::checkPixDataLength(DcmElement* pixelData,
 }
 
 
-size_t DcmSegmentation::getBitsPerFrame(const Uint16& rows,
-                                        const Uint16& cols)
+OFCondition DcmSegmentation::getTotalBytesRequired(const Uint16& rows,
+                                                   const Uint16& cols,
+                                                   const Uint32& numberOfFrames,
+                                                   size_t& bytesRequired)
 {
-  size_t bitsRequired = 0;
-  bitsRequired = rows * cols;
-  /* For fractional segmentations we need 1 byte instead of 1 bit for a single pixel */
-  if (m_SegmentationType == DcmSegTypes::ST_FRACTIONAL)
+  OFBool ok = OFStandard::safeMult(OFstatic_cast(size_t, rows), OFstatic_cast(size_t, cols), bytesRequired);
+  if (ok) OFStandard::safeMult(bytesRequired, OFstatic_cast(size_t, numberOfFrames), bytesRequired);
+  if (!ok)
   {
-    bitsRequired *= 8;
+    DCMSEG_ERROR("Cannot compute number of bytes required for Pixel Data since size_t type is too small");
+    return EC_TooManyBytesRequested;
   }
-  return bitsRequired;
-}
-
 
-size_t DcmSegmentation::getTotalBytesRequired(const Uint16& rows,
-                                              const Uint16& cols,
-                                              const Uint16& numberOfFrames)
-{
-  size_t bytesRequired = rows * cols * numberOfFrames;
   /* for binary, we only need one bit per pixel */
   size_t remainder = 0;
   if (m_SegmentationType == DcmSegTypes::ST_BINARY)
   {
     // check whether the 1-bit pixels exactly fit into bytes
-    remainder = (rows * cols) % 8;
+    remainder = (OFstatic_cast(size_t, rows) * cols) % 8;
     // number of bytes that work on an exact fit
     bytesRequired = bytesRequired / 8;
     // add one byte if we have a remainder
@@ -1094,9 +1143,8 @@ size_t DcmSegmentation::getTotalBytesRequired(const Uint16& rows,
     {
       bytesRequired++;
     }
-
   }
-  return bytesRequired;
+  return EC_Normal;
 }
 
 
@@ -1204,22 +1252,62 @@ OFBool DcmSegmentation::check()
     return OFFalse;
   }
 
-  // Check whether we have a Frame Content Macro for each frame
-  for (size_t count = 0; count < m_Frames.size(); count++)
+  // Check rules around Frame of Reference
+
+  // 1. If Derivation Image FG is not present, Frame of Reference is required.
+  OFBool frameOfRefRequired = OFFalse;
+  FGBase* group = m_FGInterface.get(OFstatic_cast(Uint32, 0), DcmFGTypes::EFG_DERIVATIONIMAGE);
+  if (group == NULL)
+  {
+    // Derivation Image FG is not present, FoR is required
+    frameOfRefRequired = OFTrue;
+  }
+  else
+  {
+    // Derivation Image FG present, Frame of Reference is not required
+    frameOfRefRequired = OFFalse;
+  }
+  OFString frameOfRef;
+  getFrameOfReference().getFrameOfReferenceUID(frameOfRef);
+  if (frameOfRefRequired && frameOfRef.empty())
   {
-    OFBool isPerFrame;
-    FGBase* group = m_FGInterface.get(OFstatic_cast(Uint32, count), DcmFGTypes::EFG_FRAMECONTENT, isPerFrame);
-    if (group == NULL)
+    DCMSEG_ERROR("Frame of Reference UID is not set for Segmentation but is required");
+    return OFFalse;
+  }
+
+  // 2. When a Frame of Reference UID is present the segment shall be specified
+  // within that coordinate system, using the Pixel Measures, Plane Position
+  // (Patient) and Plane Orientation (Patient) Functional Groups.
+  if (!frameOfRef.empty())
+  {
+    // Check that each of above FGs is present. We do not check this for
+    // all frames since if it exists for one frame it must exist for all others.
+    // This is a general rule and applies for all FGs, so it is not checked here.
+    FGBase* group = m_FGInterface.get(OFstatic_cast(Uint32, 0), DcmFGTypes::EFG_PIXELMEASURES);
+    if (!group)
+    {
+      DCMSEG_ERROR("Frame of Reference UID is present but Pixel Measures FG is missing");
+      return OFFalse;
+    }
+    group = m_FGInterface.get(OFstatic_cast(Uint32, 0), DcmFGTypes::EFG_PLANEPOSPATIENT);
+    if (!group)
     {
-      DCMSEG_ERROR("Frame Content Functional Group not present for frame " << count);
+      DCMSEG_ERROR("Frame of Reference UID is present but Plane Position (Patient) FG is missing");
       return OFFalse;
     }
-    else if (!isPerFrame)
+    group = m_FGInterface.get(OFstatic_cast(Uint32, 0), DcmFGTypes::EFG_PLANEORIENTPATIENT);
+    if (!group)
     {
-      DCMSEG_ERROR("Frame Content Functional Group must be per-frame but is shared");
+      DCMSEG_ERROR("Frame of Reference UID is present but Plane Orientation (Patient) FG is missing");
       return OFFalse;
     }
   }
+  // Another condition cannot be checked since we do not have access to the
+  // datasets of the source images:
+  // 3. If FoR is present but not the same in images this segmentation applies to,
+  // (those in Derivation Image FG), each pixel of the segmentation shall
+  // correspond to a pixel in a referenced image (i.e. they must share the same
+  // size and resolution).
 
   return OFTrue;
 }
@@ -1256,10 +1344,10 @@ OFCondition DcmSegmentation::decompress(DcmDataset& dset)
 }
 
 
-void DcmSegmentation::extractFrames(Uint8* pixData,
-                                   const size_t numFrames,
-                                   const size_t bitsPerFrame,
-                                   OFVector< DcmIODTypes::Frame* >& results)
+OFCondition DcmSegmentation::extractFrames(Uint8* pixData,
+                                           const size_t numFrames,
+                                           const size_t bitsPerFrame,
+                                           OFVector< DcmIODTypes::Frame* >& results)
 {
   // Will hold the bit position (0-7) that the current frame starts from. The
   // first frame will always start at bit 0.
@@ -1281,23 +1369,28 @@ void DcmSegmentation::extractFrames(Uint8* pixData,
     DcmIODTypes::Frame* frame = new DcmIODTypes::Frame();
     frame->length = frameLengthBytes;
     frame->pixData = new Uint8[frameLengthBytes];
+    if (!frame->pixData)
+    {
+        return EC_MemoryExhausted;
+    }
     memcpy(frame->pixData, readPos, frame->length);
     // If we have been copying too much, i.e the first bits of the frame
     // actually belong to the former frame, shift the whole frame this amount
-    // of bits to the left in order to shift the superfluous bits out
+    // of bits to the left in order to shift the superfluous bits out, i.e.
+    // make frame start at byte boundary.
     if (bitShift > 0)
     {
-      DcmSegUtils::shiftLeft(frame->pixData, frame->length, 8-bitShift);
+      DcmSegUtils::alignFrameOnByteBoundary(frame->pixData, frame->length, 8-bitShift);
     }
     // Adapt last byte by masking out unused bits (i.e. those belonging to next frame).
     // A reader should ignore those unused bits anyway.
-    frame->pixData[frame->length-1] = (frame->pixData[frame->length-1] >> (overlapBits)) << (overlapBits);
+    frame->pixData[frame->length-1] = (frame->pixData[frame->length-1] << (overlapBits)) >> (overlapBits);
     // Store frame
     results.push_back(frame);
     // Compute the bitshift created by this frame
     bitShift = ( 8- ((f+1) * bitsPerFrame) % 8 ) % 8;
-    // If the last byte read has not been used completely, i.e. it contains
-    // also bytes of the next frame, rewind read position to the last byte
+    // If the previous byte read has not been used completely, i.e. it contains
+    // also bytes of the next frame, rewind read position to the previous byte
     // that was partially read. Otherwise skip to the next full byte.
     if (bitShift > 0)
     {
@@ -1308,6 +1401,7 @@ void DcmSegmentation::extractFrames(Uint8* pixData,
       readPos = readPos + frame->length;
     }
   }
+  return EC_Normal;
 }
 
 
@@ -1325,20 +1419,22 @@ void DcmSegmentation::concatFrames(OFVector< DcmIODTypes::Frame* > frames,
   {
     DCMSEG_DEBUG("Packing segmentation frame #" << f+1 << "/" << frames.size());
     // Backup first byte of the destination since it may contain bits of the
-    // last frame; mask out those bits not belonging to last frame.
-    firstByte = (writePos[0] >> freeBits) << freeBits;
+    // previous frame; mask out those bits not belonging to previous frame.
+    // This will potentially create some empty bits on the left of the byte,
+    // that the current frame can use to store the its own first bits.
+    firstByte = (writePos[0] << freeBits) >> freeBits;
     memcpy(writePos, (*frame)->pixData, (*frame)->length);
-    // If the last frame left over some unused bits, shift the current frame
-    // that number of bits to the right and restore the original bits of the
-    // last frame
+    // If the previous frame left over some unused bits, shift the current frame
+    // that number of bits to the left, and restore the original bits of the
+    // previous frame that are overwritten by the shifting operation.
     if (freeBits > 0)
     {
-      DcmSegUtils::shiftRight(writePos, (*frame)->length, 8-freeBits);
+      DcmSegUtils::alignFrameOnBitPosition(writePos, (*frame)->length, 8-freeBits);
       writePos[0] |= firstByte;
     }
-    // Compute free bits left over from this frame in the last byte written
+    // Compute free bits left over from this frame in the previous byte written
     freeBits = (8 - (( (f+1) * bitsPerFrame ) % 8)) % 8;
-    // If we have free bits, the last byte written to will be the first byte
+    // If we have free bits, the previous byte written to will be the first byte
     // we write to for the next frame. Otherwise start with a fresh destination
     // byte.
     if (freeBits > 0)
index be9e91c4d9752a4dbe1b10a4da1f3137f52e6e23..b2b647c480ecbac7802e810b4c16809f2e9cc377 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, Open Connections GmbH
+ *  Copyright (C) 2015-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
 #include "dcmtk/dcmseg/segdef.h"
 
 
-DcmIODTypes::Frame* DcmSegUtils::packBinaryFrame(Uint8* pixelData,
+DcmIODTypes::Frame* DcmSegUtils::packBinaryFrame(const Uint8* pixelData,
                                                  const Uint16 rows,
                                                  const Uint16 columns)
 {
   // Sanity checking
-  const size_t numPixels = rows*columns;
+  const size_t numPixels = OFstatic_cast(size_t, rows) * columns;
   if (numPixels == 0)
   {
     DCMSEG_ERROR("Unable to pack binary segmentation frame: Rows or Columns is 0");
@@ -78,11 +78,16 @@ DcmIODTypes::Frame* DcmSegUtils::unpackBinaryFrame(const DcmIODTypes::Frame* fra
   }
 
   // Create result frame in memory
-  size_t numBits = rows * cols;
+  size_t numBits = OFstatic_cast(size_t, rows) * cols;
   DcmIODTypes::Frame* result = new DcmIODTypes::Frame();
   if (result)
   {
     result->pixData = new Uint8[numBits];
+    if (!result->pixData)
+    {
+        delete result;
+        return NULL;
+    }
     result->length = numBits;
   }
   if ( !result || !(result->pixData) )
@@ -125,49 +130,53 @@ size_t DcmSegUtils::getBytesForBinaryFrame(const size_t& numPixels)
 }
 
 
-void DcmSegUtils::shiftRight(Uint8* buf,
-                             size_t bufLen,
-                             Uint8 numBits)
+void DcmSegUtils::alignFrameOnBitPosition(Uint8* buf,
+                                          size_t bufLen,
+                                          Uint8 numBits)
 {
   if (numBits > 7)
   {
-    DCMSEG_ERROR("Invalid input data: shiftRight() can only shift 0-7 bits");
+    DCMSEG_ERROR("Invalid input data: shiftFrameBitsLeft() can only shift 0-7 bits");
     return;
   }
   Uint8 carryOver = 0;
   for (size_t x = 0; x < bufLen; x++)
   {
-    // Store current byte since we need its last bits
+    // Store current byte since we need to restore its first bits later
     Uint8 current = buf[x];
-    buf[x] >>= numBits;
-    // If there is a carry over from the last handled byte, add it
+    // Shift pixels given num bits to the left, creating (8 - num bits)
+    // empty bits at the right
+    buf[x] <<= numBits;
+    // If there is a carry over from the previous byte, add it in again (will always be at the end,
+    // see carry over calculation in next step)
     buf[x] |= carryOver;
-    // Compute carry over bits for next byte handled
-    carryOver = current << (8-numBits); // bits we need to shift over to start (left hand side) of buf[x+1]
+    // Compute carry over bits for next byte to be handled, i.e. those bits at the left that will be
+    // overwritten in the next byte
+    carryOver = current >> (8-numBits);
   }
 }
 
 
-void DcmSegUtils::shiftLeft(Uint8* buf,
-                            size_t bufLen,
-                            Uint8 numBits)
+void DcmSegUtils::alignFrameOnByteBoundary(Uint8* buf,
+                                           size_t bufLen,
+                                           Uint8 numBits)
 {
   if (numBits > 7)
   {
-    DCMSEG_ERROR("Invalid input data: shiftLeft() can only shift 0-7 bits");
+    DCMSEG_ERROR("Invalid input data: alignFrameOnByteBoundary() can only shift 0-7 bits");
     return;
   }
   for (size_t x = 0; x < bufLen-1; x++)
   {
     // Shift current byte
-    buf[x] = buf[x] << numBits;
+    buf[x] = buf[x] >> numBits;
     // isolate portion of next byte that must be shifted into current byte
-    Uint8 next = (buf[x+1] >> (8-numBits));
-    // Shift current byte
+    Uint8 next = (buf[x+1] << (8-numBits));
+    // Take over portion from next byte
     buf[x] |= next;
   }
   // Shift last byte manually
-  buf[bufLen-1] <<= numBits;
+  buf[bufLen-1] >>= numBits;
 }
 
 
@@ -177,7 +186,8 @@ void DcmSegUtils::debugDumpBin(Uint8* buffer,
 {
   for (size_t n=0; n<length; n++)
   {
-    DCMSEG_DEBUG(what << " #" << n << ": " << (size_t)(buffer[n]) << ", bytepos " << (size_t)(&(buffer[n])) << " (" << debugByte2Bin((buffer[n])) << ")");
+    DCMSEG_DEBUG(what << " #" << n << ": " << OFstatic_cast(size_t,(buffer[n]))
+      << ", bytepos " << &(buffer[n]) << " (" << debugByte2Bin((buffer[n])) << ")");
   }
   DCMSEG_DEBUG("");
 }
index 8e0584d73bf38168a997c1c770ba0bbb8e7ba07e..3e90ed13ad110118acf7dec85acf753f7e839c65 100644 (file)
@@ -8,17 +8,19 @@ tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -55,17 +57,19 @@ tutils.o: tutils.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
index 59b8b499148ed93f8e3832328481ba7c82d93ceb..4eaf1f8636478e65915b7938cca0c3ce3b03b747 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015, OFFIS e.V.
+ *  Copyright (C) 2015-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 #include "dcmtk/ofstd/oftest.h"
 #include "dcmtk/dcmseg/segutils.h"
 
+
+#define bufLen 4
+
+static void resetBuf(Uint8* buf, const size_t length)
+{
+  if (length != bufLen) return;
+  buf[0] = 170; // 10101010
+  buf[1] = 204; // 11001100
+  buf[2] = 240; // 11110000
+  buf[3] = 15;  // 00001111
+}
+
 OFTEST(dcmseg_utils)
 {
-  // buf = 10101010 11001100 11110000 00001111
-  Uint8 buf[4];
-  buf[0] = 0xAA; // 10101010
-  buf[1] = 0xCC; // 11001100
-  buf[2] = 0xF0; // 11110000
-  buf[3] = 0x0F; // 00001111
+  // buf, always initialized/reset with: 10101010 11001100 11110000 00001111
+  Uint8 buf[bufLen];
 
-  // Shift and check, should be 00101010 10110011 00111000 00000011
-  DcmSegUtils::shiftRight(buf, 4, 2);
-  OFCHECK(buf[0] == 0x2A); // 00101010 = 42 = 0x2A
-  OFCHECK(buf[1] == 0xB3); // 10110011 = 179 = 0xB3
-  OFCHECK(buf[2] == 0x3C); // 00111100 = 60 = 0x3C
-  OFCHECK(buf[3] == 0x03); // 00000011 = 0 = 0x03
+  resetBuf(buf, bufLen);
+  DcmSegUtils::alignFrameOnBitPosition(buf, 4, 2);
+  OFCHECK(buf[0] == 168); // 10101000
+  OFCHECK(buf[1] == 50);  // 00110010
+  OFCHECK(buf[2] == 195); // 11000011
+  OFCHECK(buf[3] == 63);  // 00111111
 
-  // Shift and check, should be 10101010 11001100 11110000 00001100
-  DcmSegUtils::shiftLeft(buf, 4, 2);
-  OFCHECK(buf[0] == 0xAA); // 10101010
-  OFCHECK(buf[1] == 0xCC); // 11001100
-  OFCHECK(buf[2] == 0xF0); // 11110000
-  OFCHECK(buf[3] == 0x0C); // 00001100
+  resetBuf(buf, bufLen);
+  DcmSegUtils::alignFrameOnByteBoundary(buf, 4, 2);
+  OFCHECK(buf[0] == 42);  // 00101010
+  OFCHECK(buf[1] == 51);  // 00110011
+  OFCHECK(buf[2] == 252); // 11111100
+  OFCHECK(buf[3] == 3);   // 00000011
 
-  // Shift and check, should be 00000001 01010101 10011001 11100000
-  DcmSegUtils::shiftRight(buf, 4, 7);
-  OFCHECK(buf[0] == 0x01); // 00000001
-  OFCHECK(buf[1] == 0x55); // 01010101
-  OFCHECK(buf[2] == 0x99); // 10011001
-  OFCHECK(buf[3] == 0xE0); // 11100000
+  resetBuf(buf, bufLen);
+  DcmSegUtils::alignFrameOnBitPosition(buf, 4, 7);
+  OFCHECK(buf[0] == 0);
+  OFCHECK(buf[1] == 85);  // 01010101
+  OFCHECK(buf[2] == 102); // 01100110
+  OFCHECK(buf[3] == 248); // 11111000
 
-  // Shift and check, should be 10101010 11001100 11110000 00000000
-  DcmSegUtils::shiftLeft(buf, 4, 7);
-  OFCHECK(buf[0] == 0xAA); // 10101010
-  OFCHECK(buf[1] == 0xCC); // 11001100
-  OFCHECK(buf[2] == 0xF0); // 11110000
-  OFCHECK(buf[3] == 0x00); // 00000000
+  resetBuf(buf, bufLen);
+  DcmSegUtils::alignFrameOnByteBoundary(buf, 4, 7);
+  OFCHECK(buf[0] == 153); // 10011001
+  OFCHECK(buf[1] == 225); // 11100001
+  OFCHECK(buf[2] == 31);  // 00011111
+  OFCHECK(buf[3] == 0);
 
 }
index 9bda43f1584a31ae9ac15b0472bd67d5a547d013..68205cbc29e8750324302f81b23e738a37902b7b 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmsign)
+project(dcmsign)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmsign_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${OPENSSL_INCDIR})
+include_directories("${dcmsign_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${OPENSSL_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc apps include)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc apps include)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 89a8414fb6a08c12b9b5280ab3858a7b647b1ad4..6a0a0815a727ded70dd603864920f2d5056b17cf 100644 (file)
@@ -35,6 +35,7 @@ dcmsign.o: dcmsign.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -44,6 +45,7 @@ dcmsign.o: dcmsign.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmsign/dcsignat.h ../include/dcmtk/dcmsign/sitypes.h \
  ../include/dcmtk/dcmsign/sidefine.h \
index 4694d4f0cf98c7aad3a023db7278b16ae1a2eb4c..2097ce8d6db8eec6f919d62912a355e34d81ff8f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -100,7 +100,7 @@ static OFBool addTag(const char *c, DcmAttributeTag& tagList)
     {
       if (EC_Normal == tagList.putTagVal(dicent->getKey(), tagList.getVM())) result = OFTrue;
     }
-    dcmDataDict.unlock();
+    dcmDataDict.rdunlock();
   } else {
     if (EC_Normal == tagList.putTagVal(DcmTagKey(group,elem), tagList.getVM())) result = OFTrue;
   }
@@ -158,11 +158,11 @@ static int readNextToken(const char *c, int& pos, DcmTagKey& key, Uint32& idx)
   if (dicent)
   {
     key = dicent->getKey();
-    dcmDataDict.unlock();
+    dcmDataDict.rdunlock();
     pos = lpos;
     return 1; // tag key;
   }
-  dcmDataDict.unlock();
+  dcmDataDict.rdunlock();
   OFLOG_ERROR(dcmsignLogger, "attribute name '" << aString.c_str() << "' unknown.");
   return 0; // parse error
 }
@@ -1141,8 +1141,7 @@ int main(int argc, char *argv[])
 
     if (opt_oxfer == EXS_Unknown) opt_oxfer = dataset->getOriginalXfer();
     DcmXfer opt_oxferSyn(opt_oxfer);
-    dataset->chooseRepresentation(opt_oxfer, NULL);
-    if (! dataset->canWriteXfer(opt_oxfer))
+    if (dataset->chooseRepresentation(opt_oxfer, NULL).bad() || (! dataset->canWriteXfer(opt_oxfer)))
     {
       OFLOG_FATAL(dcmsignLogger, "No conversion to transfer syntax " << opt_oxferSyn.getXferName() << " possible!");
       return 1;
index 5dd8b17239b7b5b5f8af3b0709459f96091da755..c31469545e46c0b2b2f0eae158f1fc50c998024b 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmsign DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmsign DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index da3b7a4e1b8fc68deb04ea13aae391e5a702a901..9da04117d689623e30049a56623547717666d1ea 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -49,6 +49,8 @@ class SiTimeStamp;
  *  embedded in sequence items within the dataset, other than providing 
  *  helper functions that allow to locate and attach the sub-items 
  *  separately.
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT DcmSignature
 {
index b626e53fcea2a5a8d7e87fa63fb18c5d239c25cc..2b3d39acdca7f1d4cda933e7229ad7950f02bec8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -35,6 +35,8 @@
  *  signature creation and verification.
  *  All public key algorithm classes should inherit from this class.
  *  Instances of derived classes contain a single private or public key.
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiAlgorithm
 {    
index 3e165c1342db3ecbe87023a761093e4f1d2c55fb..9f37e834214b5280ce25f0ab8adfa4dff01044ff 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -29,6 +29,8 @@
 #ifdef WITH_OPENSSL
 
 /** Authorization Digital Signature Profile
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiAuthorizationProfile: public SiBaseRSAProfile
 {
index b94591130f02a3911ce9b1fd7b678cd5ae90d6ec..423e9b339813defde0cb5450ecf970debceb69a5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -29,6 +29,8 @@
 #ifdef WITH_OPENSSL
 
 /** Base RSA Digital Signature Profile
+ *  @remark This class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiBaseRSAProfile: public SiSecurityProfile
 {
index 2a00db921a3cceb5d4cb3f2ed350ecebeaa52ff8..c587f30b4d6f36c7c2ecba79875ab3a6902254a5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -36,6 +36,8 @@ struct x509_st;
 typedef struct x509_st X509;
 
 /** a class representing X.509 public key certificates.
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiCertificate
 {    
index 7630dfc1b18226955cfef2be130d454c2af84eba..3473ae231405fbac6933f647cc5bb69836fccaf9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -33,6 +33,8 @@ struct x509_store_st;
 typedef struct x509_store_st X509_STORE;
 
 /** a class representing X.509 public key certificates.
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiCertificateVerifier
 {    
index f9aeb29829c6dd0606e55adb1f392dab9341015a..189b55852d80f28d2f71a0ab31d8094107aa62e0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -29,6 +29,8 @@
 #ifdef WITH_OPENSSL
 
 /** Creator RSA Digital Signature Profile
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiCreatorProfile: public SiBaseRSAProfile
 { 
index dd978dcd20737c803ce2cdff602cc5593dea379e..02759347dbdc139544e0386ec9c9844e27e58d3e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -36,7 +36,8 @@ typedef struct dsa_st DSA;
 
 /** 
  *  This class implements the DSA public key crypto algorithms.
- *  
+ *  @remark This class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 
 class DCMTK_DCMSIGN_EXPORT SiDSA : public SiAlgorithm
index e8cfb3df5fc4c1a1f6f506d3d5b135a38b3afd2c..4101404cf548072cae2826551b2ba8ad931744ca 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -30,6 +30,8 @@
 
 /**
  * a base class for all classes that implement hash functions.
+ * @remark this class is only available if DCMTK is compiled with
+ * OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiMAC
 {
index 2c60c7187e46ca604d5eb14df1ec0f5dca4effda..035e3e51b67bd6b6ccad9d83b9c88d6867a2570e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -41,6 +41,8 @@ class DcmElement;
 class DcmAttributeTag;
 
 /** a class that allows to feed selected parts of a DICOM dataset into the MAC generation code
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiMACConstructor
 {
index ea50d291f18d60407b7800d8db711cd2ebca7fe0..06048e5d2fd1c31b17869ffc9559dafb34ccd7f7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -34,6 +34,8 @@ typedef struct MD5state_st MD5_CTX;
 
 /**
  * a class implementing the hash function MD5
+ * @remark this class is only available if DCMTK is compiled with
+ * OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiMD5 : public SiMAC
 {
index 6d90fc9382093c3a13ffa8440012abf96ad48937..6a7114909e7e0e92cad8c9169b922a2be87ca722 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -31,6 +31,8 @@
 /** defines a "null" security profile that does not require or forbid any 
  *  MAC algorithm, signature algorithm, or attribute tag. This class can be
  *  used to clean up a proposed attribute list against a dataset.
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiNullProfile: public SiSecurityProfile
 {
index 1540e8a0e2632962e412780bcfc70339d6175720..ad96a449d02c40fe7d17063c1a0f164762f00624 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -37,6 +37,8 @@ typedef struct evp_pkey_st EVP_PKEY;
 
 
 /** a class representing a private key.
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiPrivateKey
 {     
index 343011744c81a2b35755d1fa318e52b7fe895c1d..2cfadba46368a23d2fd61a7888c9c9d4bbd9a20c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -34,6 +34,8 @@ typedef struct RIPEMD160state_st RIPEMD160_CTX;
 
 /**
  * a class implementing the hash function RIPEMD160
+ * @remark this class is only available if DCMTK is compiled with
+ * OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiRIPEMD160 : public SiMAC
 {
index 211ba79f0d0cdee30da1028312a9ef4efcf6f086..d71a5c096baca5b6137d8ddc7779ae3cd73f79d1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -36,7 +36,8 @@ typedef struct rsa_st RSA;
 
 /** 
  *  This class implements the RSA public key crypto algorithms.
- *  
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 
 class DCMTK_DCMSIGN_EXPORT SiRSA : public SiAlgorithm
index aa9a598ad3ef558f9b6b08e5b84dffe65c00e58f..98b78a3d8e652aefc7659ffcab586aa82db47552 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -34,6 +34,8 @@ typedef struct SHAstate_st SHA_CTX;
 
 /**
  * a class implementing the hash function SHA1
+ * @remark this class is only available if DCMTK is compiled with
+ * OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiSHA1 : public SiMAC
 {
index 56200099b877ecc1c633a4237ca3061e721412a3..a8915871051e8bac689331433d6a0c5d98eb8050 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, OFFIS e.V.
+ *  Copyright (C) 2016-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -34,6 +34,8 @@ typedef struct SHA256state_st SHA256_CTX;
 
 /**
  * a class implementing the hash function SHA256
+ * @remark this class is only available if DCMTK is compiled with
+ * OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiSHA256 : public SiMAC
 {
index c7dbdb7336eeb46b7e0c6119e3790a32116ddfa6..fef7f8c3b5367210892ee0fd649530ddd64af9b4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, OFFIS e.V.
+ *  Copyright (C) 2016-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -34,6 +34,8 @@ typedef struct SHA512state_st SHA512_CTX;
 
 /**
  * a class implementing the hash function SHA384
+ * @remark this class is only available if DCMTK is compiled with
+ * OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiSHA384 : public SiMAC
 {
index b5d0b1487f9e2dcf1f2a6c98be92f2dd4c5baf9d..19b05e8ee97794833b99b7c7a1799f4b0a3293d5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, OFFIS e.V.
+ *  Copyright (C) 2016-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -34,6 +34,8 @@ typedef struct SHA512state_st SHA512_CTX;
 
 /**
  * a class implementing the hash function SHA512
+ * @remark this class is only available if DCMTK is compiled with
+ * OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiSHA512 : public SiMAC
 {
index d1066a63801c563c2a368a4fb87ce5f0085b831b..e81aad050dc88ce3fcd1e7207ff592d38ad0b31a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -37,6 +37,8 @@ class SiMAC;
 class DcmTagKey;
 
 /** abstract base class for all security profiles.
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiSecurityProfile
 {
index 74aca591b99baf05106891b4fc8f073d121b85ad..de144dd4e059eea8a6da030b0bce38e018741062 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2011, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -33,6 +33,8 @@ class DcmItem;
 /** pure virtual base class for a timestamp client.
  *  Instances of derived classes are able to request timestamps from a timestamp service.
  *  Timestamps are not supported (yet).
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMSIGN_EXPORT SiTimeStamp
 {    
index 7e949c9af231fd833b5d4b3a73e07dc86f7ec473..bb99401d3b04e58b6324d21ac45b73fea8f7a03c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2016, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 
 #include "dcmtk/ofstd/oftypes.h"
 #include "dcmtk/ofstd/ofcond.h"
-
+#include "dcmtk/oflog/oflog.h"
 #include "dcmtk/dcmsign/sidefine.h"
 
+/*
+** Logging
+*/
+
+extern DCMTK_DCMSIGN_EXPORT OFLogger DCM_dcmsignLogger;
+
+#define DCMSIGN_TRACE(msg) OFLOG_TRACE(DCM_dcmsignLogger, msg)
+#define DCMSIGN_DEBUG(msg) OFLOG_DEBUG(DCM_dcmsignLogger, msg)
+#define DCMSIGN_INFO(msg)  OFLOG_INFO(DCM_dcmsignLogger, msg)
+#define DCMSIGN_WARN(msg)  OFLOG_WARN(DCM_dcmsignLogger, msg)
+#define DCMSIGN_ERROR(msg) OFLOG_ERROR(DCM_dcmsignLogger, msg)
+#define DCMSIGN_FATAL(msg) OFLOG_FATAL(DCM_dcmsignLogger, msg)
+
+
 // DICOM defined terms for MAC algorithms, certificate and timestamp types
 #define SI_DEFTERMS_RIPEMD160 "RIPEMD160"
 #define SI_DEFTERMS_SHA1      "SHA1"
 #define SI_DEFTERMS_SHA512    "SHA512"
 
 
+// include this file in doxygen documentation
+
+/** @file sitypes.h
+ *  @brief type definitions and constants for the dcmsign module
+ */
+
+
 /** type of key for public key cryptosystem
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 enum E_KeyType
 {
@@ -55,22 +78,24 @@ enum E_KeyType
 
   /// DH key
   EKT_DH,
-  
+
   /// no key present
   EKT_none
 };
 
 
 /** type of MAC algorithm
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 enum E_MACType
 {
   /// SHA-1
   EMT_SHA1,
-  
+
   /// RIPEMD160
   EMT_RIPEMD160,
-  
+
   /// MD5
   EMT_MD5,
 
@@ -87,52 +112,80 @@ enum E_MACType
 /*
  * specific error conditions for module dcmsign
  */
+
 /// object initialization failed
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_InitializationFailed;
 
 /// an OpenSSL call has failed
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_OpenSSLFailure;
 
 /// file cannot be read
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_CannotRead;
 
 /// unable to use the selected transfer syntax for MAC computation
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_WrongTransferSyntax;
 
 /// no more MAC ID numbers available
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_MacIDsExhausted;
 
 /// certificate and private key do not match
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_CertificateDoesNotMatchPrivateKey;
 
 /// MAC algorithm not allowed for the current security profile
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_MacDoesNotMatchProfile;
 
 /// Signature algorithm not allowed for the current security profile
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_AlgorithmDoesNotMatchProfile;
 
 /// Transfer syntax not allowed for the current security profile
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_TransferSyntaxDoesNotMatchProfile;
 
 /** signature verification failed because the certificate is missing
  *  or cannot be read (e.g. unsupported format)
+ *  @remark this constant is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_NoCertificate;
 
 /// signature verification failed because the corresponding MAC parameters item could not be found or is incomplete
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_NoMAC;
 
 /// signature verification failed because the corresponding signature item is incomplete
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_NoSignature;
 
 /// signature verification failed because the MAC algorithm is not supported
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_UnsupportedMACAlgorithm;
 
 /// signature verification failed because the signature is invalid (document corrupted)
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_Corrupted;
 
 /// signature verification failed because the certificate was issued by an untrusted (unknown) CA
+/// @remark this constant is only available if DCMTK is compiled with
+/// OpenSSL support enabled.
 extern DCMTK_DCMSIGN_EXPORT const OFConditionConst SI_EC_VerificationFailed_NoTrust;
 
 #endif
index 21c2ccf16db9aa933391567a58a3251c58d41add..ee5b53ece89290740e5f92471ff1b07c1bffff6c 100644 (file)
@@ -8,9 +8,6 @@ dcsignat.o: dcsignat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmsign/sidefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -38,6 +35,7 @@ dcsignat.o: dcsignat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -46,6 +44,10 @@ dcsignat.o: dcsignat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmsign/sidefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -91,9 +93,6 @@ siautopr.o: siautopr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmsign/sidefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -121,6 +120,7 @@ siautopr.o: siautopr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -129,6 +129,10 @@ siautopr.o: siautopr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmsign/sidefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -145,9 +149,6 @@ sibrsapr.o: sibrsapr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmsign/sidefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -175,6 +176,7 @@ sibrsapr.o: sibrsapr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -183,6 +185,10 @@ sibrsapr.o: sibrsapr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmsign/sidefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -198,19 +204,6 @@ sicert.o: sicert.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmsign/sidefine.h ../include/dcmtk/dcmsign/sirsa.h \
- ../include/dcmtk/dcmsign/sialgo.h ../include/dcmtk/dcmsign/sidsa.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h \
- ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oflist.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
- ../../ofstd/include/dcmtk/ofstd/oflimits.h \
- ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -224,6 +217,7 @@ sicert.o: sicert.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/appender.h \
  ../../ofstd/include/dcmtk/ofstd/ofmem.h \
  ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../../oflog/include/dcmtk/oflog/layout.h \
  ../../oflog/include/dcmtk/oflog/streams.h \
@@ -237,8 +231,22 @@ sicert.o: sicert.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmsign/sidefine.h ../include/dcmtk/dcmsign/sirsa.h \
+ ../include/dcmtk/dcmsign/sialgo.h ../include/dcmtk/dcmsign/sidsa.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -263,6 +271,43 @@ sicertvf.o: sicertvf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsign/sidefine.h ../include/dcmtk/dcmsign/sicertvf.h
 sicreapr.o: sicreapr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsign/sicreapr.h ../include/dcmtk/dcmsign/sibrsapr.h \
@@ -275,9 +320,6 @@ sicreapr.o: sicreapr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmsign/sidefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -305,6 +347,7 @@ sicreapr.o: sicreapr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -313,6 +356,10 @@ sicreapr.o: sicreapr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmsign/sidefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -329,6 +376,43 @@ sidsa.o: sidsa.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsign/sidefine.h ../include/dcmtk/dcmsign/sicert.h \
  ../include/dcmtk/dcmsign/siprivat.h
 simaccon.o: simaccon.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -341,11 +425,6 @@ simaccon.o: simaccon.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmsign/sidefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcostrmb.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -373,6 +452,7 @@ simaccon.o: simaccon.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -381,6 +461,12 @@ simaccon.o: simaccon.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmsign/sidefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcostrmb.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcostrma.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -410,6 +496,43 @@ simd5.o: simd5.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsign/sidefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h
@@ -424,9 +547,6 @@ sinullpr.o: sinullpr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmsign/sidefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -454,6 +574,7 @@ sinullpr.o: sinullpr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -462,6 +583,10 @@ sinullpr.o: sinullpr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmsign/sidefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h
@@ -475,6 +600,43 @@ siprivat.o: siprivat.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsign/sidefine.h ../include/dcmtk/dcmsign/sirsa.h \
  ../include/dcmtk/dcmsign/sialgo.h ../include/dcmtk/dcmsign/sidsa.h \
  ../include/dcmtk/dcmsign/sicert.h
@@ -489,6 +651,43 @@ siripemd.o: siripemd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsign/sidefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h
@@ -503,6 +702,43 @@ sirsa.o: sirsa.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsign/sidefine.h ../include/dcmtk/dcmsign/sicert.h \
  ../include/dcmtk/dcmsign/siprivat.h
 sisha1.o: sisha1.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -516,6 +752,43 @@ sisha1.o: sisha1.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsign/sidefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h
@@ -530,6 +803,43 @@ sisha256.o: sisha256.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsign/sidefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h
@@ -544,6 +854,43 @@ sisha384.o: sisha384.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsign/sidefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h
@@ -558,6 +905,43 @@ sisha512.o: sisha512.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsign/sidefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h
@@ -571,9 +955,6 @@ sisprof.o: sisprof.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/dcmsign/sidefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -601,6 +982,7 @@ sisprof.o: sisprof.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -609,6 +991,10 @@ sisprof.o: sisprof.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/dcmsign/sidefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
@@ -633,6 +1019,43 @@ sitypes.o: sitypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsign/sidefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h
index 5c0caf27b57842517747abe07bcdea61cea60d4a..19393cf86c29758c9a3b86093bc7175899a44b85 100644 (file)
@@ -76,8 +76,8 @@ Uint16 DcmSignature::getMACIDnumber(DcmItem &item)
   }
   return macIDnumber;
 }
-  
-  
+
+
 void DcmSignature::currentDateTime(OFString &str)
 {
   DcmDateTime::getCurrentDateTime(str, OFTrue /*seconds*/, OFTrue /*fraction*/, OFTrue /*timeZone*/);
@@ -120,7 +120,7 @@ void DcmSignature::setDumpFile(FILE *f)
 }
 
 
-void DcmSignature::attach(DcmItem *dataset)  
+void DcmSignature::attach(DcmItem *dataset)
 {
   deselect();
   currentItem = dataset;
@@ -140,7 +140,7 @@ void DcmSignature::attach(DcmItem *dataset)
     macParametersSq = NULL;
     signatureSq = NULL;
   }
-  return; 
+  return;
 }
 
 
@@ -167,7 +167,7 @@ OFCondition DcmSignature::removeSignature(unsigned long i)
   DcmItem *removalItem = signatureSq->getItem(i);
   if (removalItem == NULL) return EC_IllegalCall; // should never happen
 
-  // check mac ID number and whether it is unique  
+  // check mac ID number and whether it is unique
   Uint16 macIDnumber = getMACIDnumber(*removalItem);
   OFBool macIDunique = OFTrue;
   DcmItem *tmpItem=NULL;
@@ -191,8 +191,8 @@ OFCondition DcmSignature::removeSignature(unsigned long i)
       if (tmpItem && (macIDnumber == getMACIDnumber(*tmpItem))) delete macParametersSq->remove(j); else ++j;
     }
   }
-  
-  if (signatureSq->card() == 0) 
+
+  if (signatureSq->card() == 0)
   {
     delete currentItem->remove(signatureSq);
     signatureSq = NULL;
@@ -212,10 +212,10 @@ OFCondition DcmSignature::allocateMACID(Uint16& newID)
 {
   newID = 0xffff;
   if (currentItem == NULL) return EC_IllegalCall;
-  if ((signatureSq==NULL)&&(macParametersSq == NULL)) 
+  if ((signatureSq==NULL)&&(macParametersSq == NULL))
   {
     newID = 0; // no signature yet, can use 0.
-    return EC_Normal; 
+    return EC_Normal;
   }
 
   unsigned long i;
@@ -232,7 +232,7 @@ OFCondition DcmSignature::allocateMACID(Uint16& newID)
     for (i=0; i < sqCard; ++i)
     {
       tmpItem = signatureSq->getItem(i);
-      if (tmpItem) isAllocated[getMACIDnumber(*tmpItem)] = 1;      
+      if (tmpItem) isAllocated[getMACIDnumber(*tmpItem)] = 1;
     }
   }
   if (macParametersSq)
@@ -241,7 +241,7 @@ OFCondition DcmSignature::allocateMACID(Uint16& newID)
     for (i=0; i < macCard; ++i)
     {
       tmpItem = macParametersSq->getItem(i);
-      if (tmpItem) isAllocated[getMACIDnumber(*tmpItem)] = 1;      
+      if (tmpItem) isAllocated[getMACIDnumber(*tmpItem)] = 1;
     }
   }
   i = 0;
@@ -258,12 +258,12 @@ OFCondition DcmSignature::allocateMACID(Uint16& newID)
   return result;
 }
 
-  
+
 OFCondition DcmSignature::createSignature(
-    SiPrivateKey& key, 
-    SiCertificate& cert, 
+    SiPrivateKey& key,
+    SiCertificate& cert,
     SiMAC& mac,
-    SiSecurityProfile& profile, 
+    SiSecurityProfile& profile,
     E_TransferSyntax xfer,
     const DcmAttributeTag *tagList,
     SiTimeStamp *timeStamp)
@@ -279,7 +279,7 @@ OFCondition DcmSignature::createSignature(
 
   // update tag list if present
   DcmAttributeTag *updatedTagList = NULL;
-  if (tagList) 
+  if (tagList)
   {
     updatedTagList = new DcmAttributeTag(*tagList);
     if (updatedTagList == NULL) result = EC_MemoryExhausted;
@@ -288,9 +288,9 @@ OFCondition DcmSignature::createSignature(
 
   // make sure we have a MAC parameter sequence
   if ((result.good()) && (macParametersSq == NULL))
-  {      
+  {
     macParametersSq = new DcmSequenceOfItems(DCM_MACParametersSequence);
-    if (macParametersSq == NULL) result = EC_MemoryExhausted; 
+    if (macParametersSq == NULL) result = EC_MemoryExhausted;
     else
     {
       result = currentItem->insert(macParametersSq, OFTrue);
@@ -299,9 +299,9 @@ OFCondition DcmSignature::createSignature(
 
   // make sure we have a digital signature sequence
   if ((result.good()) && (signatureSq == NULL))
-  {      
+  {
     signatureSq = new DcmSequenceOfItems(DCM_DigitalSignaturesSequence);
-    if (signatureSq == NULL) result = EC_MemoryExhausted; 
+    if (signatureSq == NULL) result = EC_MemoryExhausted;
     else
     {
       result = currentItem->insert(signatureSq, OFTrue);
@@ -368,7 +368,7 @@ OFCondition DcmSignature::createSignature(
           }
         } else result = EC_MemoryExhausted;
       }
-      
+
       // Certificate of Signer and Certificate Type
       if (result.good())
       {
@@ -395,7 +395,7 @@ OFCondition DcmSignature::createSignature(
       mac.initialize();
       sigLength = algorithm->getSize();
       signature = new unsigned char[sigLength];
-      if (signature == NULL) result = EC_MemoryExhausted; 
+      if (signature == NULL) result = EC_MemoryExhausted;
       else
       {
         // encode main dataset
@@ -410,7 +410,7 @@ OFCondition DcmSignature::createSignature(
 
   // sign MAC
   if (result.good())
-  {      
+  {
     unsigned long digestLength = mac.getSize();
     unsigned char *digest = new unsigned char[digestLength];
     if (digest == NULL) result = EC_MemoryExhausted;
@@ -419,15 +419,15 @@ OFCondition DcmSignature::createSignature(
       result = mac.finalize(digest);
       if (result.good()) result = algorithm->sign(digest, digestLength, mac.macType(), signature, sigLength);
       delete[] digest;
-    } 
-  }      
+    }
+  }
 
   // complete and write digital signature sequence item
   if (result.good())
   {
     if (seqItem)
     {
-            
+
       // Signature
       if (result.good())
       {
@@ -443,7 +443,7 @@ OFCondition DcmSignature::createSignature(
           }
         } else result = EC_MemoryExhausted;
       }
-            
+
       // Timestamp and Timestamp Type
       if (result.good())
       {
@@ -541,7 +541,7 @@ OFCondition DcmSignature::createSignature(
       }
     } else result = EC_MemoryExhausted;
   }
-    
+
   delete[] signature;
   delete tagListOut;
   delete updatedTagList;
@@ -554,7 +554,7 @@ OFCondition DcmSignature::selectSignature(unsigned long i)
 {
   deselect();
   if ((signatureSq == NULL) || (i >= signatureSq->card())) return EC_IllegalCall;
+
   selectedSignatureItem = signatureSq->getItem(i);
   if (selectedSignatureItem == NULL) return EC_IllegalCall;
   Uint16 macID = getMACIDnumber(*selectedSignatureItem);
@@ -573,7 +573,7 @@ OFCondition DcmSignature::selectSignature(unsigned long i)
     }
   }
   selectedCertificate = new SiCertificate();
-  if (selectedCertificate == NULL) return EC_MemoryExhausted;  
+  if (selectedCertificate == NULL) return EC_MemoryExhausted;
   selectedCertificate->read(*selectedSignatureItem);
   return EC_Normal;
 }
@@ -590,7 +590,7 @@ OFCondition DcmSignature::verifyCurrent()
   E_TransferSyntax xfer = EXS_Unknown;
   DcmStack stack;
   DcmOtherByteOtherWord *signature = NULL;
-  
+
   // read MAC Calculation Transfer Syntax UID
   if (result.good())
   {
@@ -624,7 +624,7 @@ OFCondition DcmSignature::verifyCurrent()
         if (mac == NULL) result = SI_EC_VerificationFailed_UnsupportedMACAlgorithm;
       } else result = SI_EC_VerificationFailed_NoMAC;
     } else result = SI_EC_VerificationFailed_NoMAC;
-  }     
+  }
 
   // read Data Elements Signed
   if (result.good())
@@ -635,7 +635,7 @@ OFCondition DcmSignature::verifyCurrent()
       tagList = new DcmAttributeTag(*((DcmAttributeTag *)(stack.top())));
       if (tagList == NULL) result = EC_MemoryExhausted;
     }
-  }     
+  }
 
   // read Signature
   if (result.good())
@@ -646,7 +646,7 @@ OFCondition DcmSignature::verifyCurrent()
       signature = new DcmOtherByteOtherWord(*((DcmOtherByteOtherWord *)(stack.top())));
       if (signature == NULL) result = EC_MemoryExhausted;
     } else result = SI_EC_VerificationFailed_NoSignature;
-  }     
+  }
 
   // create MAC
   if (result.good())
@@ -667,7 +667,7 @@ OFCondition DcmSignature::verifyCurrent()
 
   // finally verify signature
   if (result.good())
-  {  
+  {
     SiAlgorithm *algorithm = selectedCertificate->createAlgorithmForPublicKey();
     if (algorithm)
     {
@@ -675,7 +675,7 @@ OFCondition DcmSignature::verifyCurrent()
       Uint32 sigLength = signature->getLength();
       Uint8 *sigData = NULL;
       if ((signature->getUint8Array(sigData)).bad() || (sigData == NULL)) result = SI_EC_VerificationFailed_NoSignature;
-      else 
+      else
       {
         unsigned long digestLength = mac->getSize();
         unsigned char *digest = new unsigned char[digestLength];
@@ -690,11 +690,11 @@ OFCondition DcmSignature::verifyCurrent()
           }
           delete[] digest;
         }
-      }    
+      }
       delete algorithm;
     } else result = SI_EC_VerificationFailed_NoCertificate;
   }
-  
+
   delete signature;
   delete tagList;
   delete mac;
@@ -732,7 +732,7 @@ OFCondition DcmSignature::getCurrentMacXferSyntaxName(OFString& str)
   if ((NULL == selectedSignatureItem)||(NULL == selectedMacParametersItem)) return EC_IllegalCall;
   OFCondition result = EC_Normal;
   DcmStack stack;
-  
+
   // read MAC Calculation Transfer Syntax UID
   if ((selectedMacParametersItem->search(DCM_MACCalculationTransferSyntaxUID, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->isLeaf()))
   {
@@ -740,7 +740,7 @@ OFCondition DcmSignature::getCurrentMacXferSyntaxName(OFString& str)
     if ((((DcmElement *)(stack.top()))->getString(uid)).good())
     {
       DcmXfer xf(uid);
-      if (xf.getXfer() == EXS_Unknown) str=uid; else 
+      if (xf.getXfer() == EXS_Unknown) str=uid; else
       {
         str = "=";
         str.append(xf.getXferName());
@@ -761,7 +761,7 @@ OFCondition DcmSignature::getCurrentMacName(OFString& str)
   if ((selectedMacParametersItem->search(DCM_MACAlgorithm, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->isLeaf()))
   {
     if ((((DcmElement *)(stack.top()))->getOFString(str, 0)).good()) result = EC_Normal;
-  }  
+  }
   return result;
 }
 
@@ -776,7 +776,7 @@ OFCondition DcmSignature::getCurrentSignatureUID(OFString& str)
   if ((selectedSignatureItem->search(DCM_DigitalSignatureUID, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->isLeaf()))
   {
     if ((((DcmElement *)(stack.top()))->getOFString(str, 0)).good()) result = EC_Normal;
-  }  
+  }
   return result;
 }
 
@@ -791,13 +791,13 @@ OFCondition DcmSignature::getCurrentSignatureDateTime(OFString& str)
   if ((selectedSignatureItem->search(DCM_DigitalSignatureDateTime, stack, ESM_fromHere, OFFalse)).good() && (stack.top()->isLeaf()))
   {
     if ((((DcmElement *)(stack.top()))->getOFString(str, 0)).good()) result = EC_Normal;
-  }  
+  }
   return result;
 }
 
 SiCertificate *DcmSignature::getCurrentCertificate()
 {
-  return selectedCertificate;  
+  return selectedCertificate;
 }
 
 OFCondition DcmSignature::getCurrentDataElementsSigned(DcmAttributeTag& desig)
@@ -812,7 +812,7 @@ OFCondition DcmSignature::getCurrentDataElementsSigned(DcmAttributeTag& desig)
   {
     desig = *((DcmAttributeTag *)(stack.top()));
     result = EC_Normal;
-  }  
+  }
   return result;
 }
 
index cc34cada1ead48350164985bd1b8b122e9fd0f2e..60104a1ff390a665520d65f8e1b2820e3e630d3d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2010, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -61,7 +61,16 @@ OFCondition SiMACConstructor::flushBuffer(SiMAC& mac)
   stream.flushBuffer(bufptr, bufLen);
   if (bufLen > 0)
   {
-    if (dumpFile) fwrite(bufptr, 1, (size_t)bufLen, dumpFile);
+    if (dumpFile)
+    {
+      if (fwrite(bufptr, 1, OFstatic_cast(size_t, bufLen), dumpFile) != OFstatic_cast(size_t, bufLen))
+      {
+        // We are apparently unable to write the byte stream to a dump file.
+        // This does not prevent us, however, from creating a valid digital signature.
+        // Therefore, issue a warning but continue.
+        DCMSIGN_WARN("Write error while dumping byte stream to file");
+      }
+    }
     result = mac.digest((unsigned char *)bufptr, (unsigned long)bufLen);
   }
   return result;
index 7a092a4292882a2670b308f1c9861a478ebc4b47..6e0127949692e90f56a471277345e624630d4578 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2016, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -54,7 +54,7 @@ int SiPrivateKey_passwordCallback(char *buf, int size, int /* rwflag */, void *u
 {
   if (userdata == NULL) return -1;
   OFString *password = (OFString *)userdata;
-  int passwordSize = password->length();
+  int passwordSize = OFstatic_cast(int, password->length());
   if (passwordSize > size) passwordSize = size;
   strncpy(buf, password->c_str(), passwordSize);
   return passwordSize;
index 797c619201bfe4b51298e559b16cfe5669302f68..67ca32dcad689930b5ff4ac452c2ec21fc084e49 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, OFFIS e.V.
+ *  Copyright (C) 2016-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -34,7 +34,7 @@ BEGIN_EXTERN_C
 #include <openssl/sha.h>
 END_EXTERN_C
 
+
 SiSHA384::SiSHA384()
 : ctx(new SHA512_CTX())
 {
@@ -48,7 +48,7 @@ SiSHA384::~SiSHA384()
 
 unsigned long SiSHA384::getSize() const
 {
-  return SHA_DIGEST_LENGTH;
+  return SHA384_DIGEST_LENGTH;
 }
 
 OFCondition SiSHA384::initialize()
@@ -69,7 +69,7 @@ OFCondition SiSHA384::finalize(unsigned char *result)
 {
   if ((result == NULL)||(ctx == NULL)) return EC_IllegalCall;
   SHA384_Final(result, ctx);
-  return EC_Normal;  
+  return EC_Normal;
 }
 
 E_MACType SiSHA384::macType() const
index 26d62db066adde17f784921b01cc33ce3c18ce64..96a89157d776b6e9ffaf1682ae86dfc8dc6d1611 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2016, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -43,6 +43,7 @@ makeOFConditionConst(SI_EC_VerificationFailed_UnsupportedMACAlgorithm, OFM_dcmsi
 makeOFConditionConst(SI_EC_VerificationFailed_Corrupted,               OFM_dcmsign, 14, OF_error, "signature verification failed: signature is invalid (document corrupted)");
 makeOFConditionConst(SI_EC_VerificationFailed_NoTrust,                 OFM_dcmsign, 16, OF_error, "signature verification failed: certificate issued by unknown CA");
 
+OFLogger DCM_dcmsignLogger = OFLog::getLogger("dcmtk.dcmsign");
 
 #else /* WITH_OPENSSL */
 
index d4080c63d1001b87e7d6b91d0c19a87b1e10abe3..96fb98be448aaad55348490244949ca2648dc1e8 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmsr)
+project(dcmsr)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmsr_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${LIBXML_INCDIR})
+include_directories("${dcmsr_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmimgle_SOURCE_DIR}/include" "${dcmimage_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${LIBXML_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc libcmr apps tests include data)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc libcmr apps tests include data)
+  add_subdirectory(${SUBDIR})
+endforeach()
index e3e0f03b5669a564db0e7be6535ce0f965f17251..c0224bfa5186b84650eb7db8a2a034516db2a522 100644 (file)
@@ -1,9 +1,9 @@
 # declare executables
-FOREACH(PROGRAM dsr2html dsr2xml dsrdump xml2dsr)
+foreach(PROGRAM dsr2html dsr2xml dsrdump xml2dsr)
   DCMTK_ADD_EXECUTABLE(${PROGRAM} ${PROGRAM})
-ENDFOREACH(PROGRAM)
+endforeach()
 
 # make sure executables are linked to the corresponding libraries
-FOREACH(PROGRAM dsr2html dsr2xml dsrdump xml2dsr)
+foreach(PROGRAM dsr2html dsr2xml dsrdump xml2dsr)
   DCMTK_TARGET_LINK_MODULES(${PROGRAM} dcmsr dcmimage dcmimgle dcmdata oflog ofstd)
-ENDFOREACH(PROGRAM)
+endforeach()
index 47657dcbd6c14661e36fa60a7bd18911786c92e1..0efeca0672bd88863cb8f356db7e3113dee7830e 100644 (file)
@@ -45,6 +45,7 @@ dsr2html.o: dsr2html.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -52,6 +53,7 @@ dsr2html.o: dsr2html.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -64,7 +66,6 @@ dsr2html.o: dsr2html.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -181,6 +182,7 @@ dsr2xml.o: dsr2xml.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -188,6 +190,7 @@ dsr2xml.o: dsr2xml.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -200,7 +203,6 @@ dsr2xml.o: dsr2xml.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -317,6 +319,7 @@ dsrdump.o: dsrdump.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -324,6 +327,7 @@ dsrdump.o: dsrdump.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -336,7 +340,6 @@ dsrdump.o: dsrdump.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -453,6 +456,7 @@ xml2dsr.o: xml2dsr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -460,6 +464,7 @@ xml2dsr.o: xml2dsr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -472,7 +477,6 @@ xml2dsr.o: xml2dsr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
index ea1787575ca3c0fef7c00d972a5cf7c9e37f408c..e6c175febb3764b08a30574c9b08949222e682d7 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES dsr2xml.xsd report.css reportx.css DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data)
+install(FILES dsr2xml.xsd report.css reportx.css DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data)
index f0f138478b33f98c7faf4e14c525131c90121dcf..2b70bd8bf90058cac3ae0f00896176bb133e552f 100644 (file)
@@ -29,6 +29,7 @@ Currently, the following SR templates are implemented (see notes for details):
 \li \b TID1500_MeasurementReport
 \li \b TID1501_MeasurementGroup
 \li \b TID1600_ImageLibrary
+\li \b TID4019_AlgorithmIdentification
 
 \section Tools
 
@@ -69,9 +70,11 @@ source file):
 DSRDocument document;
 document.setPatientName("Doe^John");
 /* ... */
-document.getTree().addContentItem(DSRTypes::RT_isRoot, DSRTypes::VT_Container);
-document.getTree().getCurrentContentItem().setConceptName(DSRCodedEntryValue(/* some code */));
-document.getTree().addChildContentItem(DSRTypes::RT_hasObsContext, DSRTypes::VT_Code, CODE_DCM_ObserverType);
+DSRDocumentTree &tree = document.getTree();
+tree.addContentItem(DSRTypes::RT_isRoot, DSRTypes::VT_Container);
+tree.getCurrentContentItem().setConceptName(DSRCodedEntryValue(/* some code */));
+tree.addChildContentItem(DSRTypes::RT_hasObsContext, DSRTypes::VT_Code, CODE_DCM_ObserverType);
+tree.getCurrentContentItem().setCodeValue(CODE_DCM_Person);
 /* ... */
 DcmFileFormat fileformat;
 OFCondition status = document.write(*fileformat.getDataset())
@@ -90,13 +93,14 @@ modified directly as the following example shows:
 \code
 DSRDocument document(DSRTypes::DT_KeyObjectSelectionDocument);
 /* ... */
-document.getTree().addContentItem(DSRTypes::RT_isRoot, DSRTypes::VT_Container);
-DSRCodedEntryValue *codePtr = document.getTree().getCurrentContentItem().getConceptNamePtr();
+DSRDocumentTree &tree = document.getTree();
+tree.addContentItem(DSRTypes::RT_isRoot, DSRTypes::VT_Container);
+DSRCodedEntryValue *codePtr = tree.getCurrentContentItem().getConceptNamePtr();
 if (codePtr != NULL)
   codePtr->setCode("113000", "DCM", "Of Interest");
 /* ... */
-document.getTree().addContentItem(DSRTypes::RT_contains, DSRTypes::VT_Image);
-DSRImageReferenceValue *imagePtr = document.getTree().getCurrentContentItem().getImageReferencePtr();
+tree.addContentItem(DSRTypes::RT_contains, DSRTypes::VT_Image);
+DSRImageReferenceValue *imagePtr = tree.getCurrentContentItem().getImageReferencePtr();
 if (imagePtr != NULL)
 {
   imagePtr->setValue(DSRImageReferenceValue(UID_UltrasoundMultiframeImageStorage, /* image UID */));
@@ -111,6 +115,36 @@ In addition, there are specific DSRDocumentTree::addContentItem() and
 DSRDocumentTree::addChildContentItem() methods that expect a pointer to a newly
 created DSRDocumentTreeNode instance.
 
+Iterating over a document tree and searching for content items that meet
+certain criteria can be achieved in various ways. Here are two of them:
+
+\code
+DSRDocument document;
+/* ... */
+DSRDocumentTree &tree = document.getTree();
+/* #1: search for content items with a certain concept name */
+if (tree.gotoNamedNode(CODE_DCM_ProcedureReported))
+{
+  do {
+    const DSRDocumentTreeNode *node = tree.getNode();
+    /* and check for expected value type */
+    if ((node != NULL) && (node->getValueType() == DSRTypes::VT_Code))
+    {
+      /* do something useful with the CODE content item */
+    }
+  } while (tree.gotoNextNamedNode(CODE_DCM_ProcedureReported, OFFalse /*searchIntoSub*/));
+}
+/* #2: search for content items using a more complex filter */
+DSRDocumentTreeNodeAndFilter filter;
+filter.addFilter(new DSRDocumentTreeNodeValueTypeFilter(DSRTypes::VT_Code));
+filter.addFilter(new DSRDocumentTreeNodeRelationshipTypeFilter(DSRTypes::RT_hasConceptMod));
+filter.addFilter(new DSRDocumentTreeNodeHasChildrenFilter());
+if (tree.gotoMatchingNode(filter))
+{
+  /* found first "has concept mod CODE" content item that has children */
+}
+\endcode
+
 The final example shows how to deal with SR templates, e.g. when creating a
 DICOM Structured Report that is based on TID 1500 (Measurement Report):
 
@@ -119,9 +153,13 @@ TID1500_MeasurementReport report(CMR_CID7021::ImagingMeasurementReport);
 report.setLanguage(CID5000_Languages::English);
 report.getObservationContext().addPersonObserver("Doe^Jane", "Some Organization");
 /* ... */
-TID1500_MeasurementReport::TID1411_Measurements &measurements = report.getVolumetricROIMeasurements();
-measurements.setActivitySession("1");
-measurements.setTrackingIdentifier("aorta reference region");
+CMR_TID1411_in_TID1500 &volumetric = report.getVolumetricROIMeasurements();
+volumetric.setActivitySession("1");
+volumetric.setTrackingIdentifier("aorta reference region");
+/* ... */
+CMR_TID1419_in_TID1411_in_TID1500 &measurement = volumetric.getMeasurement();
+measurement.createNewMeasurement(CMR_CID7469::Volume, CMR_TID1419_in_TID1411_in_TID1500::MeasurementValue("15", CMR_CID7181::CubicMillimeter));
+measurement.setDerivation(CMR_CID7464::StandardDeviation);
 /* ... */
 DSRDocument document;
 document.setPatientName("Last Name^First Name");
index b3ae2c62dd91dabcd88dc116fcee49cd4e4bc188..69853cba8fd4fb978d8aa76d603e232b1b5498db 100644 (file)
@@ -248,6 +248,7 @@ ColonCADSRStorage                           1.2.840.10008.5.1.4.1.1.88.69
 ImplantationPlanSRDocumentStorage           1.2.840.10008.5.1.4.1.1.88.70
 AcquisitionContextSRStorage                 1.2.840.10008.5.1.4.1.1.88.71
 SimplifiedAdultEchoSRStorage                1.2.840.10008.5.1.4.1.1.88.72
+PatientRadiationDoseSRStorage               1.2.840.10008.5.1.4.1.1.88.73
 \endverbatim
 
 \subsection dsr2html_character_encoding Character Encoding
@@ -353,6 +354,6 @@ It is an error if no data dictionary can be loaded.
 
 \section dsr2html_copyright COPYRIGHT
 
-Copyright (C) 2000-2016 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2000-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index efa5f0d23dc96f164bbab687bcbd5d40b8b1c815..2bcb3e6502d577acb56948ba56f6cec508088709 100644 (file)
@@ -214,6 +214,7 @@ ColonCADSRStorage                           1.2.840.10008.5.1.4.1.1.88.69
 ImplantationPlanSRDocumentStorage           1.2.840.10008.5.1.4.1.1.88.70
 AcquisitionContextSRStorage                 1.2.840.10008.5.1.4.1.1.88.71
 SimplifiedAdultEchoSRStorage                1.2.840.10008.5.1.4.1.1.88.72
+PatientRadiationDoseSRStorage               1.2.840.10008.5.1.4.1.1.88.73
 \endverbatim
 
 Please note that currently only mandatory and some optional attributes are
@@ -336,6 +337,6 @@ It is an error if no data dictionary can be loaded.
 
 \section dsr2xml_copyright COPYRIGHT
 
-Copyright (C) 2000-2016 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2000-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index e3e2ab4611d301584c7ec7303ecc2d8687dc3ee7..29e9ed8a80c0b7abfb2e5e266b4824c70ebef9c3 100644 (file)
@@ -226,6 +226,7 @@ ColonCADSRStorage                           1.2.840.10008.5.1.4.1.1.88.69
 ImplantationPlanSRDocumentStorage           1.2.840.10008.5.1.4.1.1.88.70
 AcquisitionContextSRStorage                 1.2.840.10008.5.1.4.1.1.88.71
 SimplifiedAdultEchoSRStorage                1.2.840.10008.5.1.4.1.1.88.72
+PatientRadiationDoseSRStorage               1.2.840.10008.5.1.4.1.1.88.73
 \endverbatim
 
 \section dsrdump_logging LOGGING
@@ -291,6 +292,6 @@ It is an error if no data dictionary can be loaded.
 
 \section dsrdump_copyright COPYRIGHT
 
-Copyright (C) 2000-2016 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2000-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index b2eecfd6ae825c06b97b61f44a998c60fb25e355..65c8a425ba4cf9c4d1062d4e4a8b6fea89008696 100644 (file)
@@ -190,6 +190,7 @@ ColonCADSRStorage                           1.2.840.10008.5.1.4.1.1.88.69
 ImplantationPlanSRDocumentStorage           1.2.840.10008.5.1.4.1.1.88.70
 AcquisitionContextSRStorage                 1.2.840.10008.5.1.4.1.1.88.71
 SimplifiedAdultEchoSRStorage                1.2.840.10008.5.1.4.1.1.88.72
+PatientRadiationDoseSRStorage               1.2.840.10008.5.1.4.1.1.88.73
 \endverbatim
 
 Please note that currently only mandatory and some optional attributes are
@@ -307,6 +308,6 @@ It is an error if no data dictionary can be loaded.
 
 \section xml2dsr_copyright COPYRIGHT
 
-Copyright (C) 2003-2016 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
+Copyright (C) 2003-2018 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
 
 */
index b261ff37d578397e58e5c439b83e790c2d77789e..436f36d8f5302a43248ac4c391649d4604feae7b 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmsr DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmsr DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 214adbfc519df1f3586baf864c614ec8e74ed9fa..8247b0e2cdb1d5b1e0183285fa79d3ed2516c97d 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID100_QuantitativeDiagnosticImagingProcedures
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:43 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:12 by J. Riesmeier
  *
  */
 
index 738bd7f624d6841b7f1453a0d137f557d5260707..08a5baae089d276f15f6301eb40766fb867fb088 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID10013_CTAcquisitionType
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:18:05 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:35 by J. Riesmeier
  *
  */
 
index b637de0d14c00af08978c9f6e2a9db04e3baec65..453c83018688ff31213f1c75391f19a61daf00fa 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID10033_CTReconstructionAlgorithm
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:18:07 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:37 by J. Riesmeier
  *
  */
 
index e51d9aa0dc07afa471362bc247a888e01ce3d2e7..99b40615ab0c343fcb0793b3c34b527d80bd2a99 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID11_RouteOfAdministration
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:38 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:07 by J. Riesmeier
  *
  */
 
index 4be61f10c4dd228cb92e2ecfdfba47d354fcaddf..d7bee4a0b1a0aa9f52a90726e3d0201bfe8a8867 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID244_Laterality
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:44 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:14 by J. Riesmeier
  *
  */
 
index bc81f4e4deab748af223c4f94424725596bfeca0..74742e81f7dba814cad4a5d0eaf6b2413fd70aee 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID29_AcquisitionModality
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:39 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:09 by J. Riesmeier
  *
  */
 
@@ -28,7 +28,7 @@
 
 /** Implementation of DCMR Context Group:
  *  CID 29 - Acquisition Modality.
- *  (type: extensible, version: 20121129)
+ *  (type: extensible, version: 20180605)
  */
 class DCMTK_CMR_EXPORT CID29_AcquisitionModality
   : public DSRContextGroup
@@ -92,6 +92,10 @@ class DCMTK_CMR_EXPORT CID29_AcquisitionModality
         OphthalmicRefraction,
         /// (OPT,DCM,"Ophthalmic Tomography")
         OphthalmicTomography,
+        /// (OPTBSV,DCM,"Ophthalmic Tomography B-scan Volume Analysis")
+        OphthalmicTomographyBScanVolumeAnalysis,
+        /// (OPTENF,DCM,"Ophthalmic Tomography En Face")
+        OphthalmicTomographyEnFace,
         /// (OPV,DCM,"Ophthalmic Visual Field")
         OphthalmicVisualField,
         /// (OSS,DCM,"Optical Surface Scanner")
index 041c894e11b9436c69ee44846aacfc2cac07857c..b81de5eb10b413ba641262406eeb2fd75da00b96 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID4020_PETRadionuclide
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:46 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:15 by J. Riesmeier
  *
  */
 
index 84deb144398e3ae13399b7cfd2e15ce68c037bfc..4c27458eed893b37cb24fb641390abc24cc4b7b6 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID4021_PETRadiopharmaceutical
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:48 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:17 by J. Riesmeier
  *
  */
 
@@ -28,7 +28,7 @@
 
 /** Implementation of DCMR Context Group:
  *  CID 4021 - PET Radiopharmaceutical.
- *  (type: extensible, version: 20170413)
+ *  (type: extensible, version: 20180327)
  */
 class DCMTK_CMR_EXPORT CID4021_PETRadiopharmaceutical
   : public DSRContextGroup
@@ -267,7 +267,11 @@ class DCMTK_CMR_EXPORT CID4021_PETRadiopharmaceutical
         /// (126739,DCM,"Ublituximab ^89^Zr")
         Ublituximab_89Zr,
         /// (126734,DCM,"XmAb5574 ^89^Zr")
-        XmAb5574_89Zr
+        XmAb5574_89Zr,
+        /// (C118961,NCIt,"PSMA Ga^68^")
+        PSMA_Ga68,
+        /// (C122684,NCIt,"Sarcosine C^11^")
+        Sarcosine_C11
     };
 
     /** (default) constructor
index ab19b21154bae24907a33c86ff04f6fbedbf36cc..d25a229829a02553727518a7e675cfc0e80f6d7f 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID4031_CommonAnatomicRegions
  *
- *  Generated automatically from DICOM PS 3.16-2017d
- *  File created on 2017-09-26 12:18:52 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:19 by J. Riesmeier
  *
  */
 
index bfa67abf8ab6e467125cd46e99687c8455d71c61..081eea155ec7bbf6ab10eeca00dcee68b5c46522 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID42_NumericValueQualifier
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:41 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:10 by J. Riesmeier
  *
  */
 
index a22cc293edf6aef676963477b5b896d96f6807c7..1137f913949db66582ddba630a169cfbeb24b535 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID6147_ResponseCriteria
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:51 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:21 by J. Riesmeier
  *
  */
 
index 23428374f3c633f941a1b144ea1dd73d175e1b7e..8eecf80e288e61ca4a60ba76db40e5f776038b02 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID7021_MeasurementReportDocumentTitles
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:53 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:22 by J. Riesmeier
  *
  */
 
index 7dfb682245a33e2578afffcc3e6f6c7e2c2a322c..0f47014d78df0e5cb2b666ce8b868cd67a542182 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID7181_AbstractMultiDimensionalImageModelComponentUnits
  *
- *  Generated automatically from DICOM PS 3.16-2017d
- *  File created on 2017-09-26 12:18:58 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:24 by J. Riesmeier
  *
  */
 
@@ -28,7 +28,7 @@
 
 /** Implementation of DCMR Context Group:
  *  CID 7181 - Abstract Multi-dimensional Image Model Component Units.
- *  (type: extensible, version: 20170413)
+ *  (type: extensible, version: 20180605)
  */
 class DCMTK_CMR_EXPORT CID7181_AbstractMultiDimensionalImageModelComponentUnits
   : public DSRContextGroup
@@ -122,6 +122,10 @@ class DCMTK_CMR_EXPORT CID7181_AbstractMultiDimensionalImageModelComponentUnits
         Um2PerS,
         /// (10-6.mm2/s,UCUM,"10-6.mm2/s"), included from CID 7277
         _106mm2PerS,
+        /// (Gy,UCUM,"Gy"), included from CID 10071
+        Gy,
+        /// (Sv,UCUM,"Sv"), included from CID 10071
+        Sv,
         /// (1,UCUM,"no units")
         NoUnits,
         /// ({ratio},UCUM,"ratio")
index fb7c10409bb8fba1e25e9d2d296687f5bdd2ed0b..7ba8d3b73db6e72fa1e1dd7e44d61c3c2971ab34 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID7445_DeviceParticipatingRoles
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:57 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:26 by J. Riesmeier
  *
  */
 
index 64d9e8f1f17875053887babe06e6c252ad83efd5..d022f064f474b433726b0b937867eee62495d2c9 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID7452_OrganizationalRoles
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:58 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:28 by J. Riesmeier
  *
  */
 
index c229cd121854ba04defe8a8713680bcc1dc30d38..7d90c35916f394aa169f9c2a93f26075a4941fa5 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID7453_PerformingRoles
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:18:00 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:29 by J. Riesmeier
  *
  */
 
@@ -28,7 +28,7 @@
 
 /** Implementation of DCMR Context Group:
  *  CID 7453 - Performing Roles.
- *  (type: extensible, version: 20141110)
+ *  (type: extensible, version: 20180326)
  */
 class DCMTK_CMR_EXPORT CID7453_PerformingRoles
   : public DSRContextGroup
@@ -59,7 +59,21 @@ class DCMTK_CMR_EXPORT CID7453_PerformingRoles
         /// (113850,DCM,"Irradiation Authorizing")
         IrradiationAuthorizing,
         /// (113851,DCM,"Irradiation Administering")
-        IrradiationAdministering
+        IrradiationAdministering,
+        /// (C28747,NCIt,"Reader")
+        Reader,
+        /// (129001,DCM,"Eligibility Reader")
+        EligibilityReader,
+        /// (C96561,NCIt,"Adjudicator")
+        Adjudicator,
+        /// (C54634,NCIt,"Reviewer")
+        Reviewer,
+        /// (129002,DCM,"Designator")
+        Designator,
+        /// (129003,DCM,"Image Quality Controller")
+        ImageQualityController,
+        /// (129004,DCM,"Results Quality Controller")
+        ResultsQualityController
     };
 
     /** (default) constructor
index 32c73f88b9e24031e8c91823dacf356ce97544e2..236f45d6c02d0c817c448b0a4578e5b1d3eb4da0 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID7464_GeneralRegionOfInterestMeasurementModifiers
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:18:02 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:31 by J. Riesmeier
  *
  */
 
index 8294fa03a7fc35c861b5cd33d5a038f62473b249..6840d8df1fcd3925c106e933d16aa4cba81c9cda 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class CID7469_GenericIntensityAndSizeMeasurements
  *
- *  Generated automatically from DICOM PS 3.16-2017d
- *  File created on 2017-09-26 12:19:07 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:33 by J. Riesmeier
  *
  */
 
@@ -326,6 +326,26 @@ class DCMTK_CMR_EXPORT CID7469_GenericIntensityAndSizeMeasurements
         AbsorbedDose,
         /// (128512,DCM,"Equivalent Dose"), included from CID 10070
         EquivalentDose,
+        /// (T-D008A,SRT,"Fat"), included from CID 7180
+        Fat,
+        /// (129100,DCM,"Fat fraction"), included from CID 7180
+        FatFraction,
+        /// (129101,DCM,"Water/fat in phase"), included from CID 7180
+        WaterPerFatInPhase,
+        /// (129102,DCM,"Water/fat out of phase"), included from CID 7180
+        WaterPerFatOutOfPhase,
+        /// (113054,DCM,"Negative enhancement integral"), included from CID 7180
+        NegativeEnhancementIntegral,
+        /// (113059,DCM,"Signal change"), included from CID 7180
+        SignalChange,
+        /// (113060,DCM,"Signal to noise"), included from CID 7180
+        SignalToNoise,
+        /// (113066,DCM,"Time course of signal"), included from CID 7180
+        TimeCourseOfSignal,
+        /// (C-10120,SRT,"Water"), included from CID 7180
+        Water,
+        /// (129103,DCM,"Water fraction"), included from CID 7180
+        WaterFraction,
         /// (G-D7FE,SRT,"Length"), included from CID 7470
         Length,
         /// (121211,DCM,"Path length"), included from CID 7470
index c62f986c4f2a54fc9fc1cd5db065a965ea4c1d4e..23bd094417ce0c4eae16ccb6379ab672b65740a3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2017-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file for class TID1419_ROIMeasurements_Measurement
@@ -19,6 +19,7 @@
 
 #include "dcmtk/dcmsr/cmr/define.h"
 #include "dcmtk/dcmsr/cmr/srnumvlu.h"
+#include "dcmtk/dcmsr/cmr/tid4019.h"
 #include "dcmtk/dcmsr/cmr/cid244e.h"
 
 
@@ -91,9 +92,18 @@ class DCMTK_CMR_EXPORT TID1419_ROIMeasurements_Measurement
      */
     OFBool hasMeasurement() const;
 
+    /** get algorithm identification as defined by TID 4019 (Algorithm Identification).
+     *  This included template (TID 1419 - Row 20) is optional, i.e. might be empty.
+     ** @return reference to internally managed SR template
+     */
+    inline TID4019_AlgorithmIdentification &getAlgorithmIdentification() const
+    {
+        return *OFstatic_cast(TID4019_AlgorithmIdentification *, AlgorithmIdentification.get());
+    }
+
     /** create a new measurement.
-     *  Clear the entire measurement and create the mandatory content item of this
-     *  template, i.e.\ TID 1419 - Row 5.
+     *  Clear the entire measurement and create the mandatory (and other supported) content
+     *  items of this template, i.e.\ TID 1419 - Row 5 and 20.
      ** @param  conceptName   coded entry specifying the concept name of the measurement
      *                        (e.g.\ from the given context group 'T_Measurement')
      *  @param  numericValue  numeric measurement value to be set.  The measurement unit
@@ -164,8 +174,9 @@ class DCMTK_CMR_EXPORT TID1419_ROIMeasurements_Measurement
                                        const OFBool check = OFTrue);
 
 
-    /** set the value of the 'Equivalent Meaning of Concept Name' content item (TID 1419
-     *  - Row 18).  If the content item already exists, its value is overwritten.
+    /** set the value of the 'Equivalent Meaning of Concept Name' content item (TID 1419 -
+     *  Row 18).
+     *  If the content item already exists, its value is overwritten.
      ** @param  meaning  human-readable meaning of the concept name of the measurement
      *                   that is equivalent to the post-coordinated meaning conveyed by
      *                   the coded name and its concept modifier children
@@ -198,6 +209,19 @@ class DCMTK_CMR_EXPORT TID1419_ROIMeasurements_Measurement
     OFCondition setRealWorldValueMap(DcmItem &dataset,
                                      const OFBool check = OFTrue);
 
+    /** set the value of the mandatory content items for 'Algorithm Identification'
+     *  (TID 1419 - Row 20).  Further details can be specified by accessing the included
+     *  template TID 4019 with getAlgorithmIdentification().
+     *  If the content items already exist, their value is overwritten.
+     ** @param  algorithmName     name assigned by the manufacturer to the software algorithm
+     *  @param  algorithmVersion  version identifier assigned to the software algorithm
+     *  @param  check             if enabled, check values for validity before setting them
+     ** @return status, EC_Normal if successful, an error code otherwise
+     */
+    OFCondition setAlgorithmIdentification(const OFString &algorithmName,
+                                           const OFString &algorithmVersion,
+                                           const OFBool check = OFTrue);
+
 
   protected:
 
@@ -234,6 +258,12 @@ class DCMTK_CMR_EXPORT TID1419_ROIMeasurements_Measurement
                                         const DSRCodedEntryValue &conceptName,
                                         const OFString &annotationText,
                                         const OFBool check);
+
+
+  private:
+
+    // shared pointer to included template "Algorithm Identification" (TID 4019)
+    DSRSharedSubTemplate AlgorithmIdentification;
 };
 
 
diff --git a/dcmsr/include/dcmtk/dcmsr/cmr/tid4019.h b/dcmsr/include/dcmtk/dcmsr/cmr/tid4019.h
new file mode 100644 (file)
index 0000000..da43037
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ *
+ *  Copyright (C) 2018, J. Riesmeier, Oldenburg, Germany
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  Header file for class TID4019_AlgorithmIdentification
+ *
+ *  Author: Joerg Riesmeier
+ *
+ */
+
+
+#ifndef CMR_TID4019_H
+#define CMR_TID4019_H
+
+#include "dcmtk/config/osconfig.h"   /* make sure OS specific configuration is included first */
+
+#include "dcmtk/dcmsr/dsrstpl.h"
+
+#include "dcmtk/dcmsr/cmr/define.h"
+
+
+/*---------------------*
+ *  class declaration  *
+ *---------------------*/
+
+/** Implementation of DCMR Template:
+ *  TID 4019 - Algorithm Identification.
+ *  All added content items are annotated with a text in the format "TID 4019 - Row [n]".
+ */
+class DCMTK_CMR_EXPORT TID4019_AlgorithmIdentification
+  : public DSRSubTemplate
+{
+
+  public:
+
+    /** default constructor
+     */
+    TID4019_AlgorithmIdentification();
+
+    /** set mandatory identification of the algorithm (according to TID 4019 Row 1 and 2).
+     *  Any previously added algorithm parameters are removed if the passed values are valid.
+     ** @param  algorithmName     name assigned by the manufacturer to the software algorithm
+     *  @param  algorithmVersion  version identifier assigned to the software algorithm
+     *  @param  check             if enabled, check values for validity before setting them
+     ** @return status, EC_Normal if successful, an error code otherwise
+     */
+    OFCondition setIdentification(const OFString &algorithmName,
+                                  const OFString &algorithmVersion,
+                                  const OFBool check = OFTrue);
+
+    /** add optional algorithm parameter (according to TID 4019 Row 3).
+     *  Calling this method requires that the mandatory identification has already been set.
+     ** @param  algorithmParameter  input parameter used to configure the behavior of the
+     *                              software algorithm
+     *  @param  check               if enabled, check values for validity before setting them
+     ** @return status, EC_Normal if successful, an error code otherwise
+     */
+    OFCondition addParameter(const OFString &algorithmParameter,
+                             const OFBool check = OFTrue);
+};
+
+
+/*-------------------*
+ *  type definition  *
+ *-------------------*/
+
+// define short name for the SR template class
+typedef TID4019_AlgorithmIdentification CMR_TID4019;
+
+
+#endif
index 7e017b726503e8fdb6a81966064fad69427e5e08..85e1289e670ebaf01fbbb6e57254bb27501ac10b 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file with DICOM Controlled Terminology Code Definitions (Coding Scheme "DCM", Version "01")
  *
- *  Generated automatically from DICOM PS 3.16-2017e
- *  File created on 2017-12-05 09:12:40 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:45:05 by J. Riesmeier
  *
  */
 
@@ -34,7 +34,7 @@
  *  code definitions  *
  *--------------------*/
 
-// total number of codes: 3861
+// total number of codes: 3902
 // - retired: 144
 // - no name: 27
 // - not unique: 15
@@ -98,6 +98,7 @@
 #define CODE_DCM_Male                                                      DSRBasicCodedEntry("M", "DCM", "Male")
 #define CODE_DCM_RETIRED_MagneticResonanceAngiography                      DSRBasicCodedEntry("MA", "DCM", "Magnetic resonance angiography")
 #define CODE_DCM_MaleChangedToFemale                                       DSRBasicCodedEntry("MC", "DCM", "Male changed to Female")
+#define CODE_DCM_3DManufacturingModelingSystem                             DSRBasicCodedEntry("M3D", "DCM", "3D Manufacturing Modeling System")
 #define CODE_DCM_MediaCreationDevice                                       DSRBasicCodedEntry("MCD", "DCM", "Media Creation Device")
 #define CODE_DCM_PortableMediaImporterEquipment                            DSRBasicCodedEntry("MEDIM", "DCM", "Portable Media Importer Equipment")
 #define CODE_DCM_Mammography                                               DSRBasicCodedEntry("MG", "DCM", "Mammography")
 #define CODE_DCM_OphthalmicMapping                                         DSRBasicCodedEntry("OPM", "DCM", "Ophthalmic Mapping")
 #define CODE_DCM_OphthalmicRefraction                                      DSRBasicCodedEntry("OPR", "DCM", "Ophthalmic Refraction")
 #define CODE_DCM_OphthalmicTomography                                      DSRBasicCodedEntry("OPT", "DCM", "Ophthalmic Tomography")
+#define CODE_DCM_OphthalmicTomographyBScanVolumeAnalysis                   DSRBasicCodedEntry("OPTBSV", "DCM", "Ophthalmic Tomography B-scan Volume Analysis")
+#define CODE_DCM_OphthalmicTomographyEnFace                                DSRBasicCodedEntry("OPTENF", "DCM", "Ophthalmic Tomography En Face")
 #define CODE_DCM_OphthalmicVisualField                                     DSRBasicCodedEntry("OPV", "DCM", "Ophthalmic Visual Field")
 #define CODE_DCM_OpticalSurfaceScanner                                     DSRBasicCodedEntry("OSS", "DCM", "Optical Surface Scanner")
 #define CODE_DCM_OtherModality                                             DSRBasicCodedEntry("OT", "DCM", "Other Modality")
 #define CODE_DCM_WorkitemAssignmentRejectedByAssignedResource              DSRBasicCodedEntry("110530", "DCM", "Workitem assignment rejected by assigned resource")
 #define CODE_DCM_InsufficientQualityForInterpretation                      DSRBasicCodedEntry("110531", "DCM", "Insufficient quality for interpretation")
 #define CODE_DCM_InterpretationRequiresSpecialistExpertise                 DSRBasicCodedEntry("110532", "DCM", "Interpretation requires specialist expertise")
+#define CODE_DCM_WorkitemExpired                                           DSRBasicCodedEntry("110533", "DCM", "Workitem expired")
 #define CODE_DCM_VentralDiencephalon                                       DSRBasicCodedEntry("110700", "DCM", "Ventral Diencephalon")
 #define CODE_DCM_WhiteMatterT1Hypointensity                                DSRBasicCodedEntry("110701", "DCM", "White Matter T1 Hypointensity")
 #define CODE_DCM_WhiteMatterT2Hyperintensity                               DSRBasicCodedEntry("110702", "DCM", "White Matter T2 Hyperintensity")
 #define CODE_DCM_RestenoticLesion                                          DSRBasicCodedEntry("122393", "DCM", "Restenotic Lesion")
 #define CODE_DCM_FibroLipidicPlaque                                        DSRBasicCodedEntry("122394", "DCM", "Fibro-Lipidic Plaque")
 #define CODE_DCM_NecroticLipidicPlaque                                     DSRBasicCodedEntry("122395", "DCM", "Necrotic-Lipidic Plaque")
+#define CODE_DCM_AdventitialDissection                                     DSRBasicCodedEntry("122397", "DCM", "Adventitial Dissection")
 #define CODE_DCM_IntimalDissection                                         DSRBasicCodedEntry("122398", "DCM", "Intimal Dissection")
 #define CODE_DCM_MedialDissection                                          DSRBasicCodedEntry("122399", "DCM", "Medial Dissection")
 #define CODE_DCM_SimultaneouslyAcquired                                    DSRBasicCodedEntry("122400", "DCM", "Simultaneously Acquired")
 #define CODE_DCM_GrayLevelVarianceInZones                                  DSRBasicCodedEntry("128834", "DCM", "Gray Level Variance in Zones")
 #define CODE_DCM_ZoneSizeVariance                                          DSRBasicCodedEntry("128835", "DCM", "Zone Size Variance")
 #define CODE_DCM_ZoneSizeEntropy                                           DSRBasicCodedEntry("128836", "DCM", "Zone Size Entropy")
+#define CODE_DCM_EligibilityReader                                         DSRBasicCodedEntry("129001", "DCM", "Eligibility Reader")
+#define CODE_DCM_Designator                                                DSRBasicCodedEntry("129002", "DCM", "Designator")
+#define CODE_DCM_ImageQualityController                                    DSRBasicCodedEntry("129003", "DCM", "Image Quality Controller")
+#define CODE_DCM_ResultsQualityController                                  DSRBasicCodedEntry("129004", "DCM", "Results Quality Controller")
+#define CODE_DCM_EditedModel                                               DSRBasicCodedEntry("129010", "DCM", "Edited Model")
+#define CODE_DCM_ComponentModel                                            DSRBasicCodedEntry("129011", "DCM", "Component Model")
+#define CODE_DCM_EducationalIntent                                         DSRBasicCodedEntry("129012", "DCM", "Educational Intent")
+#define CODE_DCM_PlanningIntent                                            DSRBasicCodedEntry("129013", "DCM", "Planning Intent")
+#define CODE_DCM_ToolFabrication                                           DSRBasicCodedEntry("129014", "DCM", "Tool Fabrication")
+#define CODE_DCM_ProstheticFabrication                                     DSRBasicCodedEntry("129015", "DCM", "Prosthetic Fabrication")
+#define CODE_DCM_ImplantFabrication                                        DSRBasicCodedEntry("129016", "DCM", "Implant Fabrication")
+#define CODE_DCM_SimulationIntent                                          DSRBasicCodedEntry("129017", "DCM", "Simulation Intent")
+#define CODE_DCM_US3DCAMModel                                              DSRBasicCodedEntry("129018", "DCM", "US 3D CAM model")
+#define CODE_DCM_MixedModality3DCAMModel                                   DSRBasicCodedEntry("129019", "DCM", "Mixed Modality 3D CAM model")
+#define CODE_DCM_PhotogrammetricImaging3DCAMModel                          DSRBasicCodedEntry("129020", "DCM", "Photogrammetric Imaging 3D CAM model")
+#define CODE_DCM_LaserScanning3DCAMModel                                   DSRBasicCodedEntry("129021", "DCM", "Laser Scanning 3D CAM model")
+#define CODE_DCM_FatFraction                                               DSRBasicCodedEntry("129100", "DCM", "Fat fraction")
+#define CODE_DCM_WaterFatInPhase                                           DSRBasicCodedEntry("129101", "DCM", "Water/fat in phase")
+#define CODE_DCM_WaterFatOutOfPhase                                        DSRBasicCodedEntry("129102", "DCM", "Water/fat out of phase")
+#define CODE_DCM_WaterFraction                                             DSRBasicCodedEntry("129103", "DCM", "Water fraction")
+#define CODE_DCM_PerfusionImageAnalysis                                    DSRBasicCodedEntry("129104", "DCM", "Perfusion image analysis")
+#define CODE_DCM_DiffusionImageAnalysis                                    DSRBasicCodedEntry("129105", "DCM", "Diffusion image analysis")
+#define CODE_DCM_DiffusionTractography                                     DSRBasicCodedEntry("129106", "DCM", "Diffusion tractography")
+#define CODE_DCM_ImageUsedForTreatmentPlanning                             DSRBasicCodedEntry("129201", "DCM", "Image used for Treatment Planning")
+#define CODE_DCM_ImageUsedForDoseCalculation                               DSRBasicCodedEntry("129202", "DCM", "Image used for Dose Calculation")
+#define CODE_DCM_ImageAcquiredDuringTreatment                              DSRBasicCodedEntry("129203", "DCM", "Image Acquired during Treatment")
+#define CODE_DCM_ImageUsedAsReferenceImageForTreatment                     DSRBasicCodedEntry("129204", "DCM", "Image used as Reference Image for Treatment")
+#define CODE_DCM_RegistrationUsedInPlanning                                DSRBasicCodedEntry("129210", "DCM", "Registration used in Planning")
+#define CODE_DCM_RegistrationCreatedDuringTreatment                        DSRBasicCodedEntry("129211", "DCM", "Registration created during Treatment")
+#define CODE_DCM_CoilMarker                                                DSRBasicCodedEntry("129301", "DCM", "Coil Marker")
+#define CODE_DCM_CylinderMarker                                            DSRBasicCodedEntry("129303", "DCM", "Cylinder Marker")
+#define CODE_DCM_WireMarker                                                DSRBasicCodedEntry("129305", "DCM", "Wire Marker")
+#define CODE_DCM_TransponderMarker                                         DSRBasicCodedEntry("129306", "DCM", "Transponder Marker")
+#define CODE_DCM_MRMarker                                                  DSRBasicCodedEntry("129308", "DCM", "MR Marker")
+#define CODE_DCM_InfraredReflectorMarker                                   DSRBasicCodedEntry("129309", "DCM", "Infrared Reflector Marker")
+#define CODE_DCM_VisibleReflectorMarker                                    DSRBasicCodedEntry("129310", "DCM", "Visible Reflector Marker")
 
 #endif
index 9e67e45b0091faa3a6004d35607da71669471cdc..0888b2d2381ac3132617e1a2f1a79a19e22f70c8 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file with NCI Thesaurus Code Definitions (Coding Scheme "NCIt")
  *
- *  Generated automatically from DICOM PS 3.16-2017e
- *  File created on 2017-12-05 09:12:48 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:45:13 by J. Riesmeier
  *
  */
 
@@ -34,7 +34,7 @@
  *  code definitions  *
  *--------------------*/
 
-// total number of codes: 19
+// total number of codes: 24
 // - retired: 0
 // - no name: 0
 // - not unique: 0
 // description of the code meaning to a compiler-friendly but still human-readable representation.
 
 #define CODE_NCIt_RANO                                                     DSRBasicCodedEntry("C114879", "NCIt", "RANO")
+#define CODE_NCIt_PSMA_Ga68                                                DSRBasicCodedEntry("C118961", "NCIt", "PSMA Ga^68^")
+#define CODE_NCIt_Sarcosine_C11                                            DSRBasicCodedEntry("C122684", "NCIt", "Sarcosine C^11^")
 #define CODE_NCIt_MouseMammaryFatPad                                       DSRBasicCodedEntry("C22550", "NCIt", "Mouse mammary fat pad")
+#define CODE_NCIt_Reader                                                   DSRBasicCodedEntry("C28747", "NCIt", "Reader")
 #define CODE_NCIt_BronchioloalveolarAdenocarcinoma                         DSRBasicCodedEntry("C2923", "NCIt", "Bronchioloalveolar adenocarcinoma")
 #define CODE_NCIt_Enrollment                                               DSRBasicCodedEntry("C37948", "NCIt", "Enrollment")
 #define CODE_NCIt_ExtraluminalRoute                                        DSRBasicCodedEntry("C38213", "NCIt", "Extraluminal route")
 #define CODE_NCIt_IntraepithelialRoute                                     DSRBasicCodedEntry("C38244", "NCIt", "Intraepithelial route")
 #define CODE_NCIt_TransluminalRoute                                        DSRBasicCodedEntry("C38306", "NCIt", "Transluminal route")
 #define CODE_NCIt_TemperatureSensorDeviceComponent                         DSRBasicCodedEntry("C50304", "NCIt", "Temperature sensor device component")
+#define CODE_NCIt_Reviewer                                                 DSRBasicCodedEntry("C54634", "NCIt", "Reviewer")
 #define CODE_NCIt_AdLibitum                                                DSRBasicCodedEntry("C64636", "NCIt", "ad libitum")
 #define CODE_NCIt_ActivitySession                                          DSRBasicCodedEntry("C67447", "NCIt", "Activity Session")
 #define CODE_NCIt_UnitConversionFactor                                     DSRBasicCodedEntry("C70774", "NCIt", "Unit Conversion Factor")
@@ -67,5 +71,6 @@
 #define CODE_NCIt_LightCycle                                               DSRBasicCodedEntry("C90419", "NCIt", "Light cycle")
 #define CODE_NCIt_WaterDelivery                                            DSRBasicCodedEntry("C90486", "NCIt", "Water delivery")
 #define CODE_NCIt_ReferenceRegion                                          DSRBasicCodedEntry("C94970", "NCIt", "Reference Region")
+#define CODE_NCIt_Adjudicator                                              DSRBasicCodedEntry("C96561", "NCIt", "Adjudicator")
 
 #endif
index a2e18f7a4117b8cfa55ccd013b2e29827c75be53..cbada76aab3d2b7119d72061c215051865e3ccb4 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Header file with UMLS Code Definitions (Coding Scheme "UMLS")
  *
- *  Generated automatically from DICOM PS 3.16-2017e
- *  File created on 2017-12-05 09:12:47 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:45:12 by J. Riesmeier
  *
  */
 
index 03a0bf9be59989b5e2d9616e155824e23032350b..362ed5850384de9c0c400ef6196b0ba3c73cb682 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -98,7 +98,7 @@ class DCMTK_DCMSR_EXPORT DSRBasicCodedEntry
     const OFString CodeValue;
     /// Coding Scheme Designator (VR=SH, type 1)
     const OFString CodingSchemeDesignator;
-    /// Coding Scheme Version (VR=SH, 1C)
+    /// Coding Scheme Version (VR=SH, type 1C)
     const OFString CodingSchemeVersion;
     /// Code Meaning (VR=LO, type 1)
     const OFString CodeMeaning;
@@ -238,7 +238,7 @@ class DCMTK_DCMSR_EXPORT DSRCodedEntryValue
     virtual void clear();
 
     /** check whether the current code is valid.  This check only covers the "Basic Coded Entry
-     *  Attributes".  See checkCode() for details.
+     *  Attributes".  An empty code is not valid.  See checkCode() for details.
      ** @return OFTrue if code is valid, OFFalse otherwise
      */
     virtual OFBool isValid() const;
@@ -589,9 +589,7 @@ class DCMTK_DCMSR_EXPORT DSRCodedEntryValue
 
     /** specify the "Enhanced Encoding Mode" for this code.
      *  This method should be used for private context groups, which are not identified by a
-     *  context identifier and mapping resource.  Before setting the code, it is usually
-     *  checked.  If the code is invalid, the current code is not replaced and remains
-     *  unchanged.
+     *  context identifier and mapping resource.
      ** @param  contextUID  uniquely identifies the context group.  (VR=UI, mandatory)
      *  @param  check       if enabled, the given value is checked for validity (conformance
      *                      with corresponding VR and VM) before setting it.  An empty value
@@ -663,7 +661,7 @@ class DCMTK_DCMSR_EXPORT DSRCodedEntryValue
 
     /** write code to dataset.
      *  This method also supports the attributes from the "Enhanced Encoding Mode".
-     ** @param  dataset    DICOM dataset to which the code should be written
+     ** @param  dataset  DICOM dataset to which the code should be written
      ** @return status, EC_Normal if successful, an error code otherwise
      */
     OFCondition writeItem(DcmItem &dataset) const;
@@ -712,7 +710,7 @@ class DCMTK_DCMSR_EXPORT DSRCodedEntryValue
     OFString CodeValue;
     /// Coding Scheme Designator (VR=SH, type 1)
     OFString CodingSchemeDesignator;
-    /// Coding Scheme Version (VR=SH, 1C)
+    /// Coding Scheme Version (VR=SH, type 1C)
     OFString CodingSchemeVersion;
     /// Code Meaning (VR=LO, type 1)
     OFString CodeMeaning;
index f3422841fe06e26b722adc86812404fdd1be4c8a..bb9a8477dcf7cb929ba03552ad77140ce6ae7c00 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2017-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -74,6 +74,10 @@ class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeFilterList
 
   public:
 
+    /** default constructor
+     */
+    DSRDocumentTreeNodeFilterList();
+
     /** destructor
      */
     virtual ~DSRDocumentTreeNodeFilterList();
@@ -97,6 +101,14 @@ class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeFilterList
 
     /// list of pointers to filter criteria
     OFList<DSRDocumentTreeNodeFilter *> FilterList;
+
+
+  private:
+
+ // --- declaration of copy constructor and assignment operator
+
+    DSRDocumentTreeNodeFilterList(const DSRDocumentTreeNodeFilterList &);
+    DSRDocumentTreeNodeFilterList &operator=(const DSRDocumentTreeNodeFilterList &);
 };
 
 
@@ -151,7 +163,7 @@ class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeHasChildrenFilter
 
   public:
 
-    /** constructor
+    /** (default) constructor
      ** @param  hasChildren  mode specifying whether the filter matches on the presence
      *                       (default) or absence of child nodes
      */
@@ -185,7 +197,7 @@ class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeHasSiblingsFilter
 
   public:
 
-    /** constructor
+    /** (default) constructor
      ** @param  hasSiblings  mode specifying whether the filter matches on the presence
      *                       (default) or absence of sibling nodes
      */
@@ -210,6 +222,40 @@ class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeHasSiblingsFilter
 };
 
 
+/** Class implementing a document tree node filter that checks for the presence (or
+ *  absence) of a concept name.  An empty concept name is treated as absent.
+ */
+class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeHasConceptNameFilter
+  : public DSRDocumentTreeNodeFilter
+{
+
+  public:
+
+    /** constructor
+     ** @param  hasConceptName  mode specifying whether the filter matches on the
+     *                          presence (default) or absence of a concept name
+     */
+    DSRDocumentTreeNodeHasConceptNameFilter(const OFBool hasConceptName = OFTrue);
+
+    /** destructor
+     */
+    virtual ~DSRDocumentTreeNodeHasConceptNameFilter();
+
+    /** check whether given node matches the filter criterion
+     ** @param  node  pointer to the node to be checked
+     ** @return OFTrue if 'node' matches the filter criterion, OFFalse otherwise
+     */
+    virtual OFBool matches(const DSRDocumentTreeNode *node) const;
+
+
+  private:
+
+    /// mode specifying whether the filter matches on the presence or absence of a
+    /// concept name
+    const OFBool HasConceptName;
+};
+
+
 /** Class implementing a document tree node filter that checks for a given concept name
  */
 class DCMTK_DCMSR_EXPORT DSRDocumentTreeNodeConceptNameFilter
index e1cde3ca1199f515175ebbe99d027746e60c1049..14c03bfcd28a70b3838434b86d31bfb44120fd14 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -564,6 +564,18 @@ class DCMTK_DCMSR_EXPORT DSRDocumentSubTree
      */
     virtual OFCondition createExpandedSubTree(DSRDocumentSubTree *&tree) const;
 
+    /** set observation date/time for all content items in the document tree.
+     *  Calling this method might be useful when a (sub)tree is copied into a new document,
+     *  since content date and time of the new document are likely to be different than the
+     *  date and time of the original observation.
+     ** @param  observationDateTime  value to be set (might be an empty string)
+     *  @param  check                check 'observationDateTime' for conformance with VR (DT)
+     *                               and VM (1) if enabled
+     ** @return status, EC_Normal if successful, an error code otherwise
+     */
+    virtual OFCondition setObservationDateTime(const OFString &observationDateTime,
+                                               const OFBool check = OFTrue);
+
     /** compare template identification of the root node with given values.
      *  Please note that the comparison only takes place if there is a single node at the
      *  root of the tree and its value type is CONTAINER.
@@ -578,10 +590,11 @@ class DCMTK_DCMSR_EXPORT DSRDocumentSubTree
                                                  const OFString &mappingResource,
                                                  const OFString &mappingResourceUID = "") const;
 
-    /** get template identifier and mapping resource from the root node of this tree.  See
-     *  DSRDocumentTreeNode::getTemplateIdentification() for details on template identification.
-     *  Please note that the template identification is only retrieved if there is a single node
-     *  at the root of the tree and its value type is CONTAINER.
+    /** get template identifier and mapping resource from the root node of this tree.
+     *  See DSRDocumentTreeNode::getTemplateIdentification() for details on template
+     *  identification.
+     *  Please note that the template identification is only retrieved if there is a single
+     *  node at the root of the tree and its value type is CONTAINER.
      ** @param  templateIdentifier  identifier of the template (might be empty)
      *  @param  mappingResource     mapping resource that defines the template (might be empty)
      ** @return status, EC_Normal if successful, an error code otherwise
@@ -592,8 +605,8 @@ class DCMTK_DCMSR_EXPORT DSRDocumentSubTree
     /** get template identifier, mapping resource and optional mapping resource UID from the
      *  root node of this tree.  See DSRDocumentTreeNode::getTemplateIdentification() for
      *  details on template identification.
-     *  Please note that the template identification is only retrieved if there is a single node
-     *  at the root of the tree and its value type is CONTAINER.
+     *  Please note that the template identification is only retrieved if there is a single
+     *  node at the root of the tree and its value type is CONTAINER.
      ** @param  templateIdentifier  identifier of the template (might be empty)
      *  @param  mappingResource     mapping resource that defines the template (might be empty)
      *  @param  mappingResourceUID  uniquely identifies the mapping resource (might be empty)
index e21e576d82268c12e6cd043c88dc22bfdb584328..8629002f74bb1b8e46631ddca936a7281fb30803 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2016, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -82,8 +82,8 @@ class DCMTK_DCMSR_EXPORT DSRDocumentTree
     virtual void clear();
 
     /** check whether the current internal state is valid.
-     *  The SR document is valid if the document type is supported, the tree is not
-     *  empty, the root item is a container and has the internal relationship type
+     *  The SR document tree is valid if the document type is supported, the tree is
+     *  not empty, the root item is a container and has the internal relationship type
      *  DSRTypes::RT_isRoot.  Also see DSRDocumentSubTree::isValidDocumentTree().
      ** @return OFTrue if valid, OFFalse otherwise
      */
index deece1a0dc8ce2259b74898b960d783d95a85c1f..54396a9a7676ab14ab576bd66393d3d51d18aa38 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2015, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -47,7 +47,9 @@ class DCMTK_DCMSR_EXPORT DSRByReferenceTreeNode
      */
     DSRByReferenceTreeNode(const E_RelationshipType relationshipType);
 
-    /** constructor
+    /** constructor.
+     *  The passed values are stored but the reference stays invalid until updated by
+     *  updateReference().
      ** @param  relationshipType  type of relationship to the parent/source tree node.
      *                            Should not be DSRTypes::RT_invalid or DSRTypes::RT_isRoot.
      *  @param  referencedNodeID  ID of the node to be referenced (target content item)
@@ -75,6 +77,25 @@ class DCMTK_DCMSR_EXPORT DSRByReferenceTreeNode
      */
     virtual ~DSRByReferenceTreeNode();
 
+    /** comparison operator "equal".
+     *  Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode
+     *  regards them as "equal" (same types and concept names) and the stored values are equal.
+     *  In this case, the IDs of the referenced nodes are used (if the references are valid).
+     ** @param  node  tree node that should be compared to the current one
+     ** @return OFTrue if both tree nodes are equal, OFFalse otherwise
+     */
+    virtual OFBool operator==(const DSRDocumentTreeNode &node) const;
+
+    /** comparison operator "not equal".
+     *  Two tree nodes are not equal if either the comparison operator of the base class
+     *  DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or
+     *  the stored values are not equal.  In this case, the IDs of the referenced nodes are
+     *  used (if the references are valid).
+     ** @param  node  tree node that should be compared to the current one
+     ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise
+     */
+    virtual OFBool operator!=(const DSRDocumentTreeNode &node) const;
+
     /** clone this tree node.
      *  Internally, the copy constructor is used, so the corresponding comments apply.
      ** @return copy of this tree node
index 0752da78d44e21d06c94dd52e9f20d575075b3f7..5597aa56f0f4b35696615468ef929f21a3de9534 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2010-2015, OFFIS e.V.
+ *  Copyright (C) 2010-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -60,6 +60,23 @@ class DCMTK_DCMSR_EXPORT DSRSCoord3DTreeNode
      */
     virtual ~DSRSCoord3DTreeNode();
 
+    /** comparison operator "equal".
+     *  Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode
+     *  regards them as "equal" (same types and concept names) and the stored values are equal.
+     ** @param  node  tree node that should be compared to the current one
+     ** @return OFTrue if both tree nodes are equal, OFFalse otherwise
+     */
+    virtual OFBool operator==(const DSRDocumentTreeNode &node) const;
+
+    /** comparison operator "not equal".
+     *  Two tree nodes are not equal if either the comparison operator of the base class
+     *  DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or
+     *  the stored values are not equal.
+     ** @param  node  tree node that should be compared to the current one
+     ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise
+     */
+    virtual OFBool operator!=(const DSRDocumentTreeNode &node) const;
+
     /** clone this tree node.
      *  Internally, the copy constructor is used, so the corresponding comments apply.
      ** @return copy of this tree node
index 5c29f3a339fc6eb2697d22cf58c5c078255f294b..f7bcbe954317c1e34a5773a7b82fa24fe5959ea5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2010-2016, OFFIS e.V.
+ *  Copyright (C) 2010-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -68,6 +68,20 @@ class DCMTK_DCMSR_EXPORT DSRSpatialCoordinates3DValue
      */
     DSRSpatialCoordinates3DValue &operator=(const DSRSpatialCoordinates3DValue &coordinatesValue);
 
+    /** comparison operator "equal"
+     ** @param  coordinatesValue  spatial coordinates value that should be compared to the
+     *                            current one
+     ** @return OFTrue if both spatial coordinates values are equal, OFFalse otherwise
+     */
+    OFBool operator==(const DSRSpatialCoordinates3DValue &coordinatesValue) const;
+
+    /** comparison operator "not equal"
+     ** @param  coordinatesValue  spatial coordinates value that should be compared to the
+     *                            current one
+     ** @return OFTrue if both spatial coordinates values are not equal, OFFalse otherwise
+     */
+    OFBool operator!=(const DSRSpatialCoordinates3DValue &coordinatesValue) const;
+
     /** clear all internal variables.
      *  Graphic type is set to DSRTypes::GT3_invalid.  Since an empty list of graphic data is
      *  invalid the spatial coordinates value becomes invalid afterwards.
index 82838d016c74c1df89fa9bbfd5a65f92dd65e0d2..5ec109acac48c6dc6c6f74d0662b2d26836ea45a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -81,14 +81,18 @@ template<class T> class DSRListOfItems
      */
     inline DSRListOfItems<T> &operator=(const DSRListOfItems<T> &lst)
     {
-        /* class OFList has no overloaded assignment operator */
-        ItemList.clear();
-        const OFLIST_TYPENAME OFListConstIterator(T) endPos = lst.ItemList.end();
-        OFLIST_TYPENAME OFListConstIterator(T) iterator = lst.ItemList.begin();
-        while (iterator != endPos)
+        /* check for self-assignment, which would not work */
+        if (this != &lst)
         {
-            ItemList.push_back(*iterator);
-            iterator++;
+            /* class OFList has no overloaded assignment operator */
+            ItemList.clear();
+            const OFLIST_TYPENAME OFListConstIterator(T) endPos = lst.ItemList.end();
+            OFLIST_TYPENAME OFListConstIterator(T) iterator = lst.ItemList.begin();
+            while (iterator != endPos)
+            {
+                ItemList.push_back(*iterator);
+                iterator++;
+            }
         }
         return *this;
     }
index 58a890b69618b14e46f9591764ff5888d8bb1255..544b1661cfee4d5c4aeac915ed8d0b63644d7423 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -274,6 +274,12 @@ class DSRTreeNodeCursor
 
   protected:
 
+    /** fast, non-throwing swap function.
+     *  The time complexity of this function is constant.
+     ** @param  cursor  cursor to swap with
+     */
+    void swap(DSRTreeNodeCursor<T> &cursor);
+
     /** clear the internal node cursor stack
      */
     void clearNodeCursorStack();
@@ -390,14 +396,6 @@ OFBool DSRTreeNodeCursor<T>::isValid() const
 }
 
 
-template<typename T>
-void DSRTreeNodeCursor<T>::clearNodeCursorStack()
-{
-    while (!NodeCursorStack.empty())
-        NodeCursorStack.pop();
-}
-
-
 template<typename T>
 size_t DSRTreeNodeCursor<T>::countChildNodes(const OFBool searchIntoSub) const
 {
@@ -500,45 +498,6 @@ const T *DSRTreeNodeCursor<T>::getNextNode() const
 }
 
 
-template<typename T>
-const DSRTreeNodeCursor<T> &DSRTreeNodeCursor<T>::getCursor() const
-{
-    return *this;
-}
-
-
-template<typename T>
-void DSRTreeNodeCursor<T>::setCursor(const DSRTreeNodeCursor<T> &cursor)
-{
-    NodeCursor = cursor.NodeCursor;
-    NodeCursorStack = cursor.NodeCursorStack;
-    Position = cursor.Position;
-}
-
-
-template<typename T>
-size_t DSRTreeNodeCursor<T>::setCursor(T *node)
-{
-    size_t nodeID = 0;
-    NodeCursor = node;
-    if (NodeCursor != NULL)
-        nodeID = NodeCursor->getIdent();
-    clearNodeCursorStack();
-    Position.initialize(NodeCursor != NULL);
-    return nodeID;
-}
-
-
-template<typename T>
-T *DSRTreeNodeCursor<T>::getChild() const
-{
-    T *node = NULL;
-    if (NodeCursor != NULL)
-        node = NodeCursor->getDown();
-    return node;
-}
-
-
 template<typename T>
 size_t DSRTreeNodeCursor<T>::gotoFirst()
 {
@@ -837,4 +796,63 @@ const OFString &DSRTreeNodeCursor<T>::getPosition(OFString &position,
 }
 
 
+// protected methods
+
+template<typename T>
+void DSRTreeNodeCursor<T>::swap(DSRTreeNodeCursor<T> &cursor)
+{
+    /* swap all members */
+    OFswap(NodeCursor, cursor.NodeCursor);
+    OFswap(NodeCursorStack, cursor.NodeCursorStack);
+    OFswap(Position, cursor.Position);
+}
+
+
+template<typename T>
+void DSRTreeNodeCursor<T>::clearNodeCursorStack()
+{
+    while (!NodeCursorStack.empty())
+        NodeCursorStack.pop();
+}
+
+
+template<typename T>
+const DSRTreeNodeCursor<T> &DSRTreeNodeCursor<T>::getCursor() const
+{
+    return *this;
+}
+
+
+template<typename T>
+void DSRTreeNodeCursor<T>::setCursor(const DSRTreeNodeCursor<T> &cursor)
+{
+    NodeCursor = cursor.NodeCursor;
+    NodeCursorStack = cursor.NodeCursorStack;
+    Position = cursor.Position;
+}
+
+
+template<typename T>
+size_t DSRTreeNodeCursor<T>::setCursor(T *node)
+{
+    size_t nodeID = 0;
+    NodeCursor = node;
+    if (NodeCursor != NULL)
+        nodeID = NodeCursor->getIdent();
+    clearNodeCursorStack();
+    Position.initialize(NodeCursor != NULL);
+    return nodeID;
+}
+
+
+template<typename T>
+T *DSRTreeNodeCursor<T>::getChild() const
+{
+    T *node = NULL;
+    if (NodeCursor != NULL)
+        node = NodeCursor->getDown();
+    return node;
+}
+
+
 #endif
index 0803f4cc7b23191c4ee8e508546f9d91eebafb8c..8e82e6c749a8e17ed2a2f2c63eed167169c64f56 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -61,6 +61,23 @@ class DCMTK_DCMSR_EXPORT DSRIncludedTemplateTreeNode
      */
     virtual ~DSRIncludedTemplateTreeNode();
 
+    /** comparison operator "equal".
+     *  Two tree nodes are equal if the comparison operator of the base class DSRDocumentTreeNode
+     *  regards them as "equal" (same types and concept names) and the stored values are equal.
+     ** @param  node  tree node that should be compared to the current one
+     ** @return OFTrue if both tree nodes are equal, OFFalse otherwise
+     */
+    virtual OFBool operator==(const DSRDocumentTreeNode &node) const;
+
+    /** comparison operator "not equal".
+     *  Two tree nodes are not equal if either the comparison operator of the base class
+     *  DSRDocumentTreeNode regards them as "not equal" (different types or concept names) or
+     *  the stored values are not equal.
+     ** @param  node  tree node that should be compared to the current one
+     ** @return OFTrue if both tree nodes are not equal, OFFalse otherwise
+     */
+    virtual OFBool operator!=(const DSRDocumentTreeNode &node) const;
+
     /** clone this tree node.
      *  Internally, the copy constructor is used, so the corresponding comments apply.
      ** @return copy of this tree node
index ce1360e62afd5133ee87e7a799a443a3bb653ba6..39be261dbca90a622fa974bffe3eab29a17a825d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2016, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -962,6 +962,8 @@ DSRTree<T> *DSRTree<T>::cloneSubTree(const size_t stopAfterNodeID) const
 template<typename T>
 void DSRTree<T>::swap(DSRTree<T> &tree)
 {
+    /* swap inherited node cursor */
+    DSRTreeNodeCursor<T>::swap(tree);
     /* swap pointer to the root tree node */
     OFswap(RootNode, tree.RootNode);
 }
index 72c544cc22b74380bc5f1c4ecd844edd790c8630..a1f4cb19cc682c8bedb429200891581973923a14 100644 (file)
@@ -1,4 +1,4 @@
 # create library from source files
-DCMTK_ADD_LIBRARY(cmr init logger srnumvl tid300 tid1001 tid1204 tid1411 tid1419m tid1500 tid1501 tid15def tid1600 cid11 cid29 cid29e cid42 cid100 cid244 cid244e cid4020 cid4021 cid4031 cid4031e cid5000 cid5001 cid6147 cid7021 cid7181 cid7445 cid7452 cid7453 cid7464 cid7469 cid10013 cid10013e cid10033 cid10033e)
+DCMTK_ADD_LIBRARY(cmr init logger srnumvl tid300 tid1001 tid1204 tid1411 tid1419m tid1500 tid1501 tid15def tid1600 tid4019 cid11 cid29 cid29e cid42 cid100 cid244 cid244e cid4020 cid4021 cid4031 cid4031e cid5000 cid5001 cid6147 cid7021 cid7181 cid7445 cid7452 cid7453 cid7464 cid7469 cid10013 cid10013e cid10033 cid10033e)
 
 DCMTK_TARGET_LINK_MODULES(cmr dcmsr)
index 7b2536f3dccc5c13bae26e3bd62a9d8ea3b91fd9..8747cee3c4c0ec32a30f8353db1500fc951e3047 100644 (file)
@@ -1,5 +1,5 @@
-cid10013.o: cid10013.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmsr/cmr/cid10013.h ../include/dcmtk/dcmsr/dsrctxgr.h \
+cid100.o: cid100.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmsr/cmr/cid100.h ../include/dcmtk/dcmsr/dsrctxgr.h \
  ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \
  ../include/dcmtk/dcmsr/dsdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -45,6 +45,7 @@ cid10013.o: cid10013.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -52,6 +53,7 @@ cid10013.o: cid10013.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -60,11 +62,9 @@ cid10013.o: cid10013.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
-cid10013e.o: cid10013e.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmsr/cmr/cid10013e.h \
+cid10013.o: cid10013.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/cmr/cid10013.h ../include/dcmtk/dcmsr/dsrctxgr.h \
  ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \
  ../include/dcmtk/dcmsr/dsdefine.h \
@@ -111,6 +111,7 @@ cid10013e.o: cid10013e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -118,6 +119,7 @@ cid10013e.o: cid10013e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -126,11 +128,11 @@ cid10013e.o: cid10013e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
-cid10033.o: cid10033.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmsr/cmr/cid10033.h ../include/dcmtk/dcmsr/dsrctxgr.h \
+cid10013e.o: cid10013e.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmsr/cmr/cid10013e.h \
+ ../include/dcmtk/dcmsr/cmr/cid10013.h ../include/dcmtk/dcmsr/dsrctxgr.h \
  ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \
  ../include/dcmtk/dcmsr/dsdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -176,6 +178,7 @@ cid10033.o: cid10033.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -183,6 +186,7 @@ cid10033.o: cid10033.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -191,11 +195,9 @@ cid10033.o: cid10033.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
-cid10033e.o: cid10033e.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmsr/cmr/cid10033e.h \
+cid10033.o: cid10033.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/cmr/cid10033.h ../include/dcmtk/dcmsr/dsrctxgr.h \
  ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \
  ../include/dcmtk/dcmsr/dsdefine.h \
@@ -242,6 +244,7 @@ cid10033e.o: cid10033e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -249,6 +252,7 @@ cid10033e.o: cid10033e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -257,11 +261,11 @@ cid10033e.o: cid10033e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
-cid100.o: cid100.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmsr/cmr/cid100.h ../include/dcmtk/dcmsr/dsrctxgr.h \
+cid10033e.o: cid10033e.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmsr/cmr/cid10033e.h \
+ ../include/dcmtk/dcmsr/cmr/cid10033.h ../include/dcmtk/dcmsr/dsrctxgr.h \
  ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \
  ../include/dcmtk/dcmsr/dsdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -307,6 +311,7 @@ cid100.o: cid100.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -314,6 +319,7 @@ cid100.o: cid100.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -322,7 +328,6 @@ cid100.o: cid100.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid11.o: cid11.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -372,6 +377,7 @@ cid11.o: cid11.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -379,6 +385,7 @@ cid11.o: cid11.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -387,7 +394,6 @@ cid11.o: cid11.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid244.o: cid244.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -437,6 +443,7 @@ cid244.o: cid244.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -444,6 +451,7 @@ cid244.o: cid244.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -452,7 +460,6 @@ cid244.o: cid244.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid244e.o: cid244e.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -502,6 +509,7 @@ cid244e.o: cid244e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -509,6 +517,7 @@ cid244e.o: cid244e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -517,7 +526,6 @@ cid244e.o: cid244e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid29.o: cid29.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -567,6 +575,7 @@ cid29.o: cid29.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -574,6 +583,7 @@ cid29.o: cid29.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -582,7 +592,6 @@ cid29.o: cid29.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid29e.o: cid29e.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -632,6 +641,7 @@ cid29e.o: cid29e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -639,6 +649,7 @@ cid29e.o: cid29e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -647,7 +658,6 @@ cid29e.o: cid29e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h \
  ../include/dcmtk/dcmsr/codes/dcm.h
@@ -698,6 +708,7 @@ cid4020.o: cid4020.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -705,6 +716,7 @@ cid4020.o: cid4020.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -713,7 +725,6 @@ cid4020.o: cid4020.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid4021.o: cid4021.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -763,6 +774,7 @@ cid4021.o: cid4021.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -770,6 +782,7 @@ cid4021.o: cid4021.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -778,7 +791,6 @@ cid4021.o: cid4021.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid4031.o: cid4031.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -828,6 +840,7 @@ cid4031.o: cid4031.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -835,6 +848,7 @@ cid4031.o: cid4031.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -843,7 +857,6 @@ cid4031.o: cid4031.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid4031e.o: cid4031e.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -894,6 +907,7 @@ cid4031e.o: cid4031e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -901,6 +915,7 @@ cid4031e.o: cid4031e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -909,7 +924,6 @@ cid4031e.o: cid4031e.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid42.o: cid42.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -959,6 +973,7 @@ cid42.o: cid42.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -966,6 +981,7 @@ cid42.o: cid42.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -974,7 +990,6 @@ cid42.o: cid42.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid5000.o: cid5000.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -1024,6 +1039,7 @@ cid5000.o: cid5000.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1031,6 +1047,7 @@ cid5000.o: cid5000.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1039,7 +1056,6 @@ cid5000.o: cid5000.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid5001.o: cid5001.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -1089,6 +1105,7 @@ cid5001.o: cid5001.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1096,6 +1113,7 @@ cid5001.o: cid5001.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1104,7 +1122,6 @@ cid5001.o: cid5001.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid6147.o: cid6147.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -1154,6 +1171,7 @@ cid6147.o: cid6147.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1161,6 +1179,7 @@ cid6147.o: cid6147.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1169,7 +1188,6 @@ cid6147.o: cid6147.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid7021.o: cid7021.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -1219,6 +1237,7 @@ cid7021.o: cid7021.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1226,6 +1245,7 @@ cid7021.o: cid7021.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1234,7 +1254,6 @@ cid7021.o: cid7021.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid7181.o: cid7181.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -1284,6 +1303,7 @@ cid7181.o: cid7181.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1291,6 +1311,7 @@ cid7181.o: cid7181.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1299,7 +1320,6 @@ cid7181.o: cid7181.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid7445.o: cid7445.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -1349,6 +1369,7 @@ cid7445.o: cid7445.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1356,6 +1377,7 @@ cid7445.o: cid7445.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1364,7 +1386,6 @@ cid7445.o: cid7445.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid7452.o: cid7452.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -1414,6 +1435,7 @@ cid7452.o: cid7452.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1421,6 +1443,7 @@ cid7452.o: cid7452.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1429,7 +1452,6 @@ cid7452.o: cid7452.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid7453.o: cid7453.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -1479,6 +1501,7 @@ cid7453.o: cid7453.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1486,6 +1509,7 @@ cid7453.o: cid7453.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1494,7 +1518,6 @@ cid7453.o: cid7453.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid7464.o: cid7464.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -1544,6 +1567,7 @@ cid7464.o: cid7464.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1551,6 +1575,7 @@ cid7464.o: cid7464.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1559,7 +1584,6 @@ cid7464.o: cid7464.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 cid7469.o: cid7469.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -1609,6 +1633,7 @@ cid7469.o: cid7469.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1616,6 +1641,7 @@ cid7469.o: cid7469.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1624,7 +1650,6 @@ cid7469.o: cid7469.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/cmr/define.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h
 init.o: init.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -1675,6 +1700,7 @@ init.o: init.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1682,6 +1708,7 @@ init.o: init.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1690,7 +1717,6 @@ init.o: init.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h \
  ../include/dcmtk/dcmsr/cmr/cid29.h ../include/dcmtk/dcmsr/cmr/cid42.h \
  ../include/dcmtk/dcmsr/cmr/cid100.h ../include/dcmtk/dcmsr/cmr/cid244.h \
@@ -1745,6 +1771,7 @@ logger.o: logger.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -1754,6 +1781,7 @@ logger.o: logger.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/dcmsr/cmr/define.h
 srnumvl.o: srnumvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/cmr/srnumvl.h ../include/dcmtk/dcmsr/dsrnumvl.h \
@@ -1802,6 +1830,7 @@ srnumvl.o: srnumvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1809,6 +1838,7 @@ srnumvl.o: srnumvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1817,7 +1847,6 @@ srnumvl.o: srnumvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \
@@ -1872,6 +1901,7 @@ tid1001.o: tid1001.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1879,6 +1909,7 @@ tid1001.o: tid1001.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1891,7 +1922,6 @@ tid1001.o: tid1001.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -1963,6 +1993,7 @@ tid1204.o: tid1204.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1970,6 +2001,7 @@ tid1204.o: tid1204.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1982,7 +2014,6 @@ tid1204.o: tid1204.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -2053,6 +2084,7 @@ tid1411.o: tid1411.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2060,6 +2092,7 @@ tid1411.o: tid1411.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2072,7 +2105,6 @@ tid1411.o: tid1411.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -2096,6 +2128,7 @@ tid1411.o: tid1411.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrctxgr.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h \
  ../include/dcmtk/dcmsr/cmr/tid1419m.h \
+ ../include/dcmtk/dcmsr/cmr/tid4019.h \
  ../include/dcmtk/dcmsr/cmr/cid244e.h ../include/dcmtk/dcmsr/cmr/cid244.h \
  ../include/dcmtk/dcmsr/cmr/cid6147.h \
  ../include/dcmtk/dcmsr/cmr/cid7181.h \
@@ -2155,6 +2188,7 @@ tid1419m.o: tid1419m.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2162,6 +2196,7 @@ tid1419m.o: tid1419m.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2174,7 +2209,6 @@ tid1419m.o: tid1419m.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -2197,6 +2231,7 @@ tid1419m.o: tid1419m.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/cmr/srnumvl.h ../include/dcmtk/dcmsr/cmr/cid42.h \
  ../include/dcmtk/dcmsr/dsrctxgr.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h \
+ ../include/dcmtk/dcmsr/cmr/tid4019.h \
  ../include/dcmtk/dcmsr/cmr/cid244e.h ../include/dcmtk/dcmsr/cmr/cid244.h \
  ../include/dcmtk/dcmsr/cmr/tid15def.h \
  ../include/dcmtk/dcmsr/cmr/cid6147.h \
@@ -2254,6 +2289,7 @@ tid1500.o: tid1500.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2261,6 +2297,7 @@ tid1500.o: tid1500.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2273,7 +2310,6 @@ tid1500.o: tid1500.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -2304,6 +2340,7 @@ tid1500.o: tid1500.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/cmr/srnumvlu.h \
  ../include/dcmtk/dcmsr/cmr/srnumvl.h ../include/dcmtk/dcmsr/cmr/cid42.h \
  ../include/dcmtk/dcmsr/cmr/tid1419m.h \
+ ../include/dcmtk/dcmsr/cmr/tid4019.h \
  ../include/dcmtk/dcmsr/cmr/cid244e.h ../include/dcmtk/dcmsr/cmr/cid244.h \
  ../include/dcmtk/dcmsr/cmr/cid6147.h \
  ../include/dcmtk/dcmsr/cmr/cid7181.h \
@@ -2366,6 +2403,7 @@ tid1501.o: tid1501.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2373,6 +2411,7 @@ tid1501.o: tid1501.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2385,7 +2424,6 @@ tid1501.o: tid1501.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -2479,6 +2517,7 @@ tid1600.o: tid1600.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2486,6 +2525,7 @@ tid1600.o: tid1600.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2498,7 +2538,6 @@ tid1600.o: tid1600.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -2582,6 +2621,7 @@ tid300.o: tid300.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2589,6 +2629,7 @@ tid300.o: tid300.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2601,7 +2642,6 @@ tid300.o: tid300.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -2633,3 +2673,91 @@ tid300.o: tid300.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/codes/dcm.h ../include/dcmtk/dcmsr/codes/srt.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h
+tid4019.o: tid4019.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmsr/cmr/tid4019.h ../include/dcmtk/dcmsr/dsrstpl.h \
+ ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \
+ ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtypes.h \
+ ../include/dcmtk/dcmsr/dsdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcxfer.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
+ ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \
+ ../include/dcmtk/dcmsr/dsrtnant.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstack.h \
+ ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
+ ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdate.h \
+ ../../ofstd/include/dcmtk/ofstd/oftime.h \
+ ../include/dcmtk/dcmsr/dsritcsr.h ../include/dcmtk/dcmsr/dsrcitem.h \
+ ../include/dcmtk/dcmsr/dsrnumvl.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \
+ ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \
+ ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrsc3vl.h \
+ ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtcovl.h \
+ ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtcosp.h \
+ ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrcomvl.h \
+ ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \
+ ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrwavvl.h \
+ ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrctpl.h \
+ ../include/dcmtk/dcmsr/cmr/define.h ../include/dcmtk/dcmsr/codes/dcm.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcuid.h
index 213c14d9a7486f1728e37f0dc72f4042fa79083c..ce7497a11354013f0485dc118ba7bd1fd4f4d639 100644 (file)
@@ -22,7 +22,7 @@ LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/incl
 LOCALDEFS =
 
 objs = init.o logger.o srnumvl.o tid300.o tid1001.o tid1204.o tid1411.o tid1419m.o \
-       tid1500.o tid1501.o tid15def.o tid1600.o \
+       tid1500.o tid1501.o tid15def.o tid1600.o tid4019.o \
        cid11.o cid29.o cid29e.o cid42.o cid100.o cid244.o cid244e.o cid4020.o \
        cid4021.o cid4031.o cid4031e.o cid5000.o cid5001.o cid6147.o cid7021.o \
        cid7181.o cid7445.o cid7452.o cid7453.o cid7464.o cid7469.o cid10013.o \
index bdd9345cc087e7a1212baecffee74ea3f607e639..6e58a1c7a014265c0ee4088a37fd98eb194a8da7 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID100_QuantitativeDiagnosticImagingProcedures
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:43 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:12 by J. Riesmeier
  *
  */
 
index 60eee4a796f6867b9ede6969bde270e1a3475b53..56a814a47071d7e7f512a370d4c2a7df7224e561 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID10013_CTAcquisitionType
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:18:05 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:35 by J. Riesmeier
  *
  */
 
index 56c5c95972e1d19ceb4ea11d212d6f89f242f566..5f611b6aa75c975cb17a1620db52a640fff4706d 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID10033_CTReconstructionAlgorithm
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:18:07 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:37 by J. Riesmeier
  *
  */
 
index 66062d1ff8f84f7fc0389433ab75fff7d97872e0..e42a5789a1b2b6e899e506bad1308edc45113ca1 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID11_RouteOfAdministration
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:38 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:07 by J. Riesmeier
  *
  */
 
index 151ef358ad90ce083add89b0a397e12a7266a288..d829351bc0c541e497a611702f6a377073a9d17a 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID244_Laterality
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:44 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:14 by J. Riesmeier
  *
  */
 
index 2494ad488c3715740f118ed5403dd7b4eb36506c..8cc9b3ff20ad794efd6eb4aa6307577003091dfc 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID29_AcquisitionModality
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:39 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:09 by J. Riesmeier
  *
  */
 
@@ -18,7 +18,7 @@
 
 // general information on CID 29 (Acquisition Modality)
 #define CONTEXT_GROUP_NUMBER  "29"
-#define CONTEXT_GROUP_VERSION "20121129"
+#define CONTEXT_GROUP_VERSION "20180605"
 #define CONTEXT_GROUP_UID     "1.2.840.10008.6.1.19"
 #define CONTEXT_GROUP_TYPE    OFTrue  /* extensible */
 
@@ -175,6 +175,8 @@ CID29_AcquisitionModality::CodeList &CID29_AcquisitionModality::getCodes()
         Codes->insert(OFMake_pair(OphthalmicPhotography, DSRBasicCodedEntry("OP", "DCM", "Ophthalmic Photography")));
         Codes->insert(OFMake_pair(OphthalmicRefraction, DSRBasicCodedEntry("OPR", "DCM", "Ophthalmic Refraction")));
         Codes->insert(OFMake_pair(OphthalmicTomography, DSRBasicCodedEntry("OPT", "DCM", "Ophthalmic Tomography")));
+        Codes->insert(OFMake_pair(OphthalmicTomographyBScanVolumeAnalysis, DSRBasicCodedEntry("OPTBSV", "DCM", "Ophthalmic Tomography B-scan Volume Analysis")));
+        Codes->insert(OFMake_pair(OphthalmicTomographyEnFace, DSRBasicCodedEntry("OPTENF", "DCM", "Ophthalmic Tomography En Face")));
         Codes->insert(OFMake_pair(OphthalmicVisualField, DSRBasicCodedEntry("OPV", "DCM", "Ophthalmic Visual Field")));
         Codes->insert(OFMake_pair(OpticalSurfaceScanner, DSRBasicCodedEntry("OSS", "DCM", "Optical Surface Scanner")));
         Codes->insert(OFMake_pair(PanoramicXRay, DSRBasicCodedEntry("PX", "DCM", "Panoramic X-Ray")));
index da4338bd63979d8eb36b5e3cd93e90875d201716..49071f299a1ca5c078001930489d5a4a1b7af5d3 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID4020_PETRadionuclide
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:46 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:15 by J. Riesmeier
  *
  */
 
index e3ac7e8214f6f9251440be1f66b5222245b87080..f51cc05b642e4cb3c8697c2241aa934b8b0aff20 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID4021_PETRadiopharmaceutical
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:48 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:17 by J. Riesmeier
  *
  */
 
@@ -18,7 +18,7 @@
 
 // general information on CID 4021 (PET Radiopharmaceutical)
 #define CONTEXT_GROUP_NUMBER  "4021"
-#define CONTEXT_GROUP_VERSION "20170413"
+#define CONTEXT_GROUP_VERSION "20180327"
 #define CONTEXT_GROUP_UID     "1.2.840.10008.6.1.305"
 #define CONTEXT_GROUP_TYPE    OFTrue  /* extensible */
 
@@ -263,6 +263,8 @@ CID4021_PETRadiopharmaceutical::CodeList &CID4021_PETRadiopharmaceutical::getCod
         Codes->insert(OFMake_pair(Tyrosine3Octreotate_Ga68, DSRBasicCodedEntry("C1742831", "UMLS", "tyrosine-3-octreotate Ga^68^")));
         Codes->insert(OFMake_pair(Ublituximab_89Zr, DSRBasicCodedEntry("126739", "DCM", "Ublituximab ^89^Zr")));
         Codes->insert(OFMake_pair(XmAb5574_89Zr, DSRBasicCodedEntry("126734", "DCM", "XmAb5574 ^89^Zr")));
+        Codes->insert(OFMake_pair(PSMA_Ga68, DSRBasicCodedEntry("C118961", "NCIt", "PSMA Ga^68^")));
+        Codes->insert(OFMake_pair(Sarcosine_C11, DSRBasicCodedEntry("C122684", "NCIt", "Sarcosine C^11^")));
     }
     /* should never be NULL */
     return *Codes;
index 7394c826f5d2f60323c01ba03e1d35026b786536..4d038f48cf2c55474c6e1a0f1dcb35d5348a2643 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID4031_CommonAnatomicRegions
  *
- *  Generated automatically from DICOM PS 3.16-2017d
- *  File created on 2017-09-26 12:18:52 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:19 by J. Riesmeier
  *
  */
 
index ca20c23a508fed95e9b646015b08ada623bc8357..6896f7f1f278eaf36221062668ec5294353f07ba 100644 (file)
@@ -30,7 +30,7 @@ struct DefinedTermTypeMapStruct
  *  constant definitions  *
  *------------------------*/
 
-// mapping extracted from DICOM PS 3.16-2017e Table L-1
+// mapping extracted from DICOM PS 3.16-2018a Table L-1
 
 static const DefinedTermTypeMapStruct DefinedTermTypeMap[] =
 {
@@ -58,6 +58,7 @@ static const DefinedTermTypeMapStruct DefinedTermTypeMap[] =
     {"EXTREMITY",        CID4031_CommonAnatomicRegions::Extremity},
     {"EYE",              CID4031_CommonAnatomicRegions::Eye},
     {"FEMUR",            CID4031_CommonAnatomicRegions::Femur},
+    {"FIBULA",           CID4031_CommonAnatomicRegions::Fibula},
     {"FINGER",           CID4031_CommonAnatomicRegions::Finger},
     {"FOOT",             CID4031_CommonAnatomicRegions::Foot},
     {"FOREARM",          CID4031_CommonAnatomicRegions::Forearm},
index 3437d8d2dae211a9c3c7a7b090253bc3c79467df..b943f33db62bd2804065a4274e6bcf6e66a18fe5 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID42_NumericValueQualifier
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:41 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:10 by J. Riesmeier
  *
  */
 
index 2fb2b12bb66871c6fc28e8b53df11091e234085c..7b1551b6cd843ff9efe86e24c337e81bd528746d 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID6147_ResponseCriteria
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:51 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:21 by J. Riesmeier
  *
  */
 
index 99f2d8ec375a6c794649266bf5692e7f0031a5d2..13379edcba2cfa47a86ca10e201c8dcdff3c796a 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID7021_MeasurementReportDocumentTitles
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:53 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:22 by J. Riesmeier
  *
  */
 
index cf3898fb2a07379fd931f3cb0d49ca3c2dbb9845..f7607799f5a3b021510e5eece9b25f222c94fa58 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID7181_AbstractMultiDimensionalImageModelComponentUnits
  *
- *  Generated automatically from DICOM PS 3.16-2017d
- *  File created on 2017-09-26 12:18:58 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:24 by J. Riesmeier
  *
  */
 
@@ -18,7 +18,7 @@
 
 // general information on CID 7181 (Abstract Multi-dimensional Image Model Component Units)
 #define CONTEXT_GROUP_NUMBER  "7181"
-#define CONTEXT_GROUP_VERSION "20170413"
+#define CONTEXT_GROUP_VERSION "20180605"
 #define CONTEXT_GROUP_UID     "1.2.840.10008.6.1.918"
 #define CONTEXT_GROUP_TYPE    OFTrue  /* extensible */
 
@@ -190,6 +190,8 @@ CID7181_AbstractMultiDimensionalImageModelComponentUnits::CodeList &CID7181_Abst
         Codes->insert(OFMake_pair(Um2PerMs, DSRBasicCodedEntry("um2/ms", "UCUM", "um2/ms")));
         Codes->insert(OFMake_pair(Um2PerS, DSRBasicCodedEntry("um2/s", "UCUM", "um2/s")));
         Codes->insert(OFMake_pair(_106mm2PerS, DSRBasicCodedEntry("10-6.mm2/s", "UCUM", "10-6.mm2/s")));
+        Codes->insert(OFMake_pair(Gy, DSRBasicCodedEntry("Gy", "UCUM", "Gy")));
+        Codes->insert(OFMake_pair(Sv, DSRBasicCodedEntry("Sv", "UCUM", "Sv")));
         Codes->insert(OFMake_pair(NoUnits, DSRBasicCodedEntry("1", "UCUM", "no units")));
         Codes->insert(OFMake_pair(Ratio, DSRBasicCodedEntry("{ratio}", "UCUM", "ratio")));
         Codes->insert(OFMake_pair(HounsfieldUnit, DSRBasicCodedEntry("[hnsf'U]", "UCUM", "Hounsfield Unit")));
index a116baf2c3bf90eeff77d097dfc88d2d26af01e5..a356a4497383f0c8dc38095506517a957f90b4cf 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID7445_DeviceParticipatingRoles
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:57 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:26 by J. Riesmeier
  *
  */
 
index d9a1bb10a69dc2a98354f0b3127ccd18b6184745..2a0aec2f7f8109a284f508df76e7144735d9f575 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID7452_OrganizationalRoles
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:17:58 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:28 by J. Riesmeier
  *
  */
 
index c53600227d46341e4812386ef8a6f4d969742c8b..1e41fcddd544811656ff9b9b9b3fbd5d837569de 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID7453_PerformingRoles
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:18:00 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:29 by J. Riesmeier
  *
  */
 
@@ -18,7 +18,7 @@
 
 // general information on CID 7453 (Performing Roles)
 #define CONTEXT_GROUP_NUMBER  "7453"
-#define CONTEXT_GROUP_VERSION "20141110"
+#define CONTEXT_GROUP_VERSION "20180326"
 #define CONTEXT_GROUP_UID     "1.2.840.10008.6.1.517"
 #define CONTEXT_GROUP_TYPE    OFTrue  /* extensible */
 
@@ -159,6 +159,13 @@ CID7453_PerformingRoles::CodeList &CID7453_PerformingRoles::getCodes()
         Codes->insert(OFMake_pair(Standby, DSRBasicCodedEntry("121101", "DCM", "Standby")));
         Codes->insert(OFMake_pair(IrradiationAuthorizing, DSRBasicCodedEntry("113850", "DCM", "Irradiation Authorizing")));
         Codes->insert(OFMake_pair(IrradiationAdministering, DSRBasicCodedEntry("113851", "DCM", "Irradiation Administering")));
+        Codes->insert(OFMake_pair(Reader, DSRBasicCodedEntry("C28747", "NCIt", "Reader")));
+        Codes->insert(OFMake_pair(EligibilityReader, DSRBasicCodedEntry("129001", "DCM", "Eligibility Reader")));
+        Codes->insert(OFMake_pair(Adjudicator, DSRBasicCodedEntry("C96561", "NCIt", "Adjudicator")));
+        Codes->insert(OFMake_pair(Reviewer, DSRBasicCodedEntry("C54634", "NCIt", "Reviewer")));
+        Codes->insert(OFMake_pair(Designator, DSRBasicCodedEntry("129002", "DCM", "Designator")));
+        Codes->insert(OFMake_pair(ImageQualityController, DSRBasicCodedEntry("129003", "DCM", "Image Quality Controller")));
+        Codes->insert(OFMake_pair(ResultsQualityController, DSRBasicCodedEntry("129004", "DCM", "Results Quality Controller")));
     }
     /* should never be NULL */
     return *Codes;
index 8f9449605c6699b3c40c59468dd786d1d8cfca43..d39d1b54df92a79bb1c7cd0b1e4f24ecd63b04b4 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID7464_GeneralRegionOfInterestMeasurementModifiers
  *
- *  Generated automatically from DICOM PS 3.16-2017c
- *  File created on 2017-07-17 14:18:02 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:31 by J. Riesmeier
  *
  */
 
index 20c8234a7ba20283f51fe8536c7d687dbe2358ac..d8eba1e8c417c380a04feb5acc3122b21a4893c1 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class CID7469_GenericIntensityAndSizeMeasurements
  *
- *  Generated automatically from DICOM PS 3.16-2017d
- *  File created on 2017-09-26 12:19:07 by J. Riesmeier
+ *  Generated automatically from DICOM PS 3.16-2018d
+ *  File created on 2018-09-27 16:57:33 by J. Riesmeier
  *
  */
 
@@ -292,6 +292,16 @@ CID7469_GenericIntensityAndSizeMeasurements::CodeList &CID7469_GenericIntensityA
         Codes->insert(OFMake_pair(SUVibw, DSRBasicCodedEntry("126404", "DCM", "SUVibw")));
         Codes->insert(OFMake_pair(AbsorbedDose, DSRBasicCodedEntry("128513", "DCM", "Absorbed Dose")));
         Codes->insert(OFMake_pair(EquivalentDose, DSRBasicCodedEntry("128512", "DCM", "Equivalent Dose")));
+        Codes->insert(OFMake_pair(Fat, DSRBasicCodedEntry("T-D008A", "SRT", "Fat")));
+        Codes->insert(OFMake_pair(FatFraction, DSRBasicCodedEntry("129100", "DCM", "Fat fraction")));
+        Codes->insert(OFMake_pair(WaterPerFatInPhase, DSRBasicCodedEntry("129101", "DCM", "Water/fat in phase")));
+        Codes->insert(OFMake_pair(WaterPerFatOutOfPhase, DSRBasicCodedEntry("129102", "DCM", "Water/fat out of phase")));
+        Codes->insert(OFMake_pair(NegativeEnhancementIntegral, DSRBasicCodedEntry("113054", "DCM", "Negative enhancement integral")));
+        Codes->insert(OFMake_pair(SignalChange, DSRBasicCodedEntry("113059", "DCM", "Signal change")));
+        Codes->insert(OFMake_pair(SignalToNoise, DSRBasicCodedEntry("113060", "DCM", "Signal to noise")));
+        Codes->insert(OFMake_pair(TimeCourseOfSignal, DSRBasicCodedEntry("113066", "DCM", "Time course of signal")));
+        Codes->insert(OFMake_pair(Water, DSRBasicCodedEntry("C-10120", "SRT", "Water")));
+        Codes->insert(OFMake_pair(WaterFraction, DSRBasicCodedEntry("129103", "DCM", "Water fraction")));
         Codes->insert(OFMake_pair(Length, DSRBasicCodedEntry("G-D7FE", "SRT", "Length")));
         Codes->insert(OFMake_pair(PathLength, DSRBasicCodedEntry("121211", "DCM", "Path length")));
         Codes->insert(OFMake_pair(Distance, DSRBasicCodedEntry("121206", "DCM", "Distance")));
index 6789558d13d05ba1305dda35568ce43ba1293b3b..cb7fb8307ffbd611d3e0582fce1489628a1c43d3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2017-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class TID1419_ROIMeasurements_Measurement
@@ -41,7 +41,8 @@
 #define LAST_DERIVATION_PARAMETER 5
 #define EQUIVALENT_MEANING        6
 #define REAL_WORLD_VALUE_MAP      7
-#define NUMBER_OF_LIST_ENTRIES    8
+#define ALGORITHM_IDENTIFICATION  8
+#define NUMBER_OF_LIST_ENTRIES    9
 
 // general information on TID 1419 (ROI Measurements)
 #define TEMPLATE_NUMBER      "1419"
@@ -53,7 +54,8 @@
 
 template<typename T_Measurement, typename T2, typename T3, typename T4>
 TID1419_ROIMeasurements_Measurement<T_Measurement, T2, T3, T4>::TID1419_ROIMeasurements_Measurement()
-  : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID)
+  : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID),
+    AlgorithmIdentification(new TID4019_AlgorithmIdentification())
 {
     setExtensible(TEMPLATE_TYPE);
     setOrderSignificant(TEMPLATE_ORDER);
@@ -66,7 +68,8 @@ template<typename T_Measurement, typename T2, typename T3, typename T4>
 TID1419_ROIMeasurements_Measurement<T_Measurement, T2, T3, T4>::TID1419_ROIMeasurements_Measurement(const T_Measurement &conceptName,
                                                                                                     const MeasurementValue &numericValue,
                                                                                                     const OFBool check)
-  : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID)
+  : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID),
+    AlgorithmIdentification(new TID4019_AlgorithmIdentification())
 {
     setExtensible(TEMPLATE_TYPE);
     setOrderSignificant(TEMPLATE_ORDER);
@@ -81,6 +84,7 @@ template<typename T1, typename T2, typename T3, typename T4>
 void TID1419_ROIMeasurements_Measurement<T1, T2, T3, T4>::clear()
 {
     DSRSubTemplate::clear();
+    AlgorithmIdentification->clear();
 }
 
 
@@ -208,7 +212,7 @@ OFCondition TID1419_ROIMeasurements_Measurement<T1, T2, T3, T4>::addFindingSite(
             if (subTree != NULL)
             {
                 /* TID 1419 (ROI Measurements) Row 9 */
-                CHECK_RESULT(subTree->addContentItem(RT_hasConceptMod, VT_Code, CODE_SRT_FindingSite, check));
+                STORE_RESULT(subTree->addContentItem(RT_hasConceptMod, VT_Code, CODE_SRT_FindingSite, check));
                 CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(site, check));
                 CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 1419 - Row 9"));
                 const size_t lastNode = subTree->getNodeID();
@@ -357,6 +361,28 @@ OFCondition TID1419_ROIMeasurements_Measurement<T_Measurement, T2, T3, T4>::setR
 }
 
 
+template<typename T_Measurement, typename T2, typename T3, typename T4>
+OFCondition TID1419_ROIMeasurements_Measurement<T_Measurement, T2, T3, T4>::setAlgorithmIdentification(const OFString &algorithmName,
+                                                                                                       const OFString &algorithmVersion,
+                                                                                                       const OFBool check)
+{
+    OFCondition result = EC_Normal;
+    /* basic check of parameters */
+    if (!algorithmName.empty() && !algorithmVersion.empty())
+    {
+        /* check whether measurement exists */
+        if (hasMeasurement())
+        {
+            /* TID 1419 (ROI Measurements) Row 20 */
+            result = getAlgorithmIdentification().setIdentification(algorithmName, algorithmVersion, check);
+        } else
+            result = CMR_EC_NoMeasurement;
+    } else
+        result = EC_IllegalParameter;
+    return result;
+}
+
+
 // protected methods
 
 template<typename T_Measurement, typename T2, typename T3, typename T4>
@@ -376,6 +402,10 @@ OFCondition TID1419_ROIMeasurements_Measurement<T_Measurement, T2, T3, T4>::crea
             CHECK_RESULT(getCurrentContentItem().setNumericValue(numericValue, check));
             CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1419 - Row 5"));
             GOOD_RESULT(storeEntryInNodeList(MEASUREMENT, getNodeID()));
+            /* TID 1419 (ROI Measurements) Row 20 */
+            CHECK_RESULT(includeTemplate(AlgorithmIdentification, AM_belowCurrent, RT_hasConceptMod));
+            CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 1419 - Row 20"));
+            GOOD_RESULT(storeEntryInNodeList(ALGORITHM_IDENTIFICATION, getNodeID()));
         } else
             result = SR_EC_InvalidTemplateStructure;
     }
index 58a059ff9212d2faa533f92572726df65c94fb1a..19c86677a49771dc28901ec719c1cdba29812fb5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class TID1600_ImageLibrary
@@ -668,7 +668,12 @@ OFCondition TID1600_ImageLibrary::addProjectionRadiographyDescriptors(DSRDocumen
             if (dataset.findAndGetSequenceItem(DCM_ViewCodeSequence, item, 0 /*itemNum*/).good())
             {
                 DcmSequenceOfItems *sequence = NULL;
-                if (item->findAndGetSequence(DCM_ViewModifierCodeSequence, sequence).good())
+                if (item->findAndGetSequence(DCM_ViewModifierCodeSequence, sequence).good()
+#ifdef __SUNPRO_CC
+                    /* unfortunately required to keep SunPro Studio 12.x quiet */
+                    && (sequence != NULL)
+#endif
+                   )
                 {
                     /* iterate over all sequence items */
                     DcmObject *object = NULL;
index bdf2b2f9edc1264bce646461ae4fed1973401c8c..8e7859eb780a4af16d4f9aa443b02b7a6e1c831c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2017-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  Source file for class TID300_Measurement
@@ -209,7 +209,7 @@ OFCondition TID300_Measurement<T1, T2, T3, T4>::addFindingSite(const DSRCodedEnt
             if (subTree != NULL)
             {
                 /* TID 300 (Measurement) Row 5 */
-                CHECK_RESULT(subTree->addContentItem(RT_hasConceptMod, VT_Code, CODE_SRT_FindingSite, check));
+                STORE_RESULT(subTree->addContentItem(RT_hasConceptMod, VT_Code, CODE_SRT_FindingSite, check));
                 CHECK_RESULT(subTree->getCurrentContentItem().setCodeValue(site, check));
                 CHECK_RESULT(subTree->getCurrentContentItem().setAnnotationText("TID 300 - Row 5"));
                 const size_t lastNode = subTree->getNodeID();
diff --git a/dcmsr/libcmr/tid4019.cc b/dcmsr/libcmr/tid4019.cc
new file mode 100644 (file)
index 0000000..1bbc0f0
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ *
+ *  Copyright (C) 2018, J. Riesmeier, Oldenburg, Germany
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  Source file for class TID4019_AlgorithmIdentification
+ *
+ *  Author: Joerg Riesmeier
+ *
+ */
+
+
+#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
+
+#include "dcmtk/dcmsr/cmr/tid4019.h"
+#include "dcmtk/dcmsr/codes/dcm.h"
+
+#include "dcmtk/dcmdata/dcuid.h"
+
+
+// helper macros for checking the return value of API calls
+#define CHECK_RESULT(call) if (result.good()) result = call
+#define STORE_RESULT(call) result = call
+#define GOOD_RESULT(call) if (result.good()) call
+#define BAD_RESULT(call) if (result.bad()) call
+
+// general information on TID 4019 (Algorithm Identification)
+#define TEMPLATE_NUMBER      "4019"
+#define MAPPING_RESOURCE     "DCMR"
+#define MAPPING_RESOURCE_UID UID_DICOMContentMappingResource
+#define TEMPLATE_TYPE        OFFalse  /* non-extensible */
+#define TEMPLATE_ORDER       OFTrue   /* significant */
+
+
+TID4019_AlgorithmIdentification::TID4019_AlgorithmIdentification()
+  : DSRSubTemplate(TEMPLATE_NUMBER, MAPPING_RESOURCE, MAPPING_RESOURCE_UID)
+{
+    setExtensible(TEMPLATE_TYPE);
+    setOrderSignificant(TEMPLATE_ORDER);
+}
+
+
+OFCondition TID4019_AlgorithmIdentification::setIdentification(const OFString &algorithmName,
+                                                               const OFString &algorithmVersion,
+                                                               const OFBool check)
+{
+    OFCondition result = EC_Normal;
+    /* create a new subtree in order to "rollback" in case of error */
+    DSRDocumentSubTree subTree;
+    /* TID 4019 (Algorithm Identification) Row 1 */
+    STORE_RESULT(subTree.addContentItem(RT_unknown, VT_Text, CODE_DCM_AlgorithmName, check));
+    CHECK_RESULT(subTree.getCurrentContentItem().setStringValue(algorithmName, check));
+    CHECK_RESULT(subTree.getCurrentContentItem().setAnnotationText("TID 4019 - Row 1"));
+    /* TID 4019 (Algorithm Identification) Row 2 */
+    CHECK_RESULT(subTree.addContentItem(RT_unknown, VT_Text, CODE_DCM_AlgorithmVersion, check));
+    CHECK_RESULT(subTree.getCurrentContentItem().setStringValue(algorithmVersion, check));
+    CHECK_RESULT(subTree.getCurrentContentItem().setAnnotationText("TID 4019 - Row 2"));
+    /* if everything was OK, replace current subtree of the template */
+    GOOD_RESULT(swap(subTree));
+    return result;
+}
+
+
+OFCondition TID4019_AlgorithmIdentification::addParameter(const OFString &algorithmParameter,
+                                                          const OFBool check)
+{
+    OFCondition result = SR_EC_InvalidTemplateStructure;
+    /* check whether mandatory content items exist, i.e. the tree is not empty */
+    if (!isEmpty())
+    {
+        /* TID 4019 (Algorithm Identification) Row 3 */
+        STORE_RESULT(addContentItem(RT_unknown, VT_Text, CODE_DCM_AlgorithmParameters, check));
+        CHECK_RESULT(getCurrentContentItem().setStringValue(algorithmParameter, check));
+        CHECK_RESULT(getCurrentContentItem().setAnnotationText("TID 4019 - Row 3"));
+    }
+    return result;
+}
index de51c80c2ca3188fba676dd58c25c06fa273e765..ce4f59c1f96dbc404a55ae6b59e10d3d491a9770 100644 (file)
@@ -44,6 +44,7 @@ dsracqcc.o: dsracqcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -51,6 +52,7 @@ dsracqcc.o: dsracqcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -105,6 +107,7 @@ dsrbascc.o: dsrbascc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -112,6 +115,7 @@ dsrbascc.o: dsrbascc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -166,6 +170,7 @@ dsrc3dcc.o: dsrc3dcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -173,6 +178,7 @@ dsrc3dcc.o: dsrc3dcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -227,6 +233,7 @@ dsrchecc.o: dsrchecc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -234,6 +241,7 @@ dsrchecc.o: dsrchecc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -288,6 +296,7 @@ dsrcitem.o: dsrcitem.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -295,6 +304,7 @@ dsrcitem.o: dsrcitem.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -307,9 +317,7 @@ dsrcitem.o: dsrcitem.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrnumvl.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrnumvl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \
@@ -374,6 +382,7 @@ dsrcodtn.o: dsrcodtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -381,6 +390,7 @@ dsrcodtn.o: dsrcodtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -393,9 +403,8 @@ dsrcodtn.o: dsrcodtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
+ ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h
 dsrcodvl.o: dsrcodvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \
@@ -442,6 +451,7 @@ dsrcodvl.o: dsrcodvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -449,6 +459,7 @@ dsrcodvl.o: dsrcodvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -457,9 +468,8 @@ dsrcodvl.o: dsrcodvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
+ ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrcs.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \
@@ -519,6 +529,7 @@ dsrcolcc.o: dsrcolcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -526,6 +537,7 @@ dsrcolcc.o: dsrcolcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -580,6 +592,7 @@ dsrcomcc.o: dsrcomcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -587,6 +600,7 @@ dsrcomcc.o: dsrcomcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -640,6 +654,7 @@ dsrcomtn.o: dsrcomtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -647,6 +662,7 @@ dsrcomtn.o: dsrcomtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -659,10 +675,8 @@ dsrcomtn.o: dsrcomtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrcomvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
- ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrcomvl.h \
+ ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h
 dsrcomvl.o: dsrcomvl.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -710,6 +724,7 @@ dsrcomvl.o: dsrcomvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -717,6 +732,7 @@ dsrcomvl.o: dsrcomvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -776,6 +792,7 @@ dsrcontn.o: dsrcontn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -783,6 +800,7 @@ dsrcontn.o: dsrcontn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -795,9 +813,8 @@ dsrcontn.o: dsrcontn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
+ ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h
 dsrcsidl.o: dsrcsidl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrcsidl.h ../include/dcmtk/dcmsr/dsrtypes.h \
@@ -845,6 +862,7 @@ dsrcsidl.o: dsrcsidl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -852,6 +870,7 @@ dsrcsidl.o: dsrcsidl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -916,6 +935,7 @@ dsrctpl.o: dsrctpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -923,6 +943,7 @@ dsrctpl.o: dsrctpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -935,9 +956,8 @@ dsrctpl.o: dsrctpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrdncsr.h \
+ ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
  ../../ofstd/include/dcmtk/ofstd/oftime.h \
@@ -1003,6 +1023,7 @@ dsrctxgr.o: dsrctxgr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1010,6 +1031,7 @@ dsrctxgr.o: dsrctxgr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1017,8 +1039,7 @@ dsrctxgr.o: dsrctxgr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h
+ ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h
 dsrdattn.o: dsrdattn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
@@ -1064,6 +1085,7 @@ dsrdattn.o: dsrdattn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1071,6 +1093,7 @@ dsrdattn.o: dsrdattn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1083,10 +1106,8 @@ dsrdattn.o: dsrdattn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
- ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrstrvl.h \
+ ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \
@@ -1137,6 +1158,7 @@ dsrdncsr.o: dsrdncsr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1144,6 +1166,7 @@ dsrdncsr.o: dsrdncsr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1155,7 +1178,6 @@ dsrdncsr.o: dsrdncsr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdnflt.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
  ../../ofstd/include/dcmtk/ofstd/oftime.h \
@@ -1206,6 +1228,7 @@ dsrdnflt.o: dsrdnflt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1213,6 +1236,7 @@ dsrdnflt.o: dsrdnflt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1221,7 +1245,6 @@ dsrdnflt.o: dsrdnflt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -1278,6 +1301,7 @@ dsrdoc.o: dsrdoc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1285,6 +1309,7 @@ dsrdoc.o: dsrdoc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1297,7 +1322,6 @@ dsrdoc.o: dsrdoc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -1380,6 +1404,7 @@ dsrdocst.o: dsrdocst.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1387,6 +1412,7 @@ dsrdocst.o: dsrdocst.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1399,7 +1425,6 @@ dsrdocst.o: dsrdocst.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -1419,7 +1444,9 @@ dsrdocst.o: dsrdocst.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrcontn.h \
  ../include/dcmtk/dcmsr/dsrreftn.h ../include/dcmtk/dcmsr/dsrtpltn.h \
  ../include/dcmtk/dcmsr/dsrstpl.h ../include/dcmtk/dcmsr/dsrdoctr.h \
- ../include/dcmtk/dcmsr/dsrctpl.h ../include/dcmtk/dcmsr/dsriodcc.h
+ ../include/dcmtk/dcmsr/dsrctpl.h ../include/dcmtk/dcmsr/dsriodcc.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h
 dsrdoctn.o: dsrdoctn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrtree.h \
  ../include/dcmtk/dcmsr/dsrtypes.h ../include/dcmtk/dcmsr/dsdefine.h \
@@ -1466,6 +1493,7 @@ dsrdoctn.o: dsrdoctn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1473,6 +1501,7 @@ dsrdoctn.o: dsrdoctn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1484,9 +1513,8 @@ dsrdoctn.o: dsrdoctn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtncsr.h ../include/dcmtk/dcmsr/dsrposcn.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrdncsr.h \
+ ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
  ../../ofstd/include/dcmtk/ofstd/oftime.h \
@@ -1547,6 +1575,7 @@ dsrdoctr.o: dsrdoctr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1554,6 +1583,7 @@ dsrdoctr.o: dsrdoctr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1566,7 +1596,6 @@ dsrdoctr.o: dsrdoctr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -1633,6 +1662,7 @@ dsrdtitn.o: dsrdtitn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1640,6 +1670,7 @@ dsrdtitn.o: dsrdtitn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1652,10 +1683,8 @@ dsrdtitn.o: dsrdtitn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
- ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrstrvl.h \
+ ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrdt.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \
@@ -1708,6 +1737,7 @@ dsrenhcc.o: dsrenhcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1715,6 +1745,7 @@ dsrenhcc.o: dsrenhcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1769,6 +1800,7 @@ dsrimgfr.o: dsrimgfr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1776,6 +1808,7 @@ dsrimgfr.o: dsrimgfr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1834,6 +1867,7 @@ dsrimgse.o: dsrimgse.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1841,6 +1875,7 @@ dsrimgse.o: dsrimgse.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1897,6 +1932,7 @@ dsrimgtn.o: dsrimgtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1904,6 +1940,7 @@ dsrimgtn.o: dsrimgtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -1916,12 +1953,10 @@ dsrimgtn.o: dsrimgtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrcomvl.h \
- ../include/dcmtk/dcmsr/dsrimgfr.h ../include/dcmtk/dcmsr/dsrtlist.h \
- ../include/dcmtk/dcmsr/dsrimgse.h ../include/dcmtk/dcmsr/dsrxmld.h \
- ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrimgvl.h \
+ ../include/dcmtk/dcmsr/dsrcomvl.h ../include/dcmtk/dcmsr/dsrimgfr.h \
+ ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrimgse.h \
+ ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h
 dsrimgvl.o: dsrimgvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrimgvl.h ../include/dcmtk/dcmsr/dsrtypes.h \
@@ -1969,6 +2004,7 @@ dsrimgvl.o: dsrimgvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -1976,6 +2012,7 @@ dsrimgvl.o: dsrimgvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2058,6 +2095,7 @@ dsrimpcc.o: dsrimpcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2065,6 +2103,7 @@ dsrimpcc.o: dsrimpcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2119,6 +2158,7 @@ dsriodcc.o: dsriodcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2126,6 +2166,7 @@ dsriodcc.o: dsriodcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2180,6 +2221,7 @@ dsritcsr.o: dsritcsr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2187,6 +2229,7 @@ dsritcsr.o: dsritcsr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2198,11 +2241,10 @@ dsritcsr.o: dsritcsr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrtree.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrtpltn.h ../include/dcmtk/dcmsr/dsrstpl.h \
- ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \
- ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtpltn.h \
+ ../include/dcmtk/dcmsr/dsrstpl.h ../include/dcmtk/dcmsr/dsrdoctr.h \
+ ../include/dcmtk/dcmsr/dsrdocst.h ../include/dcmtk/dcmsr/dsrdncsr.h \
+ ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
  ../../ofstd/include/dcmtk/ofstd/oftime.h \
@@ -2264,6 +2306,7 @@ dsrkeycc.o: dsrkeycc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2271,6 +2314,7 @@ dsrkeycc.o: dsrkeycc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2325,6 +2369,7 @@ dsrmaccc.o: dsrmaccc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2332,6 +2377,7 @@ dsrmaccc.o: dsrmaccc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2386,6 +2432,7 @@ dsrmamcc.o: dsrmamcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2393,6 +2440,7 @@ dsrmamcc.o: dsrmamcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2446,6 +2494,7 @@ dsrnumtn.o: dsrnumtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2453,6 +2502,7 @@ dsrnumtn.o: dsrnumtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2465,9 +2515,7 @@ dsrnumtn.o: dsrnumtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrnumvl.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrnumvl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \
@@ -2517,6 +2565,7 @@ dsrnumvl.o: dsrnumvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2524,6 +2573,7 @@ dsrnumvl.o: dsrnumvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2533,7 +2583,6 @@ dsrnumvl.o: dsrnumvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
  ../include/dcmtk/dcmsr/dsrnumvl.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \
@@ -2586,6 +2635,7 @@ dsrpnmtn.o: dsrpnmtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2593,6 +2643,7 @@ dsrpnmtn.o: dsrpnmtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2605,10 +2656,8 @@ dsrpnmtn.o: dsrpnmtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
- ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrstrvl.h \
+ ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrpn.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \
@@ -2660,12 +2709,14 @@ dsrposcn.o: dsrposcn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2720,6 +2771,7 @@ dsrprdcc.o: dsrprdcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2727,6 +2779,7 @@ dsrprdcc.o: dsrprdcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2781,6 +2834,7 @@ dsrprocc.o: dsrprocc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2788,6 +2842,7 @@ dsrprocc.o: dsrprocc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2842,6 +2897,7 @@ dsrrefin.o: dsrrefin.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2849,6 +2905,7 @@ dsrrefin.o: dsrrefin.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2857,9 +2914,8 @@ dsrrefin.o: dsrrefin.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
+ ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \
@@ -2909,6 +2965,7 @@ dsrreftn.o: dsrreftn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2916,6 +2973,7 @@ dsrreftn.o: dsrreftn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -2928,9 +2986,8 @@ dsrreftn.o: dsrreftn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
+ ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h
 dsrrrdcc.o: dsrrrdcc.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -2979,6 +3036,7 @@ dsrrrdcc.o: dsrrrdcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -2986,6 +3044,7 @@ dsrrrdcc.o: dsrrrdcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3041,6 +3100,7 @@ dsrrtpl.o: dsrrtpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3048,6 +3108,7 @@ dsrrtpl.o: dsrrtpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3060,7 +3121,6 @@ dsrrtpl.o: dsrrtpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -3126,6 +3186,7 @@ dsrsaecc.o: dsrsaecc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3133,6 +3194,7 @@ dsrsaecc.o: dsrsaecc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3187,6 +3249,7 @@ dsrsc3gr.o: dsrsc3gr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3194,6 +3257,7 @@ dsrsc3gr.o: dsrsc3gr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3250,6 +3314,7 @@ dsrsc3tn.o: dsrsc3tn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3257,6 +3322,7 @@ dsrsc3tn.o: dsrsc3tn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3269,11 +3335,9 @@ dsrsc3tn.o: dsrsc3tn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrsc3vl.h ../include/dcmtk/dcmsr/dsrsc3gr.h \
- ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrxmld.h \
- ../include/dcmtk/dcmsr/dsrxmlc.h
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrsc3vl.h \
+ ../include/dcmtk/dcmsr/dsrsc3gr.h ../include/dcmtk/dcmsr/dsrtlist.h \
+ ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h
 dsrsc3vl.o: dsrsc3vl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrsc3vl.h ../include/dcmtk/dcmsr/dsrtypes.h \
  ../include/dcmtk/dcmsr/dsdefine.h \
@@ -3320,6 +3384,7 @@ dsrsc3vl.o: dsrsc3vl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3327,6 +3392,7 @@ dsrsc3vl.o: dsrsc3vl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3386,6 +3452,7 @@ dsrscogr.o: dsrscogr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3393,6 +3460,7 @@ dsrscogr.o: dsrscogr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3449,6 +3517,7 @@ dsrscotn.o: dsrscotn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3456,6 +3525,7 @@ dsrscotn.o: dsrscotn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3468,11 +3538,9 @@ dsrscotn.o: dsrscotn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrscogr.h \
- ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrxmld.h \
- ../include/dcmtk/dcmsr/dsrxmlc.h
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrscovl.h \
+ ../include/dcmtk/dcmsr/dsrscogr.h ../include/dcmtk/dcmsr/dsrtlist.h \
+ ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h
 dsrscovl.o: dsrscovl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrscovl.h ../include/dcmtk/dcmsr/dsrtypes.h \
  ../include/dcmtk/dcmsr/dsdefine.h \
@@ -3519,6 +3587,7 @@ dsrscovl.o: dsrscovl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3526,6 +3595,7 @@ dsrscovl.o: dsrscovl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3585,6 +3655,7 @@ dsrsoprf.o: dsrsoprf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3592,6 +3663,7 @@ dsrsoprf.o: dsrsoprf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3600,9 +3672,8 @@ dsrsoprf.o: dsrsoprf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
+ ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrae.h \
@@ -3657,6 +3728,7 @@ dsrspecc.o: dsrspecc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3664,6 +3736,7 @@ dsrspecc.o: dsrspecc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3719,6 +3792,7 @@ dsrstpl.o: dsrstpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3726,6 +3800,7 @@ dsrstpl.o: dsrstpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3738,7 +3813,6 @@ dsrstpl.o: dsrstpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -3802,6 +3876,7 @@ dsrstrvl.o: dsrstrvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3809,6 +3884,7 @@ dsrstrvl.o: dsrstrvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3864,6 +3940,7 @@ dsrtcodt.o: dsrtcodt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3871,6 +3948,7 @@ dsrtcodt.o: dsrtcodt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3932,6 +4010,7 @@ dsrtcosp.o: dsrtcosp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -3939,6 +4018,7 @@ dsrtcosp.o: dsrtcosp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -3995,6 +4075,7 @@ dsrtcotn.o: dsrtcotn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4002,6 +4083,7 @@ dsrtcotn.o: dsrtcotn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4014,12 +4096,10 @@ dsrtcotn.o: dsrtcotn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrtcovl.h ../include/dcmtk/dcmsr/dsrtcodt.h \
- ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrtcosp.h \
- ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrxmld.h \
- ../include/dcmtk/dcmsr/dsrxmlc.h
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtcovl.h \
+ ../include/dcmtk/dcmsr/dsrtcodt.h ../include/dcmtk/dcmsr/dsrtlist.h \
+ ../include/dcmtk/dcmsr/dsrtcosp.h ../include/dcmtk/dcmsr/dsrtcoto.h \
+ ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h
 dsrtcoto.o: dsrtcoto.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtcoto.h ../include/dcmtk/dcmsr/dsrtypes.h \
  ../include/dcmtk/dcmsr/dsdefine.h \
@@ -4066,6 +4146,7 @@ dsrtcoto.o: dsrtcoto.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4073,6 +4154,7 @@ dsrtcoto.o: dsrtcoto.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4131,6 +4213,7 @@ dsrtcovl.o: dsrtcovl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4138,6 +4221,7 @@ dsrtcovl.o: dsrtcovl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4195,6 +4279,7 @@ dsrtextn.o: dsrtextn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4202,6 +4287,7 @@ dsrtextn.o: dsrtextn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4214,10 +4300,8 @@ dsrtextn.o: dsrtextn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
- ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrstrvl.h \
+ ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrut.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcchrstr.h \
@@ -4267,6 +4351,7 @@ dsrtimtn.o: dsrtimtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4274,6 +4359,7 @@ dsrtimtn.o: dsrtimtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4286,10 +4372,8 @@ dsrtimtn.o: dsrtimtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
- ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrstrvl.h \
+ ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \
@@ -4339,6 +4423,7 @@ dsrtpltn.o: dsrtpltn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4346,6 +4431,7 @@ dsrtpltn.o: dsrtpltn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4358,11 +4444,9 @@ dsrtpltn.o: dsrtpltn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrstpl.h ../include/dcmtk/dcmsr/dsrdoctr.h \
- ../include/dcmtk/dcmsr/dsrdocst.h ../include/dcmtk/dcmsr/dsrdncsr.h \
- ../include/dcmtk/dcmsr/dsrdnflt.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrstpl.h \
+ ../include/dcmtk/dcmsr/dsrdoctr.h ../include/dcmtk/dcmsr/dsrdocst.h \
+ ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
  ../../ofstd/include/dcmtk/ofstd/oftime.h \
@@ -4426,6 +4510,7 @@ dsrtree.o: dsrtree.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4433,6 +4518,7 @@ dsrtree.o: dsrtree.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4489,6 +4575,7 @@ dsrtypes.o: dsrtypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4496,6 +4583,7 @@ dsrtypes.o: dsrtypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4508,10 +4596,9 @@ dsrtypes.o: dsrtypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrcodtn.h \
- ../include/dcmtk/dcmsr/dsrnumtn.h ../include/dcmtk/dcmsr/dsrnumvl.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrstrvl.h \
+ ../include/dcmtk/dcmsr/dsrcodtn.h ../include/dcmtk/dcmsr/dsrnumtn.h \
+ ../include/dcmtk/dcmsr/dsrnumvl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \
@@ -4593,6 +4680,7 @@ dsruidtn.o: dsruidtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4600,6 +4688,7 @@ dsruidtn.o: dsruidtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4612,10 +4701,8 @@ dsruidtn.o: dsruidtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrstrvl.h ../include/dcmtk/dcmsr/dsrxmld.h \
- ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrstrvl.h \
+ ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h
@@ -4665,6 +4752,7 @@ dsrwavch.o: dsrwavch.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4672,6 +4760,7 @@ dsrwavch.o: dsrwavch.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4729,6 +4818,7 @@ dsrwavtn.o: dsrwavtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4736,6 +4826,7 @@ dsrwavtn.o: dsrwavtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4748,11 +4839,10 @@ dsrwavtn.o: dsrwavtn.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtree.h ../include/dcmtk/dcmsr/dsrtncsr.h \
  ../include/dcmtk/dcmsr/dsrposcn.h ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
- ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
- ../include/dcmtk/dcmsr/dsrwavvl.h ../include/dcmtk/dcmsr/dsrcomvl.h \
- ../include/dcmtk/dcmsr/dsrwavch.h ../include/dcmtk/dcmsr/dsrtlist.h \
- ../include/dcmtk/dcmsr/dsrxmld.h ../include/dcmtk/dcmsr/dsrxmlc.h \
+ ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrwavvl.h \
+ ../include/dcmtk/dcmsr/dsrcomvl.h ../include/dcmtk/dcmsr/dsrwavch.h \
+ ../include/dcmtk/dcmsr/dsrtlist.h ../include/dcmtk/dcmsr/dsrxmld.h \
+ ../include/dcmtk/dcmsr/dsrxmlc.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h
 dsrwavvl.o: dsrwavvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrwavvl.h ../include/dcmtk/dcmsr/dsrtypes.h \
@@ -4800,6 +4890,7 @@ dsrwavvl.o: dsrwavvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4807,6 +4898,7 @@ dsrwavvl.o: dsrwavvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4873,6 +4965,7 @@ dsrxmld.o: dsrxmld.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4880,6 +4973,7 @@ dsrxmld.o: dsrxmld.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -4935,6 +5029,7 @@ dsrxrdcc.o: dsrxrdcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -4942,6 +5037,7 @@ dsrxrdcc.o: dsrxrdcc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
index 46adcaef769c18212626ed795db4f6a6fd11f90f..24dbb07daa86d0c94672269f2b54b609088e3cad 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -56,7 +56,7 @@ OFBool DSRCodeTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRCodedEntryValue::operator==(*OFstatic_cast(const DSRCodedEntryValue *, OFstatic_cast(const DSRCodeTreeNode *, &node)));
+        result = DSRCodedEntryValue::operator==(OFstatic_cast(const DSRCodeTreeNode &, node).getValue());
     }
     return result;
 }
@@ -69,7 +69,7 @@ OFBool DSRCodeTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRCodedEntryValue::operator!=(*OFstatic_cast(const DSRCodedEntryValue *, OFstatic_cast(const DSRCodeTreeNode *, &node)));
+        result = DSRCodedEntryValue::operator!=(OFstatic_cast(const DSRCodeTreeNode &, node).getValue());
     }
     return result;
 }
index f204089e8d477c5b13f54d6b904882f461fd73c2..4119cf1cb6d12a6236ae5312fd8c36f7b0129237 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -57,7 +57,7 @@ OFBool DSRCompositeTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRCompositeReferenceValue::operator==(*OFstatic_cast(const DSRCompositeReferenceValue *, OFstatic_cast(const DSRCompositeTreeNode *, &node)));
+        result = DSRCompositeReferenceValue::operator==(OFstatic_cast(const DSRCompositeTreeNode &, node).getValue());
     }
     return result;
 }
@@ -70,7 +70,7 @@ OFBool DSRCompositeTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRCompositeReferenceValue::operator!=(*OFstatic_cast(const DSRCompositeReferenceValue *, OFstatic_cast(const DSRCompositeTreeNode *, &node)));
+        result = DSRCompositeReferenceValue::operator!=(OFstatic_cast(const DSRCompositeTreeNode &, node).getValue());
     }
     return result;
 }
index dc927687538e05ce364b2ba8b4dd223e9838db53..5e343b3e0fcd723950036d95e5f16a7791e16577 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -57,7 +57,7 @@ OFBool DSRContainerTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = (ContinuityOfContent == OFstatic_cast(const DSRContainerTreeNode *, &node)->ContinuityOfContent);
+        result = (ContinuityOfContent == OFstatic_cast(const DSRContainerTreeNode &, node).ContinuityOfContent);
     }
     return result;
 }
@@ -70,7 +70,7 @@ OFBool DSRContainerTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = (ContinuityOfContent != OFstatic_cast(const DSRContainerTreeNode *, &node)->ContinuityOfContent);
+        result = (ContinuityOfContent != OFstatic_cast(const DSRContainerTreeNode &, node).ContinuityOfContent);
     }
     return result;
 }
index 3e34e62aa499b037add0207a77012b075f7921c0..8837bd251d2444cf6e37cd839592761309f031dd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -67,7 +67,7 @@ OFBool DSRDateTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator==(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRDateTreeNode *, &node)));
+        result = DSRStringValue::operator==(OFstatic_cast(const DSRDateTreeNode &, node).getValue());
     }
     return result;
 }
@@ -80,7 +80,7 @@ OFBool DSRDateTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator!=(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRDateTreeNode *, &node)));
+        result = DSRStringValue::operator!=(OFstatic_cast(const DSRDateTreeNode &, node).getValue());
     }
     return result;
 }
index 32f4d59b88826437ce6ec50228538ad0e5eac850..0119870d9ccd79759a522e8614eacc5cbb42e1f3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2017-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -38,6 +38,12 @@ DSRDocumentTreeNodeFilter::~DSRDocumentTreeNodeFilter()
 
 // implementation of filter list
 
+DSRDocumentTreeNodeFilterList::DSRDocumentTreeNodeFilterList()
+  : FilterList()
+{
+}
+
+
 DSRDocumentTreeNodeFilterList::~DSRDocumentTreeNodeFilterList()
 {
     OFListIterator(DSRDocumentTreeNodeFilter *) iter = FilterList.begin();
@@ -155,6 +161,26 @@ OFBool DSRDocumentTreeNodeHasSiblingsFilter::matches(const DSRDocumentTreeNode *
 }
 
 
+// implementation of "has Concept Name" filter
+
+DSRDocumentTreeNodeHasConceptNameFilter::DSRDocumentTreeNodeHasConceptNameFilter(const OFBool hasConceptName)
+  : HasConceptName(hasConceptName)
+{
+}
+
+
+DSRDocumentTreeNodeHasConceptNameFilter::~DSRDocumentTreeNodeHasConceptNameFilter()
+{
+}
+
+
+OFBool DSRDocumentTreeNodeHasConceptNameFilter::matches(const DSRDocumentTreeNode *node) const
+{
+    /* check whether the expected value matches */
+    return (node != NULL) && (node->getConceptName().isEmpty() != HasConceptName);
+}
+
+
 // implementation of Concept Name filter
 
 DSRDocumentTreeNodeConceptNameFilter::DSRDocumentTreeNodeConceptNameFilter(const DSRCodedEntryValue &conceptName)
@@ -327,6 +353,6 @@ DSRDocumentTreeNodeTemplateIdentificationFilter::~DSRDocumentTreeNodeTemplateIde
 
 OFBool DSRDocumentTreeNodeTemplateIdentificationFilter::matches(const DSRDocumentTreeNode *node) const
 {
-    /* check whether the observation date/time matches */
+    /* check whether the template identification matches */
     return (node != NULL) && (node->compareTemplateIdentification(TemplateIdentifier, MappingResource, MappingResourceUID));
 }
index ef3fb25b7448aed8a79a3a6e03eff03760fc0c51..b16500100ca74b7a51789b73800a35fab2563be5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2016, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -30,6 +30,8 @@
 #include "dcmtk/dcmsr/dsrstpl.h"
 #include "dcmtk/dcmsr/dsriodcc.h"
 
+#include "dcmtk/dcmdata/dcvrdt.h"
+
 
 DSRDocumentSubTree::DSRDocumentSubTree()
   : DSRTree<DSRDocumentTreeNode>(),
@@ -867,6 +869,27 @@ OFCondition DSRDocumentSubTree::createExpandedSubTree(DSRDocumentSubTree *&tree)
 }
 
 
+OFCondition DSRDocumentSubTree::setObservationDateTime(const OFString &observationDateTime,
+                                                       const OFBool check)
+{
+    /* check parameter only once */
+    OFCondition result = (check) ? DcmDateTime::checkStringValue(observationDateTime, "1") : EC_Normal;
+    if (result.good())
+    {
+        DSRIncludedTemplateNodeCursor cursor(getRoot());
+        if (cursor.isValid())
+        {
+            /* iterate over all nodes */
+            do {
+                /* and set the observation data/time */
+                cursor.getNode()->setObservationDateTime(observationDateTime, OFFalse /*check*/);
+            } while (cursor.iterate());
+        }
+    }
+    return result;
+}
+
+
 OFBool DSRDocumentSubTree::compareTemplateIdentification(const OFString &templateIdentifier,
                                                          const OFString &mappingResource,
                                                          const OFString &mappingResourceUID) const
index cb440252715aa36ea315baf4f6d1a3ed14f9e384..7e3bed3cea7de07b9e1f4f872cf85f1ce09b9cc9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -66,7 +66,7 @@ OFBool DSRDateTimeTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator==(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRDateTimeTreeNode *, &node)));
+        result = DSRStringValue::operator==(OFstatic_cast(const DSRDateTimeTreeNode &, node).getValue());
     }
     return result;
 }
@@ -79,7 +79,7 @@ OFBool DSRDateTimeTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator!=(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRDateTimeTreeNode *, &node)));
+        result = DSRStringValue::operator!=(OFstatic_cast(const DSRDateTimeTreeNode &, node).getValue());
     }
     return result;
 }
index 992b19c71528cd6e11de2cbb75bddad9122c78a4..0622322c378a7edd8d63392ba25eccada84256cc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -29,6 +29,7 @@
 #include "dcmtk/dcmdata/dcvris.h"
 
 #define INCLUDE_CSTDIO
+#define INCLUDE_CINTTYPES
 #include "dcmtk/ofstd/ofstdinc.h"
 
 
@@ -127,7 +128,9 @@ OFCondition DSRImageFrameList::write(DcmItem &dataset) const
     {
         if (!tmpString.empty())
             tmpString += '\\';
-#if SIZEOF_LONG == 8
+#ifdef PRId32
+        sprintf(buffer, "%" PRId32, *iterator);
+#elif SIZEOF_LONG == 8
         sprintf(buffer, "%d", *iterator);
 #else
         sprintf(buffer, "%ld", *iterator);
@@ -158,7 +161,9 @@ OFCondition DSRImageFrameList::putString(const char *stringValue)
         /* retrieve frame values from string */
         while (result.good() && (ptr != NULL))
         {
-#if SIZEOF_LONG == 8
+#ifdef SCNd32
+            if (sscanf(ptr, "%" SCNd32, &value) == 1)
+#elif SIZEOF_LONG == 8
             if (sscanf(ptr, "%d", &value) == 1)
 #else
             if (sscanf(ptr, "%ld", &value) == 1)
index c928349088f29eb0bfe32c0e56997f8122a39de3..583f0448658329c3f4eeb58c3c4eb5b468e3a788 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -56,7 +56,7 @@ OFBool DSRImageTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRImageReferenceValue::operator==(*OFstatic_cast(const DSRImageReferenceValue *, OFstatic_cast(const DSRImageTreeNode *, &node)));
+        result = DSRImageReferenceValue::operator==(OFstatic_cast(const DSRImageTreeNode &, node).getValue());
     }
     return result;
 }
@@ -69,7 +69,7 @@ OFBool DSRImageTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRImageReferenceValue::operator!=(*OFstatic_cast(const DSRImageReferenceValue *, OFstatic_cast(const DSRImageTreeNode *, &node)));
+        result = DSRImageReferenceValue::operator!=(OFstatic_cast(const DSRImageTreeNode &, node).getValue());
     }
     return result;
 }
index d07e595553f580a0fd5836a8ac8ea880f6a79773..a15a7fa189442cc827aedbbf36d66a4acee24f0b 100644 (file)
@@ -115,14 +115,18 @@ DSRImageReferenceValue::~DSRImageReferenceValue()
 
 DSRImageReferenceValue &DSRImageReferenceValue::operator=(const DSRImageReferenceValue &referenceValue)
 {
-    DSRCompositeReferenceValue::operator=(referenceValue);
-    /* do not check since this would be unexpected to the user */
-    FrameList = referenceValue.FrameList;
-    SegmentList = referenceValue.SegmentList;
-    PresentationState = referenceValue.PresentationState;
-    RealWorldValueMapping = referenceValue.RealWorldValueMapping;
-    /* create copy of icon image (if any), first frame only */
-    IconImage = (referenceValue.IconImage != NULL) ? referenceValue.IconImage->createDicomImage(0 /*fstart*/, 1 /*fcount*/) : NULL;
+    /* check for self-assignment, which would create a memory leak */
+    if (this != &referenceValue)
+    {
+        DSRCompositeReferenceValue::operator=(referenceValue);
+        /* do not check since this would be unexpected to the user */
+        FrameList = referenceValue.FrameList;
+        SegmentList = referenceValue.SegmentList;
+        PresentationState = referenceValue.PresentationState;
+        RealWorldValueMapping = referenceValue.RealWorldValueMapping;
+        /* create copy of icon image (if any), first frame only */
+        IconImage = (referenceValue.IconImage != NULL) ? referenceValue.IconImage->createDicomImage(0 /*fstart*/, 1 /*fcount*/) : NULL;
+    }
     return *this;
 }
 
index 5ff754b87eb058edf573733e125ab91b3bf8cbe8..4abc6fd388f97527001105df40369ac61173a480 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -54,7 +54,7 @@ OFBool DSRNumTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRNumericMeasurementValue::operator==(*OFstatic_cast(const DSRNumericMeasurementValue *, OFstatic_cast(const DSRNumTreeNode *, &node)));
+        result = DSRNumericMeasurementValue::operator==(OFstatic_cast(const DSRNumTreeNode &, node).getValue());
     }
     return result;
 }
@@ -67,7 +67,7 @@ OFBool DSRNumTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRNumericMeasurementValue::operator!=(*OFstatic_cast(const DSRNumericMeasurementValue *, OFstatic_cast(const DSRNumTreeNode *, &node)));
+        result = DSRNumericMeasurementValue::operator!=(OFstatic_cast(const DSRNumTreeNode &, node).getValue());
     }
     return result;
 }
index 813079b8a9abcfdff09d2c4712938f62f62fc9a9..f98d5e49dbf6d3c02f05c7fa3e3d9719d09a57da 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -66,7 +66,7 @@ OFBool DSRPNameTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator==(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRPNameTreeNode *, &node)));
+        result = DSRStringValue::operator==(OFstatic_cast(const DSRPNameTreeNode &, node).getValue());
     }
     return result;
 }
@@ -79,7 +79,7 @@ OFBool DSRPNameTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator!=(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRPNameTreeNode *, &node)));
+        result = DSRStringValue::operator!=(OFstatic_cast(const DSRPNameTreeNode &, node).getValue());
     }
     return result;
 }
index e05b49f4e7ad380946a886240d91f1c32cbcff52..609c94486c59e7b1fc366a61d2fb5ba8bd4308bb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2016, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -68,6 +68,48 @@ DSRByReferenceTreeNode::~DSRByReferenceTreeNode()
 }
 
 
+OFBool DSRByReferenceTreeNode::operator==(const DSRDocumentTreeNode &node) const
+{
+    /* call comparison operator of base class (includes check of value type) */
+    OFBool result = DSRDocumentTreeNode::operator==(node);
+    if (result)
+    {
+        /* it's safe to cast the type since the value type has already been checked */
+        const DSRByReferenceTreeNode &byRefNode = OFstatic_cast(const DSRByReferenceTreeNode &, node);
+        if (ValidReference && byRefNode.ValidReference)
+        {
+            /* check referenced node ID only */
+            result = (ReferencedNodeID == byRefNode.ReferencedNodeID);
+        } else {
+            /* check whether both references are invalid */
+            result = (ValidReference == byRefNode.ValidReference);
+        }
+    }
+    return result;
+}
+
+
+OFBool DSRByReferenceTreeNode::operator!=(const DSRDocumentTreeNode &node) const
+{
+    /* call comparison operator of base class (includes check of value type) */
+    OFBool result = DSRDocumentTreeNode::operator!=(node);
+    if (!result)
+    {
+        /* it's safe to cast the type since the value type has already been checked */
+        const DSRByReferenceTreeNode &byRefNode = OFstatic_cast(const DSRByReferenceTreeNode &, node);
+        if (ValidReference && byRefNode.ValidReference)
+        {
+            /* check referenced node ID only */
+            result = (ReferencedNodeID != byRefNode.ReferencedNodeID);
+        } else {
+            /* check whether either of the references is invalid */
+            result = (ValidReference != byRefNode.ValidReference);
+        }
+    }
+    return result;
+}
+
+
 DSRByReferenceTreeNode *DSRByReferenceTreeNode::clone() const
 {
     return new DSRByReferenceTreeNode(*this);
index 7dfb0d983ae400f39e92964b0d0caf5972d8606a..5908a897f64de4face9c70dfcdb0fae67c1cb3ef 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2010-2017, OFFIS e.V.
+ *  Copyright (C) 2010-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -76,11 +76,11 @@ OFCondition DSRGraphicData3DList::print(STD_NAMESPACE ostream &stream,
     while (iterator != endPos)
     {
         /* need to convert float to avoid problems with decimal point ('.' or ',') */
-        OFStandard::ftoa(buffer, sizeof(buffer), (*iterator).XCoord);
+        OFStandard::ftoa(buffer, sizeof(buffer), (*iterator).XCoord, 0, 0, 8 /* FLT_DIG + 2 for DICOM FL */);
         stream << buffer << tripletSeparator;
-        OFStandard::ftoa(buffer, sizeof(buffer), (*iterator).YCoord);
+        OFStandard::ftoa(buffer, sizeof(buffer), (*iterator).YCoord, 0, 0, 8 /* FLT_DIG + 2 for DICOM FL */);
         stream << buffer << tripletSeparator;
-        OFStandard::ftoa(buffer, sizeof(buffer), (*iterator).ZCoord);
+        OFStandard::ftoa(buffer, sizeof(buffer), (*iterator).ZCoord, 0, 0, 8 /* FLT_DIG + 2 for DICOM FL */);
         stream << buffer;
         iterator++;
         if (iterator != endPos)
index a4b021bee741d3570bf78357d545a1b58ba7c762..fc288c3e4fa2566374d78b51163efbced0f217f1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2010-2015, OFFIS e.V.
+ *  Copyright (C) 2010-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -47,6 +47,32 @@ DSRSCoord3DTreeNode::~DSRSCoord3DTreeNode()
 }
 
 
+OFBool DSRSCoord3DTreeNode::operator==(const DSRDocumentTreeNode &node) const
+{
+    /* call comparison operator of base class (includes check of value type) */
+    OFBool result = DSRDocumentTreeNode::operator==(node);
+    if (result)
+    {
+        /* it's safe to cast the type since the value type has already been checked */
+        result = DSRSpatialCoordinates3DValue::operator==(OFstatic_cast(const DSRSCoord3DTreeNode &, node).getValue());
+    }
+    return result;
+}
+
+
+OFBool DSRSCoord3DTreeNode::operator!=(const DSRDocumentTreeNode &node) const
+{
+    /* call comparison operator of base class (includes check of value type) */
+    OFBool result = DSRDocumentTreeNode::operator!=(node);
+    if (!result)
+    {
+        /* it's safe to cast the type since the value type has already been checked */
+        result = DSRSpatialCoordinates3DValue::operator!=(OFstatic_cast(const DSRSCoord3DTreeNode &, node).getValue());
+    }
+    return result;
+}
+
+
 DSRSCoord3DTreeNode *DSRSCoord3DTreeNode::clone() const
 {
     return new DSRSCoord3DTreeNode(*this);
index aa453277858b9044d451d2e9b4519c0a53499946..53c2819f6e663bfefc8f0835a04e45bca891717a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2010-2016, OFFIS e.V.
+ *  Copyright (C) 2010-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -72,6 +72,24 @@ DSRSpatialCoordinates3DValue &DSRSpatialCoordinates3DValue::operator=(const DSRS
 }
 
 
+OFBool DSRSpatialCoordinates3DValue::operator==(const DSRSpatialCoordinates3DValue &coordinatesValue) const
+{
+    return (GraphicType == coordinatesValue.GraphicType) &&
+           (GraphicDataList == coordinatesValue.GraphicDataList) &&
+           (FrameOfReferenceUID == coordinatesValue.FrameOfReferenceUID) &&
+           (FiducialUID == coordinatesValue.FiducialUID);
+}
+
+
+OFBool DSRSpatialCoordinates3DValue::operator!=(const DSRSpatialCoordinates3DValue &coordinatesValue) const
+{
+    return (GraphicType != coordinatesValue.GraphicType) ||
+           (GraphicDataList != coordinatesValue.GraphicDataList) ||
+           (FrameOfReferenceUID != coordinatesValue.FrameOfReferenceUID) ||
+           (FiducialUID != coordinatesValue.FiducialUID);
+}
+
+
 void DSRSpatialCoordinates3DValue::clear()
 {
     GraphicType = DSRTypes::GT3_invalid;
index 9f2c4f9a8f671e350bf226206b8997c540172200..57d003731010bf9aa625b9c5ad03e5aa7e093c75 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -76,9 +76,9 @@ OFCondition DSRGraphicDataList::print(STD_NAMESPACE ostream &stream,
     while (iterator != endPos)
     {
         /* need to convert float to avoid problems with decimal point ('.' or ',') */
-        OFStandard::ftoa(buffer, sizeof(buffer), (*iterator).Column);
+        OFStandard::ftoa(buffer, sizeof(buffer), (*iterator).Column, 0, 0, 8 /* FLT_DIG + 2 for DICOM FL */);
         stream << buffer << pairSeparator;
-        OFStandard::ftoa(buffer, sizeof(buffer), (*iterator).Row);
+        OFStandard::ftoa(buffer, sizeof(buffer), (*iterator).Row, 0, 0, 8 /* FLT_DIG + 2 for DICOM FL */);
         stream << buffer;
         iterator++;
         if (iterator != endPos)
index 29a49b22b847483f92b03df8e4655fbd01d0e743..6cb91cc5354950ab3b123e374c28a9755592d0da 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -54,7 +54,7 @@ OFBool DSRSCoordTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRSpatialCoordinatesValue::operator==(*OFstatic_cast(const DSRSpatialCoordinatesValue *, OFstatic_cast(const DSRSCoordTreeNode *, &node)));
+        result = DSRSpatialCoordinatesValue::operator==(OFstatic_cast(const DSRSCoordTreeNode &, node).getValue());
     }
     return result;
 }
@@ -67,7 +67,7 @@ OFBool DSRSCoordTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRSpatialCoordinatesValue::operator!=(*OFstatic_cast(const DSRSpatialCoordinatesValue *, OFstatic_cast(const DSRSCoordTreeNode *, &node)));
+        result = DSRSpatialCoordinatesValue::operator!=(OFstatic_cast(const DSRSCoordTreeNode &, node).getValue());
     }
     return result;
 }
index fa4c981fefcb577395d05958a4c2bfc304c750cb..cb6d26d0ff4e2534c90b87d9786c8d91d1c35228 100644 (file)
@@ -29,6 +29,7 @@
 #include "dcmtk/dcmdata/dcvrul.h"
 
 #define INCLUDE_CSTDIO
+#define INCLUDE_CINTTYPES
 #include "dcmtk/ofstd/ofstdinc.h"
 
 
@@ -147,7 +148,9 @@ OFCondition DSRReferencedSamplePositionList::putString(const char *stringValue)
         /* retrieve sample positions from string */
         while (result.good() && (ptr != NULL))
         {
-#if SIZEOF_LONG == 8
+#ifdef SCNu32
+            if (sscanf(ptr, "%" SCNu32, &value) == 1)
+#elif SIZEOF_LONG == 8
             if (sscanf(ptr, "%u", &value) == 1)
 #else
             if (sscanf(ptr, "%lu", &value) == 1)
index 9affeab1602f243b17232ea3d2234a5f2e4ef56d..1f8a1d71eb78ff0304c393e24de8d6fcc99ef5dc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -54,7 +54,7 @@ OFBool DSRTCoordTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRTemporalCoordinatesValue::operator==(*OFstatic_cast(const DSRTemporalCoordinatesValue *, OFstatic_cast(const DSRTCoordTreeNode *, &node)));
+        result = DSRTemporalCoordinatesValue::operator==(OFstatic_cast(const DSRTCoordTreeNode &, node).getValue());
     }
     return result;
 }
@@ -67,7 +67,7 @@ OFBool DSRTCoordTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRTemporalCoordinatesValue::operator!=(*OFstatic_cast(const DSRTemporalCoordinatesValue *, OFstatic_cast(const DSRTCoordTreeNode *, &node)));
+        result = DSRTemporalCoordinatesValue::operator!=(OFstatic_cast(const DSRTCoordTreeNode &, node).getValue());
     }
     return result;
 }
index 7ce45ba64da5ff23af0948dcbcc49bae4f47d09e..4946a4c927fec8f6c5cdf4bd255e2541693c4796 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -76,7 +76,7 @@ OFCondition DSRReferencedTimeOffsetList::print(STD_NAMESPACE ostream &stream,
     while (iterator != endPos)
     {
         /* need to convert float to avoid problems with decimal point ('.' or ',') */
-        OFStandard::ftoa(buffer, sizeof(buffer), *iterator);
+        OFStandard::ftoa(buffer, sizeof(buffer), *iterator, 0 ,0, 17 /* DBL_DIG + 2 for DICOM FD */);
         stream << buffer;
         iterator++;
         if (iterator != endPos)
index 8a1696d710f981da389bddd2f23e3185b79caa12..f213b806cb95e807159743a3647526d24e4fd2c1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -67,7 +67,7 @@ OFBool DSRTextTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator==(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRTextTreeNode *, &node)));
+        result = DSRStringValue::operator==(OFstatic_cast(const DSRTextTreeNode &, node).getValue());
     }
     return result;
 }
@@ -80,7 +80,7 @@ OFBool DSRTextTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator!=(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRTextTreeNode *, &node)));
+        result = DSRStringValue::operator!=(OFstatic_cast(const DSRTextTreeNode &, node).getValue());
     }
     return result;
 }
index 47f6261898676c8696b435af38e6b2e38243e9e9..a38be64eb9ad228e400ff36a95046ae165e1413d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -66,7 +66,7 @@ OFBool DSRTimeTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator==(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRTimeTreeNode *, &node)));
+        result = DSRStringValue::operator==(OFstatic_cast(const DSRTimeTreeNode &, node).getValue());
     }
     return result;
 }
@@ -79,7 +79,7 @@ OFBool DSRTimeTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator!=(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRTimeTreeNode *, &node)));
+        result = DSRStringValue::operator!=(OFstatic_cast(const DSRTimeTreeNode &, node).getValue());
     }
     return result;
 }
index 6fe60fa8bb2f861633e6c31fe4040e222136ba2e..62eed194e14ec20219bfcc92913587fb6ffc1fd7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2016, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -56,6 +56,32 @@ DSRIncludedTemplateTreeNode::~DSRIncludedTemplateTreeNode()
 }
 
 
+OFBool DSRIncludedTemplateTreeNode::operator==(const DSRDocumentTreeNode &node) const
+{
+    /* call comparison operator of base class (includes check of value type) */
+    OFBool result = DSRDocumentTreeNode::operator==(node);
+    if (result)
+    {
+        /* it's safe to cast the type since the value type has already been checked */
+        result = (ReferencedTemplate.get() == OFstatic_cast(const DSRIncludedTemplateTreeNode &, node).ReferencedTemplate.get());
+    }
+    return result;
+}
+
+
+OFBool DSRIncludedTemplateTreeNode::operator!=(const DSRDocumentTreeNode &node) const
+{
+    /* call comparison operator of base class (includes check of value type) */
+    OFBool result = DSRDocumentTreeNode::operator!=(node);
+    if (!result)
+    {
+        /* it's safe to cast the type since the value type has already been checked */
+        result = (ReferencedTemplate.get() != OFstatic_cast(const DSRIncludedTemplateTreeNode &, node).ReferencedTemplate.get());
+    }
+    return result;
+}
+
+
 DSRIncludedTemplateTreeNode *DSRIncludedTemplateTreeNode::clone() const
 {
     return new DSRIncludedTemplateTreeNode(*this);
index 522b03eb21052bea930186394a660fc219827bc8..7240a11e8606208be219e38ba0a3552b2422c168 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -66,7 +66,7 @@ OFBool DSRUIDRefTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator==(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRUIDRefTreeNode *, &node)));
+        result = DSRStringValue::operator==(OFstatic_cast(const DSRUIDRefTreeNode &, node).getValue());
     }
     return result;
 }
@@ -79,7 +79,7 @@ OFBool DSRUIDRefTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRStringValue::operator!=(*OFstatic_cast(const DSRStringValue *, OFstatic_cast(const DSRUIDRefTreeNode *, &node)));
+        result = DSRStringValue::operator!=(OFstatic_cast(const DSRUIDRefTreeNode &, node).getValue());
     }
     return result;
 }
index c7bb57cc9a7d27ddcbb90c85660d807f0c1170ae..f748560bd266d363c38feb7bd819f8df4b339179 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -56,7 +56,7 @@ OFBool DSRWaveformTreeNode::operator==(const DSRDocumentTreeNode &node) const
     if (result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRWaveformReferenceValue::operator==(*OFstatic_cast(const DSRWaveformReferenceValue *, OFstatic_cast(const DSRWaveformTreeNode *, &node)));
+        result = DSRWaveformReferenceValue::operator==(OFstatic_cast(const DSRWaveformTreeNode &, node).getValue());
     }
     return result;
 }
@@ -69,7 +69,7 @@ OFBool DSRWaveformTreeNode::operator!=(const DSRDocumentTreeNode &node) const
     if (!result)
     {
         /* it's safe to cast the type since the value type has already been checked */
-        result = DSRWaveformReferenceValue::operator!=(*OFstatic_cast(const DSRWaveformReferenceValue *, OFstatic_cast(const DSRWaveformTreeNode *, &node)));
+        result = DSRWaveformReferenceValue::operator!=(OFstatic_cast(const DSRWaveformTreeNode &, node).getValue());
     }
     return result;
 }
index 55c9690073f391d048616728d39744929468c986..fe3fb811dec1f164498a8c9e61670c536a906c4b 100644 (file)
@@ -38,7 +38,6 @@
 // This function is also used in xml2dcm, try to stay in sync!
 extern "C" void errorFunction(void * ctx, const char *msg, ...)
 {
-    OFString &buffer = *OFstatic_cast(OFString*, ctx);
     OFLogger xmlLogger = OFLog::getLogger("dcmtk.dcmsr.libxml");
 
     if (!xmlLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL))
@@ -49,6 +48,7 @@ extern "C" void errorFunction(void * ctx, const char *msg, ...)
     // result in garbled output. To avoid this, we buffer the output in a local
     // string in the caller which we get through our 'ctx' parameter. Then, we
     // output this string on one go when we receive a newline.
+    OFString &buffer = *OFstatic_cast(OFString*, ctx);
     va_list ap;
     char buf[1024];
 
index 76284f81fb425a984908ae33bc4fcc50058e0fc0..4a789b1a97d6472489a7c4e19e94aaa747cb0a5c 100644 (file)
@@ -45,6 +45,7 @@ mkreport.o: mkreport.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -52,6 +53,7 @@ mkreport.o: mkreport.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -64,7 +66,6 @@ mkreport.o: mkreport.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -144,17 +145,19 @@ tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -191,17 +194,19 @@ tsrcmr.o: tsrcmr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -251,7 +256,6 @@ tsrcmr.o: tsrcmr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -308,6 +312,7 @@ tsrcmr.o: tsrcmr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/cmr/srnumvlu.h \
  ../include/dcmtk/dcmsr/cmr/srnumvl.h \
  ../include/dcmtk/dcmsr/cmr/tid1419m.h \
+ ../include/dcmtk/dcmsr/cmr/tid4019.h \
  ../include/dcmtk/dcmsr/cmr/cid6147.h \
  ../include/dcmtk/dcmsr/cmr/cid7464.h \
  ../include/dcmtk/dcmsr/cmr/cid7469.h \
@@ -325,17 +330,19 @@ tsrcodvl.o: tsrcodvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -379,8 +386,7 @@ tsrcodvl.o: tsrcodvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrcodvl.h ../include/dcmtk/dcmsr/dsrtypes.h \
  ../include/dcmtk/dcmsr/dsdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h
+ ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h
 tsrdoc.o: tsrdoc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oftest.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
@@ -391,17 +397,19 @@ tsrdoc.o: tsrdoc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -449,7 +457,6 @@ tsrdoc.o: tsrdoc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -489,17 +496,19 @@ tsrdoctr.o: tsrdoctr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -547,7 +556,6 @@ tsrdoctr.o: tsrdoctr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -578,8 +586,9 @@ tsrdoctr.o: tsrdoctr.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrtm.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrui.h \
  ../include/dcmtk/dcmsr/dsrtpltn.h ../include/dcmtk/dcmsr/dsrstpl.h \
- ../include/dcmtk/dcmsr/dsrimgtn.h ../include/dcmtk/dcmsr/dsrnumtn.h \
- ../include/dcmtk/dcmsr/dsrtextn.h ../include/dcmtk/dcmsr/dsrstrvl.h
+ ../include/dcmtk/dcmsr/dsrreftn.h ../include/dcmtk/dcmsr/dsrimgtn.h \
+ ../include/dcmtk/dcmsr/dsrnumtn.h ../include/dcmtk/dcmsr/dsrtextn.h \
+ ../include/dcmtk/dcmsr/dsrstrvl.h
 tsrlist.o: tsrlist.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oftest.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
@@ -590,17 +599,19 @@ tsrlist.o: tsrlist.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -643,17 +654,19 @@ tsrnumvl.o: tsrnumvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -696,7 +709,6 @@ tsrnumvl.o: tsrnumvl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcsequen.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrfd.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrsl.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrul.h \
@@ -711,17 +723,19 @@ tsrtpl.o: tsrtpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
@@ -769,7 +783,6 @@ tsrtpl.o: tsrtpl.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmsr/dsrtnant.h \
  ../../ofstd/include/dcmtk/ofstd/ofstack.h \
  ../include/dcmtk/dcmsr/dsrdoctn.h ../include/dcmtk/dcmsr/dsrcodvl.h \
- ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../include/dcmtk/dcmsr/dsrdncsr.h ../include/dcmtk/dcmsr/dsrdnflt.h \
  ../../ofstd/include/dcmtk/ofstd/ofdatime.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
@@ -810,17 +823,19 @@ tsrtree.o: tsrtree.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
index 64f5381e1a36fbbf86776a38ec925ab9b00e6849..19ad1ef5f0f5c629ead62b9b59ecaf45a9c00433 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2015-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2015-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -239,7 +239,7 @@ OFTEST(dcmsr_TID1411_VolumetricROIMeasurements)
     OFCHECK(volumetric.addFindingSite(DSRBasicCodedEntry("EFGH", "99TEST", "Finding Site"), CMR_CID244::RightAndLeft).good());
     OFCHECK(!volumetric.hasMeasurements());
     OFCHECK(!measurement.hasMeasurement());
-    OFCHECK(measurement.createNewMeasurement(CMR_CID7469::Volume, CMR_TID1411_in_TID1500::MeasurementValue("15", CMR_CID7181::CubicMillimeter)).good());
+    OFCHECK(measurement.createNewMeasurement(CMR_CID7469::Volume, CMR_TID1419_in_TID1411_in_TID1500::MeasurementValue("15", CMR_CID7181::CubicMillimeter)).good());
     OFCHECK(volumetric.hasMeasurements());
     OFCHECK(measurement.hasMeasurement());
     OFCHECK(measurement.setDerivation(CMR_CID7464::StandardDeviation).good());
@@ -247,11 +247,20 @@ OFTEST(dcmsr_TID1411_VolumetricROIMeasurements)
     OFCHECK(measurement.addFindingSite(DSRBasicCodedEntry("EFGH.1", "99TEST", "Finding Site 1"), CMR_CID244::Left).good());
     OFCHECK(measurement.addModifier(DSRBasicCodedEntry("ABCD", "99TEST", "Concept Name Modifier"), DSRBasicCodedEntry("ABCD.2", "99TEST", "Modifier 2")).good());
     OFCHECK(measurement.setMeasurementMethod(DSRCodedEntryValue("9876", "99TEST", "Some method")).good());
+    OFCHECK(measurement.setAlgorithmIdentification("My Special Effects", "1.0").good());
     OFCHECK(measurement.setRealWorldValueMap(DSRCompositeReferenceValue(UID_RealWorldValueMappingStorage, "2.0.3.0.4.0")).good());
     OFCHECK(measurement.addFindingSite(DSRBasicCodedEntry("EFGH.2", "99TEST", "Finding Site 2"), CID244e_Laterality(), DSRBasicCodedEntry("EFGH.2-1", "99TEST", "Finding Site 2 Modifier")).good());
     OFCHECK(measurement.setEquivalentMeaningOfConceptName("blabla").good());
     OFCHECK(measurement.addDerivationParameter(CODE_DCM_Derivation, CMR_SRNumericMeasurementValue("1.5", CODE_UCUM_Centimeter)).good());
     OFCHECK(volumetric.addQualitativeEvaluation(CODE_DCM_Conclusion, "it's not ok").good());
+    OFCHECK(measurement.setAlgorithmIdentification("My New Special Effects", "2.0").good());
+    OFCHECK(measurement.getAlgorithmIdentification().addParameter("Parameter #1").good());
+    OFCHECK(measurement.getAlgorithmIdentification().addParameter("Parameter #2").good());
+    OFCHECK(measurement.isValid());
+
+    /* check number of content items (expected) */
+    OFCHECK_EQUAL(volumetric.getTree().countNodes(OFTrue /*searchIntoSubTemplates*/), 25);
+    OFCHECK_EQUAL(volumetric.getTree().countNodes(OFTrue /*searchIntoSubTemplates*/, OFFalse), 23);
 
     /* output content of the tree (in debug mode only) */
     if (DCM_dcmsrCmrLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL))
@@ -348,6 +357,7 @@ OFTEST(dcmsr_TID1500_MeasurementReport)
     OFCHECK(!volMeasurements.hasMeasurements());
     OFCHECK(volMeasurements.addMeasurement(CMR_CID7469::SUVbw, numVal1).good());
     OFCHECK(volMeasurements.getMeasurement().setDerivation(CMR_CID7464::Mean).good());
+    OFCHECK(volMeasurements.getMeasurement().setAlgorithmIdentification("My Algorithm", "0.9").good());
     OFCHECK(volMeasurements.addMeasurement(CMR_CID7469::SUVbw, numVal2).good());
     OFCHECK(volMeasurements.getMeasurement().setDerivation(CMR_CID7464::Mode).good());
     OFCHECK(volMeasurements.getMeasurement().setMeasurementMethod(DSRCodedEntryValue("0815", "99TEST", "Some test code")).good());
@@ -378,17 +388,17 @@ OFTEST(dcmsr_TID1500_MeasurementReport)
 
     /* check number of content items (expected) */
     OFCHECK_EQUAL(report.getTree().countNodes(), 14);
-    OFCHECK_EQUAL(report.getTree().countNodes(OFTrue /*searchIntoSubTemplates*/), 48);
-    OFCHECK_EQUAL(report.getTree().countNodes(OFTrue /*searchIntoSubTemplates*/, OFFalse /*countIncludedTemplateNodes*/), 36);
+    OFCHECK_EQUAL(report.getTree().countNodes(OFTrue /*searchIntoSubTemplates*/), 52);
+    OFCHECK_EQUAL(report.getTree().countNodes(OFTrue /*searchIntoSubTemplates*/, OFFalse /*countIncludedTemplateNodes*/), 38);
     /* create an expanded version of the tree */
     DSRDocumentSubTree *tree = NULL;
     OFCHECK(report.getTree().createExpandedSubTree(tree).good());
     /* and check whether all content items are there */
     if (tree != NULL)
     {
-        OFCHECK_EQUAL(tree->countNodes(), 36);
-        OFCHECK_EQUAL(tree->countNodes(OFTrue /*searchIntoSubTemplates*/), 36);
-        OFCHECK_EQUAL(tree->countNodes(OFTrue /*searchIntoSubTemplates*/, OFFalse /*countIncludedTemplateNodes*/), 36);
+        OFCHECK_EQUAL(tree->countNodes(), 38);
+        OFCHECK_EQUAL(tree->countNodes(OFTrue /*searchIntoSubTemplates*/), 38);
+        OFCHECK_EQUAL(tree->countNodes(OFTrue /*searchIntoSubTemplates*/, OFFalse /*countIncludedTemplateNodes*/), 38);
         delete tree;
     } else
         OFCHECK_FAIL("could create expanded tree");
index edce1715cf95a013ccf42ba43785d5858cb2173b..6dea495ac843b50c63643d36134764a91a04e9d5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2014-2017, J. Riesmeier, Oldenburg, Germany
+ *  Copyright (C) 2014-2018, J. Riesmeier, Oldenburg, Germany
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -29,6 +29,7 @@
 #include "dcmtk/dcmsr/dsrdoc.h"
 #include "dcmtk/dcmsr/dsrdncsr.h"
 #include "dcmtk/dcmsr/dsrtpltn.h"
+#include "dcmtk/dcmsr/dsrreftn.h"
 #include "dcmtk/dcmsr/dsrimgtn.h"
 #include "dcmtk/dcmsr/dsrnumtn.h"
 #include "dcmtk/dcmsr/dsrtextn.h"
@@ -160,6 +161,23 @@ OFTEST(dcmsr_compareNodes)
     /* and compare it to the initial node */
     OFCHECK(numNode != node);
     delete newNode;
+    /* try the same with an "included template" tree node */
+    DSRIncludedTemplateTreeNode templNode1(DSRSharedSubTemplate(NULL), DSRTypes::RT_contains);
+    DSRIncludedTemplateTreeNode templNode2(templNode1);
+    OFCHECK(templNode1 == templNode2);
+    /* and a "by-reference" tree node */
+    DSRByReferenceTreeNode byRefNode1(DSRTypes::RT_inferredFrom);
+    DSRByReferenceTreeNode byRefNode2(DSRTypes::RT_inferredFrom);
+    OFCHECK(!byRefNode1.isValid());
+    OFCHECK(!byRefNode2.isValid());
+    /* make the references valid */
+    OFCHECK(byRefNode1.updateReference(1, DSRTypes::VT_Num));
+    OFCHECK(byRefNode2.updateReference(2, DSRTypes::VT_Num));
+    OFCHECK(byRefNode1.isValid());
+    OFCHECK(byRefNode2.isValid());
+    OFCHECK(byRefNode1 != byRefNode2);
+    OFCHECK(byRefNode2.updateReference(1, DSRTypes::VT_Num));
+    OFCHECK(byRefNode1 == byRefNode2);
 }
 
 
@@ -237,6 +255,8 @@ OFTEST(dcmsr_gotoMatchingNode)
     OFCHECK(tree.addContentItem(DSRTypes::RT_hasConceptMod, DSRTypes::VT_Code, DSRTypes::AM_belowCurrent));
     const size_t nodeID5 = tree.getNodeID();
     OFCHECK(tree.getCurrentContentItem().setConceptName(DSRCodedEntryValue("111221", "DCM", "Unknown failure")).good());
+    OFCHECK(tree.addContentItem(DSRTypes::RT_hasProperties, DSRTypes::VT_Composite, DSRTypes::AM_afterCurrent));
+    const size_t nodeID6 = tree.getNodeID();
     /* and check the "search by filter" function */
     OFCHECK_EQUAL(tree.gotoMatchingNode(DSRDocumentTreeNodeConceptNameFilter(DSRCodedEntryValue("121206", "DCM", "Distance"))), nodeID2);
     OFCHECK_EQUAL(tree.gotoNextMatchingNode(DSRDocumentTreeNodeValueTypeFilter(DSRTypes::VT_Code)), nodeID3);
@@ -256,7 +276,19 @@ OFTEST(dcmsr_gotoMatchingNode)
     OFCHECK_EQUAL(tree.gotoMatchingNode(DSRDocumentTreeNodeObservationDateTimeFilter("201708081000", "201708081400")), nodeID2);
     OFCHECK_EQUAL(tree.gotoMatchingNode(DSRDocumentTreeNodeObservationDateTimeFilter("20170828", "" /*toDateTime*/)), nodeID3);
     OFCHECK_EQUAL(tree.gotoNextMatchingNode(DSRDocumentTreeNodeObservationDateTimeFilter("" /*fromDateTime*/, "201708280800")), nodeID4);
+    OFCHECK_EQUAL(tree.gotoNextMatchingNode(DSRDocumentTreeNodeHasConceptNameFilter(OFFalse /*hasConceptName*/)), nodeID6);
     OFCHECK_EQUAL(tree.gotoMatchingNode(DSRDocumentTreeNodeObservationDateTimeFilter("20170828080001", "" /*toDateTime*/)), 0 /* not found */);
+    /* change observation date/time for all content items */
+    OFCHECK(tree.setObservationDateTime("201803151800").good());
+    /* ... and check again */
+    const DSRDocumentTreeNodeObservationDateTimeFilter filter3("20180101", "20181231");
+    OFCHECK_EQUAL(tree.gotoNode(nodeID1), nodeID1);
+    OFCHECK_EQUAL(tree.gotoNextMatchingNode(filter3), nodeID2);
+    OFCHECK(tree.iterate() /* skip one node */);
+    OFCHECK_EQUAL(tree.gotoNextMatchingNode(filter3), nodeID3);
+    OFCHECK_EQUAL(tree.gotoNextMatchingNode(filter3), nodeID4);
+    OFCHECK_EQUAL(tree.gotoNextMatchingNode(filter3), nodeID5);
+    OFCHECK_EQUAL(tree.gotoNextMatchingNode(filter3), nodeID6);
 }
 
 
index 85ab8e88604aba1ed48f616774cf47d5b31ed709..d40200d5419333b4f2aa63c7f032aa1e065095fe 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmtls)
+project(dcmtls)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmtls_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmnet_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${OPENSSL_INCDIR})
+include_directories("${dcmtls_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmnet_SOURCE_DIR}/include" ${ZLIB_INCDIR} ${OPENSSL_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc include docs)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc include docs)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 11da0d4d76fee5f659f49a906dd51e4551a6c169..102e17fb9040576fa4cf0e2eecbb76d6f747ddaf 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES ciphers.txt randseed.txt certstor.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc)
+install(FILES ciphers.txt randseed.txt certstor.txt DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT doc)
index c1d64bc601e861828d3d3a42cd0295fec030b978..c7650f2f964931ade1de384221e846f01b3fd49c 100644 (file)
@@ -5,10 +5,10 @@ CIPHERSUITE SUPPORT IN DCMTK
 
 When compiled with OpenSSL support, several of the DCMTK network
 applications optionally support TLS encapsulated secure DICOM communication
-as defined in the DICOM Security Enhancements One (Supplement 31). TLS
-(Transport Layer Security) can be used with different so-called
-"ciphersuites". Each ciphersuite defines
+as defined in the DICOM Part 15. TLS (Transport Layer Security) can be
+used with different so-called "ciphersuites". Each ciphersuite defines
 
+  - the algorithm to be used for the authentication of peers,
   - the algorithm to be used for key-exchange of session keys,
   - the algorithm to be used for bulk data encryption, and
   - the algorithm to be used for secure hash (message digest).
@@ -16,84 +16,138 @@ as defined in the DICOM Security Enhancements One (Supplement 31). TLS
 The ciphersuites to be used for secure DICOM communication can be
 controlled in the TLS-enabled DCMTK tools, e.g. with appropriate command
 line parameters. The ciphersuite name constants known to DCMTK are
-exactly as defined in RFC 2246, RFC 3268 and in the draft IETF specifications
-draft-ietf-tls-56-bit-ciphersuites-00.txt and draft-ietf-tls-ecc-01.txt
+exactly as defined in the RFCs that define the TLS protocol and its
+various extensions.
 
 The TLS protocol allows a dynamic negotiation of the ciphersuite to be used.
 For this purpose, the TLS-enabled DCMTK tools allow that multiple
-ciphersuites be specified.  During negotiation, the first ciphersuite that
-is supported by both communicating entities is selected, i.e. the order of
-the command line parameters decides in which order the ciphersuites are
-negotiated.
-
-It should be noted that DICOM applications supporting the "Basic TLS Secure
-Transport Connection Profile" defined in Part 15 of the DICOM standard must
-always support the TLS_RSA_WITH_3DES_EDE_CBC_SHA ciphersuite for secure DICOM
-communication.
-
-DICOM applications supporting the "AES TLS Secure Transport Connection Profile"
-defined in Part 15 of the DICOM standard must always support both
-TLS_RSA_WITH_AES_128_CBC_SHA and TLS_RSA_WITH_3DES_EDE_CBC_SHA ciphersuites for
-secure DICOM communication and must preferrably select the AES ciphersuite.
-
-Applications that wish to claim conformance to one of the DICOM Secure Transport
-Connection Profiles should make sure that the required ciphersuites are always
-included in the list of ciphersuites to be negotiated.
-
-The default behaviour of the TLS-enabled DCMTK tools, when compiled with an
-OpenSSL version prior to 0.9.7 is to only negotiate the
-TLS_RSA_WITH_3DES_EDE_CBC_SHA ciphersuite, conforming to the "Basic TLS Secure
-Transport Connection Profile". The default behaviour when compiled with OpenSSL
-release 0.9.7 or newer is to support TLS_RSA_WITH_AES_128_CBC_SHA and
-TLS_RSA_WITH_3DES_EDE_CBC_SHA, i.e. to conform to the "AES TLS Secure Transport
-Connection Profile".
-
-Note: OpenSSL 0.9.8a always includes and preferrably negotiates 256 bit AES
-(TLS_RSA_WITH_AES_256_CBC_SHA) in the list of ciphersuites whenever an
-application specifies support for TLS_RSA_WITH_AES_128_CBC_SHA. This does not
-break DICOM conformance, but may affect performance. There currently seems to be
-no way to avoid this behaviour, however, since it is hard-coded in OpenSSL.
+ciphersuites be specified. During negotiation, the TLS client proposes
+a list of ciphersuites that it supports, and the TLS server selects
+from this list. Many systems will select the first entry from the list
+that is also know to the server (thus respecting the prioritization
+of ciphersuites by the client), but servers may also select based
+on their own priorities, e.g. by always selecting the most secure ciphersuite.
+
+In DCMTK, the selection of ciphersuites is based on "TLS profiles", which
+follow the secure profiles define in DICOM Part 15:
+
+- BCP 195 TLS Profile (default)
+  This profile proposes the following set of ciphersuites:
+  - TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (only TLS 1.2+)
+  - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (only TLS 1.2+)
+  - TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (only TLS 1.2+)
+  - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (only TLS 1.2+)
+  - TLS_RSA_WITH_AES_128_CBC_SHA
+  - TLS_RSA_WITH_3DES_EDE_CBC_SHA
+
+  The first four ciphersuites are modern, state-of the art ciphersuites
+  but only work with TLS version 1.2 (or newer). The other two ciphersuites
+  offer backward compatibility with older applications implementing the
+  AES TLS Secure Transport Connection Profile or the Basic TLS Secure
+  Transport Connection Profile (e.g. DCMTK versions older than 3.6.4) and
+  can be used with TLS version 1.0 (or newer).
+
+- Non-downgrading BCP 195 TLS Profile
+  This profile proposes the following set of ciphersuites:
+  - TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (only TLS 1.2+)
+  - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (only TLS 1.2+)
+  - TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (only TLS 1.2+)
+  - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (only TLS 1.2+)
+
+  Furthermore, when this profile is active, only TLS version 1.2
+  or newer will be negotiated.
+
+- Basic TLS Secure Transport Connection Profile (retired)
+  This profile only proposes a single ciphersuite for use
+  with TLS 1.0 or newer:
+  - TLS_RSA_WITH_3DES_EDE_CBC_SHA
+
+- AES TLS Secure Transport Connection Profile (retired)
+  This profile proposes the following set of ciphersuites
+  for use with TLS 1.0 or newer:
+  - TLS_RSA_WITH_AES_128_CBC_SHA
+  - TLS_RSA_WITH_3DES_EDE_CBC_SHA
+
+- Authenticated unencrypted communication (retired)
+  This profile proposes a single ciphersuite that offers peer
+  authentication and integrity protection, but no encryption.
+  This profile should only be used in secure network environments.
+  This profile was defined in older versions of the IHE ATNA
+  (Audit Trail and Node Authentication) integration profile,
+  but has been retired.
+
+Furthermore, on API level it is also possible to start without
+a profile and directly define the set of supported ciphersuites,
+but for security reasons this option has not been made available
+in the command line tools.
+
+The list of ciphersuites defined by a profile can be extended by
+addition additional profiles from the list of supported ciphersuites
+(see below). The only exception is the unencrypted ciphersuite
+TLS_RSA_WITH_NULL_SHA: For security reasons, this ciphersuite cannot be
+added to one of the secure profiles other than "Authenticated
+unencrypted communication".
+
+The list of ciphersuites known to DCMTK is shown at the end
+of this document. The list of ciphersuites that is actually supported
+may also depend on the OpenSSL library with which DCMTK is compiled:
+
+- The CHACHA20 ciphers are only supported starting from OpenSSL 1.1.0
+
+- The 3DES cipher (TLS_RSA_WITH_3DES_EDE_CBC_SHA) is not available
+  in OpenSSL 1.1.0 or newer, unless OpenSSL has been configured
+  with "Configure enable-weak-ssl-ciphers <os/compiler>".
+  In cases where 3DES is not available, the Basic TLS Secure Transport
+  Connection Profile cannot be used and the AES TLS Secure Transport
+  Connection Profile will not offer backwards compatibility with the
+  Basic TLS profile.
+
+OpenSSL versions older than 1.0.1 are not supported anymore, and
+we recommend the use of OpenSSL 1.0.2 or newer since some optional
+features recommended by RFC 7525 (BCP 195) are only available starting
+with this release.
+
 
 ==============================
 NOTES ON CIPHERSUITE SELECTION
 ==============================
 
-The selection of ciphersuites is a matter of Security Policy which is
-outside the scope of a technical specification (like the DICOM standard) or
-a tool-set like DCMTK.  Nevertheless, when defining this local security
-policy there is a number of aspects users should be aware of.
-
 1. Unencrypted Ciphersuites
 
-  TLS defines two unencrypted ciphersuites, TLS_RSA_WITH_NULL_MD5 and
-  TLS_RSA_WITH_NULL_SHA. These ciphersuites do not provide any
-  confidentiality during data transmission - all data is transferred in
-  unencrypted plain text and can be read by any man-in-the-middle. They do,
-  however, provide peer entity authentication and integrity: they prevent
-  any unauthorised modification of data during transfer and allow to
-  identify the communicating entities.  The use of these ciphersuites
-  should be avoided if confidential (e.g. patient) data is transmitted
+  TLS defines several "unencrypted" ciphersuites, of which only
+  TLS_RSA_WITH_NULL_SHA is also supported by DCMTK.
+  This ciphersuite does not provide any confidentiality during data
+  transmission - all data is transferred in unencrypted plain text
+  and can be read by any man-in-the-middle. It does, however, provide
+  peer entity authentication and integrity: it prevents
+  any unauthorized modification of data during transfer and
+  identifies the communicating entities.  The use of this ciphersuite
+  MUST be avoided if confidential (e.g. patient) data is transmitted
   over public networks.
 
 2. Anonymous Ciphersuites
 
   TLS defines a number of ciphersuites which use anonymous Diffie-Hellman
   key exchange without signatures. These ciphersuites can be identified by a
-  name starting with "TLS_DH_anon_".  They do not allow an authentication
+  name starting with "TLS_DH_anon_".  They do not permit an authentication
   of the communicating entities and, therefore, are susceptible to
-  man-in-the-middle attacks.
+  man-in-the-middle attacks. DCMTK does not support these ciphersuites.
 
 3. Ciphersuites with Key Length Restrictions
 
-  The length of the keys used for key exchange of session keys and bulk data
-  encryption determines the effort needed to decrypt a TLS communication
-  with "brute force" attacks (using massive computing power). A number of
-  TLS ciphersuites restricts key lengths in order to comply with U.S. export
-  regulations. These ciphersuites can be identified by the term "EXPORT" or
-  "EXPORT1024" in their name.
+  DCMTK only supports TLS ciphersuite with at least 128 bits of security
+  for the symmetric block cipher. Such ciphers can currently be considered
+  secure (not breakable by "brute force attacks").
 
-  These ciphersuites must be considered insecure. Support for these
-  ciphersuites has been removed from DCMTK starting in version 3.6.1.
+  There are two exceptions, however: The unencrypted ciphersuite
+  (TLS_RSA_WITH_NULL_SHA, see above), and the Triple-DES ciphersuite
+  (TLS_RSA_WITH_3DES_EDE_CBC_SHA), which is only supported for backwards
+  compatibility with older implementations only supporting the
+  Basic TLS Secure Transport Connection Profile. While Triple-DES
+  has 168 bits key length, the effective security is only 112 bits,
+  which is below the threshold chosen for other ciphers.
+  Users who want to ensure at least 128 bits of security should use
+  the Non-downgrading BCP 195 TLS Profile.
 
 4. Forward Secrecy Ciphersuites
 
@@ -104,7 +158,7 @@ policy there is a number of aspects users should be aware of.
   forward secrecy by destroying cryptographic keys. This prevents an
   attacker from coercing the communicating parties into decrypting old
   ciphertext.  The forward secrecy ciphersuites can be identified by
-  the name starting with "TLS_DHE_".
+  the name starting with "TLS_DHE_" or "TLS_ECDHE_".
 
   Forward secrecy makes it harder for attackers to compromise confidential
   information in transit in encrypted form, and so is more secure than the
@@ -112,251 +166,68 @@ policy there is a number of aspects users should be aware of.
   legislations prohibit the use of forward secrecy in terms of non
   recoverable encryption.
 
-  Users in Europe who want to use forward secrecy should be aware of the
-  European Prestandard ENV 13608-3 "Health informatics - Security for
-  healthcare communication - Part 3: Secure data channels" which requires
-  that the TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA ciphersuite must be supported
-  if forward secrecy is desired and must be negotiated before ciphersuites
-  not offering forward secrecy if conformance to ENV 13608-3 is claimed by
-  an application.
-
-5. Ciphersuites not supported by OpenSSL
-
-  DCMTK relies on the OpenSSL library to implement TLS-secured DICOM
-  communication. However, the OpenSSL library does support Diffie-Hellman
-  certificates and, therefore, does not implement the non-ephemeral
-  (i.e., non forward secrecy) ciphersuites.
-
-  The unsupported ciphersuites are documented in OpenSSL's ciphers(1)
-  manual page and currently include:
-
-  - TLS_DH_DSS_WITH_DES_CBC_SHA
-  - TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA
-  - TLS_DH_RSA_WITH_DES_CBC_SHA
-  - TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA
-  - TLS_DH_DSS_WITH_AES_128_CBC_SHA
-  - TLS_DH_RSA_WITH_AES_128_CBC_SHA
-  - TLS_DH_DSS_WITH_AES_256_CBC_SHA
-  - TLS_DH_RSA_WITH_AES_256_CBC_SHA
-
-==============================
-TLS Ciphersuites from RFC 2246
-==============================
-
-TLS_RSA_WITH_NULL_MD5
-
-  Key exchange : RSA
-  Encryption   : none
-  Secure Hash  : MD5
-  Note         : UNENCRYPTED, NO CONFIDENTIALITY
-
-TLS_RSA_WITH_NULL_SHA
-
-  Key exchange : RSA
-  Encryption   : none
-  Secure Hash  : SHA-1
-  Note         : UNENCRYPTED, NO CONFIDENTIALITY
-
-TLS_RSA_WITH_RC4_128_MD5
-
-  Key exchange : RSA
-  Encryption   : RC4 with 128 bit key
-  Secure Hash  : MD5
-
-TLS_RSA_WITH_RC4_128_SHA
-
-  Key exchange : RSA
-  Encryption   : RC4 with 128 bit key
-  Secure Hash  : SHA-1
-
-TLS_RSA_WITH_IDEA_CBC_SHA
-
-  Key exchange : RSA
-  Encryption   : IDEA (CBC mode, 128 bit key)
-  Secure Hash  : SHA-1
-
-TLS_RSA_WITH_DES_CBC_SHA
-
-  Key exchange : RSA
-  Encryption   : DES (CBC mode) with 56 bit key
-  Secure Hash  : SHA-1
-
-TLS_RSA_WITH_3DES_EDE_CBC_SHA
-
-  Key exchange : RSA
-  Encryption   : 3DES (EDE CBC mode) with 168 bit key
-  Secure Hash  : SHA-1
-
-TLS_DH_DSS_WITH_DES_CBC_SHA
-
-  Key exchange : Diffie-Hellman with DSS certificate signature
-  Encryption   : DES (CBC mode) with 56 bit key
-  Secure Hash  : SHA-1
-  Note         : not supported by OpenSSL
-
-TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA
-
-  Key exchange : Diffie-Hellman with DSS certificate signature
-  Encryption   : 3DES (EDE CBC mode) with 168 bit key
-  Secure Hash  : SHA-1
-  Note         : not supported by OpenSSL
-
-TLS_DH_RSA_WITH_DES_CBC_SHA
-
-  Key exchange : Diffie-Hellman with RSA certificate signature
-  Encryption   : DES (CBC mode) with 56 bit key
-  Secure Hash  : SHA-1
-  Note         : not supported by OpenSSL
-
-TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA
-
-  Key exchange : Diffie-Hellman with RSA certificate signature
-  Encryption   : 3DES (EDE CBC mode) with 168 bit key
-  Secure Hash  : SHA-1
-  Note         : not supported by OpenSSL
-
-TLS_DHE_DSS_WITH_DES_CBC_SHA
-
-  Key exchange : Ephemeral Diffie-Hellman with DSS certificate signature
-  Encryption   : DES (CBC mode) with 56 bit key
-  Secure Hash  : SHA-1
-  Note         : provides forward secrecy
-
-TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
-
-  Key exchange : Ephemeral Diffie-Hellman with DSS certificate signature
-  Encryption   : 3DES (EDE CBC mode) with 168 bit key
-  Secure Hash  : SHA-1
-  Note         : provides forward secrecy
-
-TLS_DHE_RSA_WITH_DES_CBC_SHA
-
-  Key exchange : Ephemeral Diffie-Hellman with RSA certificate signature
-  Encryption   : DES (CBC mode) with 56 bit key
-  Secure Hash  : SHA-1
-  Note         : provides forward secrecy
-
-TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
-
-  Key exchange : Ephemeral Diffie-Hellman with RSA certificate signature
-  Encryption   : 3DES (EDE CBC mode) with 168 bit key
-  Secure Hash  : SHA-1
-  Note         : provides forward secrecy
-
-TLS_DH_anon_WITH_RC4_128_MD5
-
-  Key exchange : Anonymous Diffie-Hellman, no signatures
-  Encryption   : RC4 with 128 bit key
-  Secure Hash  : MD5
-  Note         : anonymous ciphersuite, susceptible to man-in-the-middle attacks
-
-TLS_DH_anon_WITH_DES_CBC_SHA
-
-  Key exchange : Anonymous Diffie-Hellman, no signatures
-  Encryption   : DES (CBC mode) with 56 bit key
-  Secure Hash  : SHA-1
-  Note         : anonymous ciphersuite, susceptible to man-in-the-middle attacks
-
-TLS_DH_anon_WITH_3DES_EDE_CBC_SHA
-
-  Key exchange : Anonymous Diffie-Hellman, no signatures
-  Encryption   : 3DES (EDE CBC mode) with 168 bit key
-  Secure Hash  : SHA-1
-  Note         : anonymous ciphersuite, susceptible to man-in-the-middle attacks
-
-===============================================================
-TLS Ciphersuites from draft-ietf-tls-56-bit-ciphersuites-00.txt
-===============================================================
-
-TLS_DHE_DSS_WITH_RC4_128_SHA
-
-  Key exchange : Ephemeral Diffie-Hellman with DSS certificate signature
-  Encryption   : RC4 with 128 bit key
-  Secure Hash  : SHA-1
-  Note         : provides forward secrecy
-
-==========================================================================
-AES Ciphersuites from RFC3268. Only available with OpenSSL 0.9.7 or newer.
-==========================================================================
-
-TLS_RSA_WITH_AES_128_CBC_SHA
-
-  Key exchange : RSA
-  Encryption   : AES (CBC mode) with 128 bit key
-  Secure Hash  : SHA-1
-
-TLS_DH_DSS_WITH_AES_128_CBC_SHA
-
-  Key exchange : Diffie-Hellman with DSS certificate signature
-  Encryption   : AES (CBC mode) with 128 bit key
-  Secure Hash  : SHA-1
-  Note         : not supported by OpenSSL
-
-TLS_DH_RSA_WITH_AES_128_CBC_SHA
-
-  Key exchange : Diffie-Hellman with RSA certificate signature
-  Encryption   : AES (CBC mode) with 128 bit key
-  Secure Hash  : SHA-1
-  Note         : not supported by OpenSSL
-
-TLS_DHE_DSS_WITH_AES_128_CBC_SHA
-
-  Key exchange : Ephemeral Diffie-Hellman with DSS certificate signature
-  Encryption   : AES (CBC mode) with 128 bit key
-  Secure Hash  : SHA-1
-  Note         : provides forward secrecy
-
-TLS_DHE_RSA_WITH_AES_128_CBC_SHA
-
-  Key exchange : Ephemeral Diffie-Hellman with RSA certificate signature
-  Encryption   : AES (CBC mode) with 128 bit key
-  Secure Hash  : SHA-1
-  Note         : provides forward secrecy
-
-TLS_DH_anon_WITH_AES_128_CBC_SHA
-
-  Key exchange : Anonymous Diffie-Hellman, no signatures
-  Encryption   : AES (CBC mode) with 128 bit key
-  Secure Hash  : SHA-1
-  Note         : anonymous ciphersuite, susceptible to man-in-the-middle attacks
-
-TLS_RSA_WITH_AES_256_CBC_SHA
-
-  Key exchange : RSA
-  Encryption   : AES (CBC mode) with 256 bit key
-  Secure Hash  : SHA-1
-
-TLS_DH_DSS_WITH_AES_256_CBC_SHA
-
-  Key exchange : Diffie-Hellman with DSS certificate signature
-  Encryption   : AES (CBC mode) with 256 bit key
-  Secure Hash  : SHA-1
-  Note         : not supported by OpenSSL
-
-TLS_DH_RSA_WITH_AES_256_CBC_SHA
-
-  Key exchange : Diffie-Hellman with RSA certificate signature
-  Encryption   : AES (CBC mode) with 256 bit key
-  Secure Hash  : SHA-1
-  Note         : not supported by OpenSSL
-
-TLS_DHE_DSS_WITH_AES_256_CBC_SHA
-
-  Key exchange : Ephemeral Diffie-Hellman with DSS certificate signature
-  Encryption   : AES (CBC mode) with 256 bit key
-  Secure Hash  : SHA-1
-  Note         : provides forward secrecy
-
-TLS_DHE_RSA_WITH_AES_256_CBC_SHA
-
-  Key exchange : Ephemeral Diffie-Hellman with RSA certificate signature
-  Encryption   : AES (CBC mode) with 256 bit key
-  Secure Hash  : SHA-1
-  Note         : provides forward secrecy
-
-TLS_DH_anon_WITH_AES_256_CBC_SHA
-
-  Key exchange : Anonymous Diffie-Hellman, no signatures
-  Encryption   : AES (CBC mode) with 256 bit key
-  Secure Hash  : SHA-1
-  Note         : anonymous ciphersuite, susceptible to man-in-the-middle attacks
+  In general, forward secrecy ciphersuites should be preferred.
+
+
+===================================
+TLS Ciphersuites Supported by DCMTK
+===================================
+
+The following list shows all TLS ciphersuites currently supported by DCMTK.
+The list of ciphersuites actually available in a DCMTK-based application
+may be smaller depending on the version of OpenSSL used and the way
+OpenSSL has been compiled (see above for details).
+
+  - TLS_RSA_WITH_NULL_SHA
+  - TLS_RSA_WITH_3DES_EDE_CBC_SHA
+  - TLS_RSA_WITH_AES_128_GCM_SHA256
+  - TLS_RSA_WITH_AES_128_CBC_SHA
+  - TLS_RSA_WITH_AES_128_CBC_SHA256
+  - TLS_RSA_WITH_AES_256_GCM_SHA384
+  - TLS_RSA_WITH_AES_256_CBC_SHA
+  - TLS_RSA_WITH_AES_256_CBC_SHA256
+  - TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
+  - TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
+  - TLS_DHE_DSS_WITH_AES_128_GCM_SHA256
+  - TLS_DHE_DSS_WITH_AES_128_CBC_SHA
+  - TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
+  - TLS_DHE_DSS_WITH_AES_256_GCM_SHA384
+  - TLS_DHE_DSS_WITH_AES_256_CBC_SHA
+  - TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
+  - TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA
+  - TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA
+  - TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
+  - TLS_DHE_RSA_WITH_AES_128_CBC_SHA
+  - TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
+  - TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
+  - TLS_DHE_RSA_WITH_AES_256_CBC_SHA
+  - TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
+  - TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
+  - TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
+  - TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
+  - TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
+  - TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
+  - TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
+  - TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
+  - TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
+  - TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
+  - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
+  - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
+  - TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
+  - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
+  - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
+  - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
+  - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
+  - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
+  - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
+  - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
+  - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
+  - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
+  - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
+  - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
+  - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
+  - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
+  - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
+  - TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256
+  - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
+  - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
index ced0c5ea8e7f2e8c19c5e5092bb4a44f52561744..c99cc2d78806a9d1a42d515e063459758fecfd48 100644 (file)
@@ -27,10 +27,12 @@ here and most error checking code is omitted for brevity.
 T_ASC_Network *net;        // network initialization code not shown,
 T_ASC_Parameters *params;  // we just assume these pointers to be valid
 
+DcmTLSTransportLayer::initializeOpenSSL(); // initialize OpenSSL library
+
 // create TLS object that initializes the random generator through a file
 // "random.dat" containing random data (1 kByte is sufficient).
 DcmTLSTransportLayer *tLayer = new DcmTLSTransportLayer(
-  DICOM_APPLICATION_REQUESTOR, "random.dat");
+  NET_REQUESTOR, "random.dat");
 
 if (TCS_ok != tLayer->setPrivateKeyFile("privkey.pem", SSL_FILETYPE_PEM))
 {
@@ -43,8 +45,9 @@ if (TCS_ok != tLayer->setCertificateFile("certificate.pem", SSL_FILETYPE_PEM))
   return;
 }
 
-// enable the TLS_RSA_WITH_3DES_EDE_CBC_SHA ciphersuite
-tLayer->setCipherSuites(SSL3_TXT_RSA_DES_192_CBC3_SHA);
+// enable the ciphersuites for the BCP 195 secure transport profile
+tLayer->setTLSProfile(TSP_Profile_BCP195);
+tLayer->activateCipherSuites();
 
 // accept any certificate from the remote site (not recommended)
 tLayer->setCertificateVerification(DCV_ignoreCertificate);
index ca35713884c22a8c26035f88a86c318095bb2758..f3bbeca738061263df960ed7a0a07b84f50c34b2 100644 (file)
@@ -72,7 +72,7 @@ file "randseed.bin" that can be used to seed the OpenSSL PRNG:
 4. Pseudo Random Number Generator Daemon (PRNGD)
 
 Pseudo Random Number Generator Daemon is a user space application that
-"offers an EGD compatible interface to obtain random data and is intented to
+"offers an EGD compatible interface to obtain random data and is intended to
 be used as an entropy source to feed other software, especially software
 based on OpenSSL. Like EGD it calls system programs to collect entropy.
 Unlike EGD it does not generate a pool of random bits that can be called
index 316fa4f621652cc68e7378622ae6569b5e0a7d51..9f0120d81ff073d0d4792c7d9a2fdd7a0150a66b 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmtls DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmtls DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
diff --git a/dcmtls/include/dcmtk/dcmtls/tlsciphr.h b/dcmtls/include/dcmtk/dcmtls/tlsciphr.h
new file mode 100644 (file)
index 0000000..f5e64e3
--- /dev/null
@@ -0,0 +1,398 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module: dcmtls
+ *
+ *  Author: Marco Eichelberg
+ *
+ *  Purpose:
+ *    classes: DcmTLSCiphersuiteHandler
+ *
+ */
+
+#ifndef TLSCIPHR_H
+#define TLSCIPHR_H
+
+#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
+
+#ifdef WITH_OPENSSL
+
+#include "dcmtk/ofstd/ofstring.h"     /* for class OFString */
+#include "dcmtk/ofstd/ofstream.h"     /* for class ostream */
+#include "dcmtk/ofstd/ofvector.h"     /* for class OFVector */
+#include "dcmtk/dcmtls/tlsdefin.h"    /* for DCMTK_DCMTLS_EXPORT */
+#include "dcmtk/dcmnet/dcmlayer.h"    /* for DcmTransportLayerStatus */
+
+// include this file in doxygen documentation
+
+/** @file tlsciphr.h
+ *  @brief type definitions and classes for TLS ciphersuites
+ */
+
+/** This enum describes DICOM TLS Security Profiles, which are the basis
+ *  for the selection of supported ciphersuites when using DICOM over TLS.
+ *  @remark This enum is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
+ */
+enum DcmTLSSecurityProfile
+{
+  /// No security profile, start with an empty list of ciphersuites
+  TSP_Profile_None,
+
+  /** DICOM Basic TLS Secure Transport Connection Profile (retired),
+    * using the ciphersuite TLS_RSA_WITH_3DES_EDE_CBC_SHA and TLS 1.0 or newer.
+    */
+  TSP_Profile_Basic,
+
+  /** DICOM AES TLS Secure Transport Connection Profile (retired),
+    * using the ciphersuites TLS_RSA_WITH_AES_128_CBC_SHA and TLS_RSA_WITH_3DES_EDE_CBC_SHA,
+    * and TLS 1.0 or newer.
+    */
+  TSP_Profile_AES,
+
+  /** DICOM BCP 195 TLS Profile, based on RFC 7525.
+   *  This profile tries to negotiate TLS 1.2 or newer, but may fall back to previous
+   *  protocol versions up to TLS 1.0. It supports four TLS 1.2 specific ciphersuites
+   *  (TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+   *  TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384)
+   *  but also the ciphersuites of the AES and Basic Profile, thus providing
+   *  backward compatibility with older implementations while offering much
+   *  better security when used with implementations also supporting one of the
+   *  BCP 195 profiles.
+   */
+  TSP_Profile_BCP195,
+
+  /** DICOM Non-downgrading BCP 195 TLS Profile, based on RFC 7525.
+   *  This profile only negotiates TLS 1.2 or newer, and will not fall back to
+   *  previous TLS versions. It supports four ciphersuites:
+   *  TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+   *  TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384.
+   *  It does not provide backwards compatibility with the older Basic and AES profiles,
+   *  and thus guarantees the higher security level of BCP 195.
+   */
+  TSP_Profile_BCP195_ND,
+
+  /** IHE ATNA Profile for Unencrypted In-house Communication (retired).
+   * This profile uses the ciphersuite SSL_RSA_WITH_NULL_SHA and TLS 1.0 or newer.
+   * This ciphersuite offers peer authentication and integrity of communication,
+   * but no encryption (i.e. no confidentiality), and is thus only suitable for use
+   * over a secure infrastructure. This was used in older versions of the
+   * IHE Audit Trail and Node Authentication (ATNA) integration profile,
+   * but has been retired.
+   */
+  TSP_Profile_IHE_ATNA_Unencrypted
+
+};
+
+
+/** This enum describes the minimum SSL/TLS protocol version required
+ *  for a certain ciphersuite.
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
+ */
+enum DcmTLSCipherProtocolVersion
+{
+  /// Secure Socket Layer (SSL) version 3 or newer
+  TPV_SSLv3,
+  /// Transport Layer Security (TLS) version 1.2 or newer
+  TPV_TLSv12
+};
+
+
+/** This enum describes the key exchange protocol used in a certain
+ *  TLS ciphersuite.
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
+ */
+enum DcmTLSCipherKeyExchange
+{
+  /// Static RSA key exchange
+  TKE_RSA,
+
+  /// Elliptic Curve Diffie–Hellman
+  TKE_ECDH,
+
+  /// Fixed ECDH with ECDSA-signed certificates
+  TKE_ECDH_ECDSA,
+
+  /// Fixed ECDH with RSA signatures
+  TKE_ECDH_RSA,
+
+  /// Diffie–Hellman key exchange
+  TKE_DH
+
+};
+
+
+/** This enum describes the authentication mechanism
+ *  used in a certain TLS ciphersuite.
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
+ */
+enum DcmTLSCipherAuthentication
+{
+  /// Digital Signature Standard
+  TCA_DSS,
+
+  /// Elliptic Curve Diffie–Hellman
+  TCA_ECDH,
+
+  /// Elliptic Curve Digital Signature Algorithm
+  TCA_ECDSA,
+
+  /// RSA
+  TCA_RSA
+};
+
+
+/** This enum describes the symmetric encryption algorithm
+ *  (bulk cipher) used in a certain TLS ciphersuite.
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
+ */
+enum DcmTLSCipherEncryption
+{
+  /// No encryption
+  TCE_None,
+
+  /// Triple DES in Cipher Block Chaining (CBC) mode
+  TCE_3DES,
+
+  /// Advanced Encryption Standard (AES) in Cipher Block Chaining (CBC) mode
+  TCE_AES,
+
+  /// Advanced Encryption Standard (AES) in Galois/Counter Mode (GCM)
+  TCE_AESGCM,
+
+  /// Camellia (RFC 3713) in Cipher Block Chaining (CBC) mode
+  TCE_Camellia,
+
+  /// ChaCha20-Poly1305 in Galois/Counter Mode (GCM)
+  TCE_ChaCha20
+};
+
+
+/** This enum describes the message authentication code (MAC)
+ *  used in a certain TLS ciphersuite.
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
+ */
+enum DcmTLSCipherMAC
+{
+  /// Secure Hash Algorithm SHA-1
+  TCM_SHA1,
+
+  /// Secure Hash Algorithm SHA-2 in 256 bit mode
+  TCM_SHA256,
+
+  /// Secure Hash Algorithm SHA-2 in 384 bit mode
+  TCM_SHA384,
+
+  /// Authenticated Encryption with Associated Data (AEAD)
+  TCM_AEAD
+
+};
+
+
+/** This helper class manages the list of TLS ciphersuites supported by DCMTK,
+ *  translates DcmTLSSecurityProfile enums into the corresponding sets of
+ *  ciphersuites, and permits translation between the official TLS ciphersuite
+ *  names (as used in DCMTK) and the corresponding internal OpenSSL name.
+ *  @remark This class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
+ */
+class DCMTK_DCMTLS_EXPORT DcmTLSCiphersuiteHandler
+{
+public:
+
+  /** constructor. The constructor assumes that the OpenSSL library
+   *  has already been initialized. This should be ensured prior to creating
+   *  any DcmTLSCiphersuiteHandler instance by calling
+   *  DcmTLSTransportLayer::initializeOpenSSL(). This only needs to be done once.
+   */
+  DcmTLSCiphersuiteHandler();
+
+  /// destructor
+  virtual ~DcmTLSCiphersuiteHandler();
+
+  /** replace the current list of ciphersuites by the list of ciphersuites
+   *  for the given profile.
+   *  @param profile TLS Security Profile
+   *  @return TCS_ok if successful, an error code otherwise
+   */
+  DcmTransportLayerStatus setTLSProfile(DcmTLSSecurityProfile profile);
+
+  /** clear the current list of ciphersuites. Equivalent to
+   *  calling setTLSProfile(TSP_Profile_None).
+   */
+  void clearTLSProfile();
+
+  /** adds a ciphersuite to the list of ciphersuites for TLS negotiation.
+   *  It is the responsibility of the user to ensure that the added ciphersuite
+   *  does not break the rules of the selected profile. Use with care!
+   *  @param suite TLS ciphersuite name, in the official TLS name form.
+   *  @return TCS_ok if successful, an error code otherwise
+   */
+  DcmTransportLayerStatus addCipherSuite(const char *suite);
+
+  /** returns a string in OpenSSL syntax that contains the currently defined
+   *  list of TLS ciphersuites.
+   *  @param cslist The list of ciphersuites in OpenSSL syntax is written to this string.
+   *  @param isServer true if the list of cipher suites is intended for
+   *    a TLS server. In this case, the list of ciphersuites will be reordered
+   *    from strongest to weakest, as recommended by BCP 195.
+   */
+  void getListOfCipherSuitesForOpenSSL(OFString& cslist, OFBool isServer) const;
+
+  /** returns the set of flags that need to be activated in OpenSSL
+   *  depending on the selected TLS profile.
+   *  @return flags for openssl
+   */
+  long getTLSOptions() const;
+
+  /** checks if the 3DES ciphersuite TLS_RSA_WITH_3DES_EDE_CBC_SHA
+   *  is supported by the underlying OpenSSL library (which newer versions
+   *  only do if compiled with "weak ciphers" enabled).
+   *  @return true if we support 3DES, false otherwise
+   */
+  OFBool cipher3DESsupported() const;
+
+  /** checks if the unencrypted ciphersuite TLS_RSA_WITH_NULL_SHA
+   *  is supported by the underlying OpenSSL library (which newer versions
+   *  only do if compiled with "weak ciphers" enabled).
+   *  @return true if we support unencrypted TLS, false otherwise
+   */
+  OFBool cipherNULLsupported() const;
+
+  /** print a list of supported ciphersuites to the given output stream
+   *  @param os output stream
+   */
+  void printSupportedCiphersuites(STD_NAMESPACE ostream& os) const;
+
+  /** returns the number of known ciphersuites.
+   *  @return number of known ciphersuites
+   */
+  static size_t getNumberOfCipherSuites();
+
+  /** looks up the index of the given ciphersuite by name
+   *  @param tlsCipherSuiteName ciphersuite name in RFC 2246 form
+   *  @returns index into list of ciphersuites, DcmTLSCiphersuiteHandler::unknownCipherSuiteIndex if ciphersuite unknown
+   */
+  static size_t lookupCiphersuite(const char *tlsCipherSuiteName);
+
+  /** looks up the index of the given ciphersuite by OpenSSL name
+   *  @param tlsCipherSuiteName ciphersuite name in the form used by OpenSSL
+   *  @returns index into list of ciphersuites, DcmTLSCiphersuiteHandler::unknownCipherSuiteIndex if ciphersuite unknown
+   */
+  static size_t lookupCiphersuiteByOpenSSLName(const char *opensslCipherSuiteName);
+
+  /** returns a ciphersuite name in RFC 2246 (TLS) form
+   *  @param idx index, must be < getNumberOfCipherSuites()
+   *  @return ciphersuite name
+   */
+  static const char *getTLSCipherSuiteName(size_t idx);
+
+  /** returns a ciphersuite name in OpenSSL form
+   *  @param idx index, must be < getNumberOfCipherSuites()
+   *  @return ciphersuite name
+   */
+  static const char *getOpenSSLCipherSuiteName(size_t idx);
+
+  /** returns the minimum SSL/TLS version required for the ciphersuite with the given index
+   *  @param idx index, must be < getNumberOfCipherSuites()
+   *  @return minimum SSL/TLS version required
+   */
+  static DcmTLSCipherProtocolVersion getCipherSuiteProtocolVersion(size_t idx);
+
+  /** returns the key exchange protocol used by the ciphersuite with the given index
+   *  @param idx index, must be < getNumberOfCipherSuites()
+   *  @return key exchange protocol
+   */
+  static DcmTLSCipherKeyExchange getCipherSuiteKeyExchange(size_t idx);
+
+  /** returns the authentication algorithm used by the ciphersuite with the given index
+   *  @param idx index, must be < getNumberOfCipherSuites()
+   *  @return authentication algorithm
+   */
+  static DcmTLSCipherAuthentication getCipherSuiteAuthentication(size_t idx);
+
+  /** returns the encryption algorithm used by  the ciphersuite with the given index
+   *  @param idx index, must be < getNumberOfCipherSuites()
+   *  @return minimum SSL/TLS version required
+   */
+  static DcmTLSCipherEncryption getCipherSuiteEncryption(size_t idx);
+
+  /** returns the message authentication code (MAC) algorithm used by  the ciphersuite with the given index
+   *  @param idx index, must be < getNumberOfCipherSuites()
+   *  @return message authentication code (MAC) algorithm
+   */
+  static DcmTLSCipherMAC getCipherSuiteMAC(size_t idx);
+
+  /** returns the symmetric key size used by the ciphersuite with the given index
+   *  @param idx index, must be < getNumberOfCipherSuites()
+   *  @return symmetric key size, in bits
+   */
+  static size_t getCipherSuiteKeySize(size_t idx);
+
+  /** returns the effective symmetric key size (i.e. security level) of the ciphersuite with the given index.
+   *  BCP 195 (2015) recommends that no ciphersuites with an effective key size of less than 112 bits should be used anymore with TLS.
+   *  @param idx index, must be < getNumberOfCipherSuites()
+   *  @return effective symmetric key size, in bits
+   */
+  static size_t getCipherSuiteEffectiveKeySize(size_t idx);
+
+  /** look up the name of the given security profile
+   *  @return name of security profile, never NULL.
+   */
+  static const char *lookupProfileName(DcmTLSSecurityProfile profile);
+
+  /// constant returned by findOpenSSLCipherSuiteName() if ciphersuite name is unknown
+  static const size_t unknownCipherSuiteIndex;
+
+private:
+
+  /// private undefined copy constructor
+  DcmTLSCiphersuiteHandler(const DcmTLSCiphersuiteHandler&);
+
+  /// private undefined assignment operator
+  DcmTLSCiphersuiteHandler& operator=(const DcmTLSCiphersuiteHandler&);
+
+  /** determine the set of ciphersuites that are supported both by DCMTK
+   *  and the OpenSSL library we are currently using
+   */
+  void determineSupportedCiphers();
+
+  /** add ciphersuite by name, print error if unsupported
+   *  @param name ciphersuite name in RFC 2246 form
+   *  @return TCS_ok if successful, an error code otherwise
+   */
+  DcmTransportLayerStatus addRequiredCipherSuite(const char *name);
+
+  /** add 3DES ciphersuite, print warning if unsupported
+   */
+  void addOptional3DESCipherSuite();
+
+  /// current list of ciphersuites
+  OFVector<size_t> ciphersuiteList;
+
+  /// currently selected DICOM TLS security profile
+  DcmTLSSecurityProfile currentProfile;
+
+  /** an array of booleans indicating which ciphersuites known to DCMTK are
+   *  actually supported by the OpenSSL library we are using.
+   */
+  OFBool *ciphersuiteSupported;
+};
+
+#endif /* WITH_OPENSSL */
+#endif /* TLSCIPHR_H */
index da53700fcb7da26ac9c5616f5ac63482c5ebc2de..0d9c06ddc26016f17809d3142dda6c3061a6bfde 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 #include "dcmtk/dcmnet/dcmlayer.h"    /* for DcmTransportLayer */
-#include "dcmtk/ofstd/ofstream.h"    /* for ostream */
+#include "dcmtk/dcmnet/assoc.h"       /* for T_ASC_NetworkRole */
+#include "dcmtk/ofstd/ofstream.h"     /* for ostream */
 #include "dcmtk/oflog/oflog.h"
 #include "dcmtk/dcmtls/tlsdefin.h"
+#include "dcmtk/dcmtls/tlsciphr.h"    /* for DcmTLSCiphersuiteHandler */
 
 #ifdef WITH_OPENSSL
-BEGIN_EXTERN_C
-#include <openssl/ssl.h>
-END_EXTERN_C
+
+// forward declarations of OpenSSL data structures
+struct ssl_ctx_st;
+typedef struct ssl_ctx_st SSL_CTX;
+
+struct x509_st;
+typedef struct x509_st X509;
 
 extern DCMTK_DCMTLS_EXPORT OFLogger DCM_dcmtlsLogger;
 
@@ -43,9 +49,18 @@ extern DCMTK_DCMTLS_EXPORT OFLogger DCM_dcmtlsLogger;
 #define DCMTLS_ERROR(msg) OFLOG_ERROR(DCM_dcmtlsLogger, msg)
 #define DCMTLS_FATAL(msg) OFLOG_FATAL(DCM_dcmtlsLogger, msg)
 
+// include this file in doxygen documentation
+
+/** @file tlslayer.h
+ *  @brief type definitions and classes for TLS transport connections
+ */
+
+
 /** this enum describes how to handle X.509 certificates on a TLS based
  *  secure transport connection. They can be ignored, validated if present
  *  or validated and demanded.
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 enum DcmCertificateVerification
 {
@@ -63,11 +78,29 @@ enum DcmCertificateVerification
 };
 
 
+/** this enum describes the file format of a certificate or private key file.
+ *  @remark this enum is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
+ */
+enum DcmKeyFileFormat
+{
+ /** PEM (Privacy Enhanced Mail) format
+  */
+ DCF_Filetype_PEM,
+
+ /** ASN.1 (Abstract Syntax Notation One) format
+  */
+ DCF_Filetype_ASN1
+};
+
+
 /** factory class which creates secure TLS transport layer connections
  *  and maintains the parameters common to all TLS transport connections
  *  in one application (e.g. the pool of trusted certificates, the key
  *  and certificate to be used for authentication and the list of
  *  ciphersuite to be used for association negotiation.
+ *  @remark this class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 
 class DCMTK_DCMTLS_EXPORT DcmTLSTransportLayer: public DcmTransportLayer
@@ -87,15 +120,14 @@ public:
   DcmTLSTransportLayer();
 
   /** constructor.
-   *  @param networkRole network role to be used by the application, influences
-   *    the choice of the secure transport layer code.
+   *  @param networkRole network role to be used by the application
    *  @param randFile path to file used to feed the random generator
    *  @param initializeOpenSSL Determines if OpenSSL library should be initialized.
    *    Some setups (e.g. multi-threaded environments) may be interested in using
    *    more than one TLS transport layer at a time and thus must make sure the
    *    library is only initialized once.
    */
-  DcmTLSTransportLayer(int networkRole, const char *randFile, OFBool initializeOpenSSL = OFTrue);
+  DcmTLSTransportLayer(T_ASC_NetworkRole networkRole, const char *randFile, OFBool initializeOpenSSL);
 
   /** move constructor.
    *  Transfer ownership from another DcmTLSTransportLayer object to the newly
@@ -138,7 +170,7 @@ public:
 
   /** Query whether this object has not been initialized, e.g. has been
    *  constructed using the default constructor or the initialization failed.
-   *  @return OFTrue if *this ist not initialized, OFFalse otherwise.
+   *  @return OFTrue if *this is not initialized, OFFalse otherwise.
    */
   OFBool operator!() const;
 
@@ -147,7 +179,7 @@ public:
    *  or a secure connection is established.  If the object cannot be created
    *  (e. g. because no secure layer is available), returns NULL.
    *  @param openSocket TCP/IP socket to be used for the transport connection.
-   *    the connection must already be establised on socket level. If a non-null
+   *    the connection must already be established on socket level. If a non-null
    *    pointer is returned, the new connection object takes over control of the socket.
    *  @param useSecureLayer if true, a secure layer is used. If false, a
    *    transparent layer is used.
@@ -160,14 +192,14 @@ public:
    *  @param fileType, must be SSL_FILETYPE_PEM or SSL_FILETYPE_ASN1
    *  @return TCS_ok if successful, an error code otherwise
    */
-  DcmTransportLayerStatus setPrivateKeyFile(const char *fileName, int fileType);
+  DcmTransportLayerStatus setPrivateKeyFile(const char *fileName, DcmKeyFileFormat fileType);
 
   /** loads the certificate (public key) used for authentication of this application from a file.
    *  @param fileName path to the certificate file
    *  @param fileType, must be SSL_FILETYPE_PEM or SSL_FILETYPE_ASN1
    *  @return TCS_ok if successful, an error code otherwise
    */
-  DcmTransportLayerStatus setCertificateFile(const char *fileName, int fileType);
+  DcmTransportLayerStatus setCertificateFile(const char *fileName, DcmKeyFileFormat fileType);
 
   /** checks if the private key and the certificate set using setPrivateKeyFile()
    *  and setCertificateFile() match, i.e. if they establish a private/public key pair.
@@ -180,7 +212,7 @@ public:
    *  @param fileType, must be SSL_FILETYPE_PEM or SSL_FILETYPE_ASN1
    *  @return TCS_ok if successful, an error code otherwise
    */
-  DcmTransportLayerStatus addTrustedCertificateFile(const char *fileName, int fileType);
+  DcmTransportLayerStatus addTrustedCertificateFile(const char *fileName, DcmKeyFileFormat fileType);
 
   /** loads all files as certificates from the specified directory and adds them
    *  to the pool of trusted certificates.
@@ -188,7 +220,7 @@ public:
    *  @param fileType, must be SSL_FILETYPE_PEM or SSL_FILETYPE_ASN1
    *  @return TCS_ok if successful, an error code otherwise
    */
-  DcmTransportLayerStatus addTrustedCertificateDir(const char *pathName, int fileType);
+  DcmTransportLayerStatus addTrustedCertificateDir(const char *pathName, DcmKeyFileFormat fileType);
 
   /** loads certificates from a file and adds them to the pool of trusted client
    *  certificates.
@@ -208,37 +240,32 @@ public:
    */
   DcmTransportLayerStatus addVerificationFlags(unsigned long flags);
 
-  /** sets the list of ciphersuites to negotiate.
-   *  @param suites string containing the list of ciphersuites.
-   *    The list must be in OpenSSL syntax (use findOpenSSLCipherSuiteName to convert
-   *    from RFC 2246 ciphersuite names to OpenSSL names), with ciphersuites separated
-   *    by ':' characters.
+  /** replace the current list of ciphersuites by the list of ciphersuites
+   *  for the given profile.
+   *  @param profile TLS Security Profile
    *  @return TCS_ok if successful, an error code otherwise
    */
-  DcmTransportLayerStatus setCipherSuites(const char *suites);
+  DcmTransportLayerStatus setTLSProfile(DcmTLSSecurityProfile profile);
 
-  /** returns the number of known ciphersuites.
-   *  @return number of known ciphersuites
+  /** clear the current list of ciphersuites. Equivalent to
+   *  calling setTLSProfile(TSP_Profile_None).
    */
-  static unsigned long getNumberOfCipherSuites();
+  void clearTLSProfile();
 
-  /** returns a ciphersuite name in RFC 2246 (TLS) form
-   *  @param idx index, must be < getNumberOfCipherSuites()
-   *  @return ciphersuite name
-   */
-  static const char *getTLSCipherSuiteName(unsigned long idx);
-
-  /** returns a ciphersuite name in OpenSSL form
-   *  @param idx index, must be < getNumberOfCipherSuites()
-   *  @return ciphersuite name
+  /** adds a ciphersuite to the list of ciphersuites for TLS negotiation.
+   *  It is the responsibility of the user to ensure that the added ciphersuite
+   *  does not break the rules of the selected profile. Use with care!
+   *  @param suite TLS ciphersuite name, in the official TLS name form.
+   *  @return TCS_ok if successful, an error code otherwise
    */
-  static const char *getOpenSSLCipherSuiteName(unsigned long idx);
+  DcmTransportLayerStatus addCipherSuite(const char *suite);
 
-  /** finds the OpenSSL ciphersuite name for a given RFC 2246 ciphersuite name.
-   *  @param tlsCipherSuiteName ciphersuite name in RFC 2246 form
-   *  @returns ciphersuite name in OpenSSL form, NULL if unknown.
+  /** activate the current list of ciphersuites by transferring to the OpenSSL layer
+   *  This method needs to be called once after the list of ciphersuites has been
+   *  defined used setTLSProfile() and addCipherSuite().
+   *  @return TCS_ok if successful, an error code otherwise
    */
-  static const char *findOpenSSLCipherSuiteName(const char *tlsCipherSuiteName);
+  DcmTransportLayerStatus activateCipherSuites();
 
   /** checks if enough entropy data is available to write back a modified
    *  random seed file.
@@ -295,12 +322,57 @@ public:
    */
   OFBool setTempDHParameters(const char *filename);
 
+  /** print a list of supported ciphersuites to the given output stream.
+   *  @param os output stream
+   */
+  void printSupportedCiphersuites(STD_NAMESPACE ostream& os) const;
+
+  /** Initialize OpenSSL Library. This function is THREAD UNSAFE
+   *  and should only be called once to initialize the OpenSSL library.
+   */
+  static void initializeOpenSSL();
+
   /** gets the most important attributes of the given X.509 certificate.
    *  @param peerCertificate X.509 certificate, may be NULL
    *  @return a string describing the certificate
    */
   static OFString dumpX509Certificate(X509 *peerCertificate);
 
+  /** gets the size of the public key of an RSA certificate.
+   *  @param certificate X.509 certificate
+   *  @return public key size (in bits) if RSA certificate, 0 otherwise.
+   */
+  static int getRSAKeySize(X509 *certificate);
+
+  /** checks the BCP 195 recommendations that RSA certificates
+   *  should use SHA-256 hash keys. We also accept better SHA-2
+   *  hash keys (SHA-384 and SHA-512).
+   *  @param certificate X.509 certificate
+   *  @return NULL if everything is OK (i.e. the certificate is
+   *    not RSA, or it is RSA and uses SHA-256 or better),
+   *    the name of the hash key algorithm used otherwise.
+   */
+  static const char *checkRSAHashKeyIsSHA2(X509 *certificate);
+
+  /** returns the version name of the OpenSSL version used.
+   *  @return OpenSSL version name, never NULL.
+   */
+  static const char *getOpenSSLVersionName();
+
+  /** load an X.509 certificate from file.
+   *  @param fileName path to the certificate file
+   *  @param fileType, must be SSL_FILETYPE_PEM or SSL_FILETYPE_ASN1
+   *  @return pointer to X509 object if successful, NULL otherwise.
+   *    The X509 object must be freed by the caller.
+   */
+  static X509 *loadCertificateFile(const char *fileName, DcmKeyFileFormat fileType);
+
+  /** returns a string in OpenSSL syntax that contains the currently defined
+   *  list of TLS ciphersuites.
+   *  @param cslist The list of ciphersuites in OpenSSL syntax is written to this string.
+   */
+  void getListOfCipherSuitesForOpenSSL(OFString& cslist) const;
+
   /** provides access to the underlying OpenSSL context handle for implementing
    *  custom functionality not accessible by the existing member functions of
    *  DcmTLSTransportLayer.
@@ -332,6 +404,12 @@ private:
   /// private undefined assignment operator
   DcmTLSTransportLayer& operator=(const DcmTLSTransportLayer&);
 
+  /** look up OpenSSL certificate format constant
+   *  @param fileType as DcmKeyFileFormat enum
+   *  @return fileType as OpenSSL integer constant
+   */
+  static int lookupOpenSSLCertificateFormat(DcmKeyFileFormat fileType);
+
   /// OpenSSL context data, needed only once per application
   SSL_CTX *transportLayerContext;
 
@@ -341,16 +419,11 @@ private:
   /// contains the password for the private key if set on command line
   OFString privateKeyPasswd;
 
-};
-
-#else /* WITH_OPENSSL */
+  /// ciphersuite handler
+  DcmTLSCiphersuiteHandler ciphersuites;
 
-// trivial declaration of DcmTLSTransportLayer as a placeholder
-class DCMTK_DCMTLS_EXPORT DcmTLSTransportLayer : public DcmTransportLayer
-{
-public:
-  inline DcmTLSTransportLayer(OFrvalue_ref(DcmTLSTransportLayer) /* rhs */) {}
-  inline DcmTLSTransportLayer& operator=(OFrvalue_ref(DcmTLSTransportLayer) /* rhs */) { return *this; }
+  /// network role for this TLS layer
+  T_ASC_NetworkRole role;
 };
 
 #endif /* WITH_OPENSSL */
index cabe4149875ce0161b24dcd5daa54ed88af08431..318751f307bb38e6471cc774045743084f356138 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, OFFIS e.V.
+ *  Copyright (C) 2017-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -13,7 +13,7 @@
  *
  *  Module: dcmtls
  *
- *  Author: Jan Schlamelcher
+ *  Author: Jan Schlamelcher, Marco Eichelberg
  *
  *  Purpose:
  *    classes: DcmTLSOptions
 #define TLSOPT_H
 
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
+#include "dcmtk/ofstd/ofstream.h"     /* for ostream */
+#include "dcmtk/dcmtls/tlslayer.h"    /* for DcmTLSTransportLayer */
 
-#include "dcmtk/ofstd/ofvriant.h"
-#include "dcmtk/dcmtls/tlslayer.h"
+class OFConsoleApplication;
+class OFCommandLine;
+class DcmTLSTransportLayer;
+struct T_ASC_Network;
+struct T_ASC_Parameters;
 
 /** A class that handles the command line arguments used by applications
  *  that support TLS.
@@ -39,69 +44,157 @@ class DCMTK_DCMTLS_EXPORT DcmTLSOptions
 {
 public:
 
-    /** Print OpenSSL library version string.
-     *  Does nothing if OpenSSL is not available.
+    /** Constructor.
+     *  @param networkRole the network role to create a transport layer for
      */
-    static void printLibraryVersion();
+    DcmTLSOptions(T_ASC_NetworkRole networkRole);
 
-    /** Constructor.
-     *  @param app a reference to an OFConsoleApplication object used in the
-     *    calling application.
+    /// Destructor
+    virtual ~DcmTLSOptions();
+
+    /** Add TLS specific command line options to the OFCommandLine object
+     *  passed to the constructor.
      *  @param cmd a reference to an OFCommandLine object used to parse
      *    the command line argument give to the calling application.
      */
-    DcmTLSOptions( class OFConsoleApplication& app, class OFCommandLine& cmd );
+    void addTLSCommandlineOptions(OFCommandLine& cmd);
 
     /** Parse and evaluate the given command line arguments.
-     *  @return EC_Normal on success, an error condition indicating what went
-     *    wrong if any invalid argument was encountered, e.g. a selected
-     *    ciphersuite is not supported.
+     *  @param app a reference to an OFConsoleApplication object used in the
+     *    calling application.
+     *  @param cmd a reference to an OFCommandLine object used to parse
+     *    the command line argument give to the calling application.
      */
-    OFCondition parseArguments();
+    void parseArguments(OFConsoleApplication& app, OFCommandLine& cmd);
 
     /** Create a DcmTLSTransportLayer object based on the collected command
      *  line arguments.
-     *  @param networkRole the network role to create a transport layer for,
-     *    DICOM_APPLICATION_ACCEPTOR or DICOM_APPLICATION_REQUESTOR.
-     *  @return Either a newly created DcmTLSTransportLayer object or an
-     *    OFCondition indicating why no DcmTLSTransportLayer object was created.
-     *    There are two possible reasons why this might happen: either the
-     *    given command line arguments did not request to use a secure transport
-     *    layer - in this case EC_Normal will be returned indicating one should
-     *    simply ignore the result - or an error occurred when trying to create
-     *    the DcmTLSTransport layer. In the latter case the returned OFCondition
-     *    will contain an error condition describing what went wrong.
+     *  @param net pointer to network object in which the transport layer
+     *    should be registered. May be NULL, in which case the caller
+     *    must activate the transport layer manually using ASC_setTransportLayer().
+     *  @param params pointer to the association negotiation parameters object.
+     *    For an association acceptor, this parameter is passed as NULL.
+     *    If NULL is passed and the caller in an association requestor,
+     *    then it is the responsibility of the caller to call ASC_setTransportLayerType()
+     *    and set the right transport layer type for the association parameters.
+     *  @param app a reference to an OFConsoleApplication object used in the
+     *    calling application.
+     *  @param cmd a reference to an OFCommandLine object used to parse
+     *    the command line argument give to the calling application.
+     *  @return EC_Normal if successful, an error code otherwise
      */
-    OFrvalue<OFvariant<OFCondition,DcmTLSTransportLayer> >
-    createTransportLayer( int networkRole );
+    OFCondition createTransportLayer(
+      T_ASC_Network *net,
+      T_ASC_Parameters *params,
+      OFConsoleApplication& app,
+      OFCommandLine& cmd);
 
     /** Update the random seed file if this was requested by the given command
      *  line arguments.
-     *  @param layer a reference to a DcmTLSTransportLayer object that contains
-     *    the information for updating the random seed file, e.g. created via
-     *    createTransportLayer().
      *  @return EC_Normal if the random seed file was successfully updated or
      *    if the user did not request the random seed file to be update. An
      *    error condition indicating what went wrong in case the random seed
      *    file could not be updated.
      */
-    OFCondition writeRandomSeedFileIfEnabled( DcmTLSTransportLayer& layer );
+    OFCondition writeRandomSeed();
+
+    /** Returns true if a secure connection was requested, false otherwise.
+     *  Caller must ensure that parseArguments() has been run before this method.
+     *  @return true if secure connection requested, false otherwise
+     */
+    OFBool secureConnectionRequested() const;
+
+    /** Returns a pointer to the transport layer object, or NULL if the object
+     *  has not yet been created by a call to createTransportLayer().
+     *  @return pointer to transport layer object, may be NULL.
+     */
+    DcmTLSTransportLayer *getTransportLayer();
+
+    /** checks if the command line option --list-ciphers was given.
+     *  In this case the list of supported TLS ciphersuites should be
+     *  printed to stdout and the application should terminate.
+     *  @return true if --list-ciphers option was found, false otherwise.
+     */
+    static OFBool listOfCiphersRequested(OFCommandLine& cmd);
+
+    /** print a list of supported ciphersuites to the given output stream
+     *  @param app a reference to an OFConsoleApplication object used in the
+     *    calling application.
+     *  @param os output stream
+     */
+    static void printSupportedCiphersuites(OFConsoleApplication& app, STD_NAMESPACE ostream& os);
+
+    /** Print OpenSSL library version string.
+     *  Does nothing if OpenSSL is not available.
+     */
+    static void printLibraryVersion();
 
 private:
 #ifdef WITH_OPENSSL
-    class OFConsoleApplication& m_ConsoleApp;
-    class OFCommandLine& m_CommandLine;
-    int         opt_keyFileFormat;
-    OFBool      opt_doAuthenticate;
+    /// flag indicating the file format of certificates and private keys: PEM or ASN.1
+    /// @remark this member is only available if DCMTK is compiled with
+    /// OpenSSL support enabled.
+    DcmKeyFileFormat opt_keyFileFormat;
+
+    /// flag indicating whether we will authenticate ourselves using a certificate and private key
+    /// @remark this member is only available if DCMTK is compiled with
+    /// OpenSSL support enabled.
+    OFBool opt_doAuthenticate;
+
+    /// filename of private key file we use to authenticate ourselves
+    /// @remark this member is only available if DCMTK is compiled with
+    /// OpenSSL support enabled.
     const char* opt_privateKeyFile;
+
+    /// filename of certificate file we use to authenticate ourselves
+    /// @remark this member is only available if DCMTK is compiled with
+    /// OpenSSL support enabled.
     const char* opt_certificateFile;
+
+    /** password for reading the private key file, may be NULL.
+     *  In this case the password is read from STDIN.
+     *  @remark this member is only available if DCMTK is compiled with
+     *  OpenSSL support enabled.
+     */
     const char* opt_passwd;
-    OFString    opt_ciphersuites;
+
+    /// DICOM TLS Security Profile selected
+    /// @remark this member is only available if DCMTK is compiled with
+    /// OpenSSL support enabled.
+    DcmTLSSecurityProfile opt_tlsProfile;
+
+    /// filename of file containing at least 1K of entropy used to seed the PRNG
+    /// @remark this member is only available if DCMTK is compiled with
+    /// OpenSSL support enabled.
     const char* opt_readSeedFile;
+
+    /// filename to which the modified PRNG state is written back
+    /// @remark this member is only available if DCMTK is compiled with
+    /// OpenSSL support enabled.
     const char* opt_writeSeedFile;
+
+    /// indicates whether we should verify the remote peer's certificate
+    /// @remark this member is only available if DCMTK is compiled with
+    /// OpenSSL support enabled.
     DcmCertificateVerification opt_certVerification;
+
+    /// filename of Diffie-Hellman parameters file, may be NULL
+    /// @remark this member is only available if DCMTK is compiled with
+    /// OpenSSL support enabled.
     const char* opt_dhparam;
+
+    /// a flag indicating whether or not a secure connection was requested
+    /// @remark this member is only available if DCMTK is compiled with
+    /// OpenSSL support enabled.
     OFBool opt_secureConnection;
+
+    /// indicates whether we act as client, server or both
+    T_ASC_NetworkRole opt_networkRole;
+
+    /// pointer to the secure transport layer managed by this object
+    /// @remark this member is only available if DCMTK is compiled with
+    /// OpenSSL support enabled.
+    DcmTLSTransportLayer *tLayer;
 #endif // WITH_OPENSSL
 };
 
index 0b8eefa038a653d23f29fa8614762e3398384281..15e82a6a933434eeb77d76d677f730540325643a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2010-2017, OFFIS e.V.
+ *  Copyright (C) 2010-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 #include "dcmtk/dcmtls/tlslayer.h"
 #include "dcmtk/dcmtls/tlsdefin.h"
 
-
 /** Base class for implementing DICOM TLS-enabled Service Class User functionality. This
  *  class is derived from the general DcmSCU class and just adds the corresponding TLS
  *  capabilities.
+ *  @remark This class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  *  @warning This class is EXPERIMENTAL. Be careful to use it in production environment.
  *  API changes in the future are possible and likely to happen.
  */
@@ -102,18 +103,29 @@ public:
   virtual void enableAuthentication(const OFString& privateKey,
                                     const OFString& certFile,
                                     const char* passphrase = NULL,
-                                    const int privKeyFormat = SSL_FILETYPE_PEM,
-                                    const int certFormat = SSL_FILETYPE_PEM);
+                                    const DcmKeyFileFormat privKeyFormat = DCF_Filetype_PEM,
+                                    const DcmKeyFileFormat certFormat = DCF_Filetype_PEM);
 
   /** Disables authentication. However, DcmTLSSCU will try to establish secured
    *  connection in terms of encrypting data. Default is that authentication is disabled.
    */
   virtual void disableAuthentication();
 
-  /** Add ciphersuite to list of supported ciphersuites
-   *  @param cs The ciphersuite to add
+  /** replace the current list of ciphersuites by the list of ciphersuites
+   *  for the given profile. Caller must ensure that initNetwork() is executed before this call.
+   *  @param profile TLS Security Profile
+   *  @return TCS_ok if successful, an error code otherwise
+   */
+  virtual DcmTransportLayerStatus setTLSProfile(DcmTLSSecurityProfile profile);
+
+  /** adds a ciphersuite to the list of ciphersuites for TLS negotiation.
+   *  Caller must ensure that initNetwork() is executed before this call.
+   *  It is the responsibility of the user to ensure that the added ciphersuite
+   *  does not break the rules of the selected profile. Use with care!
+   *  @param suite TLS ciphersuite name, in the official TLS name form.
+   *  @return TCS_ok if successful, an error code otherwise
    */
-  virtual void addCiphersuite(const OFString& cs);
+  virtual DcmTransportLayerStatus addCipherSuite(const OFString& suite);
 
   /** Set file to be used as random seed for initializing the Pseudo Random
    *  Number Generator (PRNG)
@@ -163,15 +175,10 @@ public:
   virtual void getTrustedCertFiles(OFList<OFString>& files /*out*/) const;
 
   /** Get directories containing considered to contain trusted certificates.
-   *  @param trustedDirs directories consiered to contain trusted certificates.
+   *  @param trustedDirs directories considered to contain trusted certificates.
    */
   virtual void getTrustedCertDirs(OFList<OFString>& trustedDirs /*out*/) const;
 
-  /** Get ciphersuites set to be supported
-   *  @return Ciphersuites set to be supported
-   */
-  virtual OFString getCiphersuites() const;
-
   /** Get random seed file used for initializing Pseudo Random Number
    *  Generator (PRNG)
    *  @return Random seed file used for reading
@@ -217,21 +224,18 @@ private:
   /// The file containing the private key (if authentication is enabled)
   OFString m_privateKeyFile;
 
-  /// Might be either "SSL_FILETYPE_PEM" (default) or "SSL_FILETYPE_ASN1"
-  int m_privateKeyFileFormat;
+  /// private key file format
+  DcmKeyFileFormat m_privateKeyFileFormat;
 
   /// File containing the certificate the SCU should use for authentication
   OFString m_certificateFile;
 
-  /// Might be either "SSL_FILETYPE_PEM" (default) or "SSL_FILETYPE_ASN1"
-  int m_certKeyFileFormat;
+  /// certificate (public key) file format
+  DcmKeyFileFormat m_certKeyFileFormat;
 
-  ///
+  /// password required to open the private key file
   char* m_passwd;
 
-  /// String containing all cipher suites being configured to be used
-  OFString m_ciphersuites;
-
   /// Random seed file used for initializing Pseudo Random Number
   /// Generator (PRNG)
   OFString m_readSeedFile;
index 0d7196a76eb061cac698fbcac051f3c4be0f9e64..f8182a8d68ec078640eb61fe5f64836b947619a1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 
 #ifdef WITH_OPENSSL
 
-BEGIN_EXTERN_C
-#include <openssl/ssl.h>
-END_EXTERN_C
-
+// forward declarations of OpenSSL data structures
+struct ssl_st;
+typedef struct ssl_st SSL;
 
 /** this class represents a TLS (Transport Layer Security) V1 based secure
  *  transport connection.
+ *  @remark This class is only available if DCMTK is compiled with
+ *  OpenSSL support enabled.
  */
 class DCMTK_DCMTLS_EXPORT DcmTLSConnection: public DcmTransportConnection
 {
@@ -44,9 +45,9 @@ public:
 
   /** constructor.
    *  @param openSocket TCP/IP socket to be used for the transport connection.
-   *    the connection must already be establised on socket level. This object
+   *    the connection must already be established on socket level. This object
    *    takes over control of the socket.
-   *  @param newTLSConnection pointer to intialized OpenSSL connection object
+   *  @param newTLSConnection pointer to initialized OpenSSL connection object
    *    to be used for this connection.
    */
   DcmTLSConnection(DcmNativeSocketType openSocket, SSL *newTLSConnection);
@@ -145,6 +146,9 @@ private:
   /// private undefined assignment operator
   DcmTLSConnection& operator=(const DcmTLSConnection&);
 
+  /// dump TLS connection details to debug logger
+  void logTLSConnection();
+
   /// pointer to the TLS connection structure used by the OpenSSL library
   SSL *tlsConnection;
 
index e12cbb6c9d40227f19ccc89e8ff88ca0fc780e28..3e824abc60996a414b0fa937df393ccfeed13dc1 100644 (file)
@@ -1,5 +1,5 @@
 # create library from source files
-DCMTK_ADD_LIBRARY(dcmtls tlscond tlslayer tlsopt tlstrans tlsscu)
+DCMTK_ADD_LIBRARY(dcmtls tlscond tlslayer tlsopt tlstrans tlsscu tlsciphr)
 
 DCMTK_TARGET_LINK_MODULES(dcmtls ofstd dcmdata dcmnet)
 DCMTK_TARGET_LINK_LIBRARIES(dcmtls ${OPENSSL_LIBS})
index f9d778038d1ee6cb00b51a6d93c53ccd8e54fab1..e8ae51eeb2790215d315aea18ce66d8a66405329 100644 (file)
@@ -1,3 +1,69 @@
+tlsciphr.o: tlsciphr.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmtls/tlsciphr.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../../ofstd/include/dcmtk/ofstd/ofvector.h \
+ ../include/dcmtk/dcmtls/tlsdefin.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \
+ ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
+ ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \
+ ../include/dcmtk/dcmtls/tlslayer.h \
+ ../../dcmnet/include/dcmtk/dcmnet/assoc.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dicom.h \
+ ../../dcmnet/include/dcmtk/dcmnet/cond.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \
+ ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
+ ../../oflog/include/dcmtk/oflog/oflog.h \
+ ../../oflog/include/dcmtk/oflog/logger.h \
+ ../../oflog/include/dcmtk/oflog/config.h \
+ ../../oflog/include/dcmtk/oflog/config/defines.h \
+ ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
+ ../../oflog/include/dcmtk/oflog/loglevel.h \
+ ../../oflog/include/dcmtk/oflog/tstring.h \
+ ../../oflog/include/dcmtk/oflog/tchar.h \
+ ../../oflog/include/dcmtk/oflog/spi/apndatch.h \
+ ../../oflog/include/dcmtk/oflog/appender.h \
+ ../../ofstd/include/dcmtk/ofstd/ofmem.h \
+ ../../oflog/include/dcmtk/oflog/layout.h \
+ ../../oflog/include/dcmtk/oflog/streams.h \
+ ../../oflog/include/dcmtk/oflog/helpers/pointer.h \
+ ../../oflog/include/dcmtk/oflog/thread/syncprim.h \
+ ../../oflog/include/dcmtk/oflog/spi/filter.h \
+ ../../oflog/include/dcmtk/oflog/helpers/lockfile.h \
+ ../../oflog/include/dcmtk/oflog/spi/logfact.h \
+ ../../oflog/include/dcmtk/oflog/logmacro.h \
+ ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
+ ../../oflog/include/dcmtk/oflog/tracelog.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
+ ../../dcmnet/include/dcmtk/dcmnet/lst.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dul.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../../dcmnet/include/dcmtk/dcmnet/extneg.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h
 tlscond.o: tlscond.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../include/dcmtk/dcmtls/tlscond.h \
@@ -12,14 +78,13 @@ tlscond.o: tlscond.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../include/dcmtk/dcmtls/tlsdefin.h
 tlslayer.o: tlslayer.cc ../../config/include/dcmtk/config/osconfig.h \
- ../include/dcmtk/dcmtls/tlsdefin.h \
+ ../include/dcmtk/dcmtls/tlslayer.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
- ../include/dcmtk/dcmtls/tlslayer.h \
- ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \
- ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
  ../../ofstd/include/dcmtk/ofstd/ofutil.h \
@@ -27,6 +92,17 @@ tlslayer.o: tlslayer.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \
  ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \
+ ../../dcmnet/include/dcmtk/dcmnet/assoc.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dicom.h \
+ ../../dcmnet/include/dcmtk/dcmnet/cond.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \
+ ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -51,64 +127,50 @@ tlslayer.o: tlslayer.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
- ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmtls/tlstrans.h \
- ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
+ ../../dcmnet/include/dcmtk/dcmnet/lst.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
- ../../dcmnet/include/dcmtk/dcmnet/dicom.h \
- ../../dcmnet/include/dcmtk/dcmnet/cond.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
- ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \
- ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcuid.h
+ ../../dcmnet/include/dcmtk/dcmnet/extneg.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \
+ ../include/dcmtk/dcmtls/tlsdefin.h ../include/dcmtk/dcmtls/tlsciphr.h \
+ ../include/dcmtk/dcmtls/tlstrans.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h
 tlsopt.o: tlsopt.cc ../../config/include/dcmtk/config/osconfig.h \
- ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../include/dcmtk/dcmtls/tlsopt.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../include/dcmtk/dcmtls/tlslayer.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \
  ../../ofstd/include/dcmtk/ofstd/oftypes.h \
  ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
  ../../ofstd/include/dcmtk/ofstd/ofcast.h \
  ../../ofstd/include/dcmtk/ofstd/ofexport.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
- ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
- ../../ofstd/include/dcmtk/ofstd/ofthread.h \
- ../../ofstd/include/dcmtk/ofstd/offile.h \
- ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/oftraits.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
- ../../ofstd/include/dcmtk/ofstd/oflimits.h \
- ../../config/include/dcmtk/config/arith.h \
- ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../include/dcmtk/dcmtls/tlscond.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
- ../include/dcmtk/dcmtls/tlsdefin.h ../include/dcmtk/dcmtls/tlsopt.h \
- ../../ofstd/include/dcmtk/ofstd/ofvriant.h \
- ../../ofstd/include/dcmtk/ofstd/variadic/variant.h \
- ../../ofstd/include/dcmtk/ofstd/variadic/helpers.h \
- ../../ofstd/include/dcmtk/ofstd/ofalign.h \
  ../../ofstd/include/dcmtk/ofstd/ofutil.h \
+ ../../ofstd/include/dcmtk/ofstd/oftraits.h \
  ../../ofstd/include/dcmtk/ofstd/variadic/tuplefwd.h \
- ../../ofstd/include/dcmtk/ofstd/ofdiag.h \
- ../../ofstd/include/dcmtk/ofstd/diag/push.def \
- ../../ofstd/include/dcmtk/ofstd/diag/cnvrsn.def \
- ../../ofstd/include/dcmtk/ofstd/diag/vsprfw.def \
- ../../ofstd/include/dcmtk/ofstd/diag/pop.def \
- ../include/dcmtk/dcmtls/tlslayer.h \
- ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \
  ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \
  ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \
+ ../../dcmnet/include/dcmtk/dcmnet/assoc.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dicom.h \
+ ../../dcmnet/include/dcmtk/dcmnet/cond.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../ofstd/include/dcmtk/ofstd/ofthread.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \
+ ../../ofstd/include/dcmtk/ofstd/ofbmanip.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -131,18 +193,36 @@ tlsopt.o: tlsopt.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/logmacro.h \
  ../../oflog/include/dcmtk/oflog/helpers/snprintf.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
- ../../ofstd/include/dcmtk/ofstd/ofconapp.h
+ ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
+ ../../ofstd/include/dcmtk/ofstd/oflist.h \
+ ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstd.h \
+ ../../ofstd/include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
+ ../../dcmnet/include/dcmtk/dcmnet/lst.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dul.h \
+ ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
+ ../../dcmnet/include/dcmtk/dcmnet/extneg.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \
+ ../include/dcmtk/dcmtls/tlsdefin.h ../include/dcmtk/dcmtls/tlsciphr.h \
+ ../include/dcmtk/dcmtls/tlscond.h
 tlsscu.o: tlsscu.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/dcmtls/tlsdefin.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../include/dcmtk/dcmtls/tlsscu.h ../../dcmnet/include/dcmtk/dcmnet/scu.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctk.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
- ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
- ../../ofstd/include/dcmtk/ofstd/ofcast.h \
- ../../ofstd/include/dcmtk/ofstd/ofexport.h \
- ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../oflog/include/dcmtk/oflog/config/defines.h \
  ../../oflog/include/dcmtk/oflog/helpers/threadcf.h \
  ../../oflog/include/dcmtk/oflog/loglevel.h \
@@ -170,6 +250,7 @@ tlsscu.o: tlsscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -179,6 +260,7 @@ tlsscu.o: tlsscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcswap.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
@@ -270,7 +352,7 @@ tlsscu.o: tlsscu.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmtls/tlstrans.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmtrans.h \
  ../../dcmnet/include/dcmtk/dcmnet/dcmlayer.h \
- ../include/dcmtk/dcmtls/tlsdefin.h ../include/dcmtk/dcmtls/tlslayer.h \
+ ../include/dcmtk/dcmtls/tlslayer.h ../include/dcmtk/dcmtls/tlsciphr.h \
  ../../dcmnet/include/dcmtk/dcmnet/diutil.h
 tlstrans.o: tlstrans.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
@@ -292,6 +374,15 @@ tlstrans.o: tlstrans.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmnet/include/dcmtk/dcmnet/dndefine.h \
  ../../dcmnet/include/dcmtk/dcmnet/dntypes.h \
  ../include/dcmtk/dcmtls/tlsdefin.h ../include/dcmtk/dcmtls/tlslayer.h \
+ ../../dcmnet/include/dcmtk/dcmnet/assoc.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dicom.h \
+ ../../dcmnet/include/dcmtk/dcmnet/cond.h \
+ ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcond.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
  ../../oflog/include/dcmtk/oflog/oflog.h \
  ../../oflog/include/dcmtk/oflog/logger.h \
  ../../oflog/include/dcmtk/oflog/config.h \
@@ -316,22 +407,21 @@ tlstrans.o: tlstrans.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
- ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
- ../../ofstd/include/dcmtk/ofstd/ofcond.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
- ../../dcmnet/include/dcmtk/dcmnet/dcompat.h \
- ../../dcmnet/include/dcmtk/dcmnet/diutil.h \
- ../../dcmnet/include/dcmtk/dcmnet/dicom.h \
- ../../dcmnet/include/dcmtk/dcmnet/cond.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcerror.h \
- ../../dcmdata/include/dcmtk/dcmdata/dcdefine.h \
- ../../dcmdata/include/dcmtk/dcmdata/dctypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
+ ../../dcmnet/include/dcmtk/dcmnet/lst.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dul.h \
+ ../../dcmnet/include/dcmtk/dcmnet/extneg.h \
+ ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \
+ ../include/dcmtk/dcmtls/tlsciphr.h \
+ ../../dcmnet/include/dcmtk/dcmnet/diutil.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcobject.h \
@@ -342,9 +432,4 @@ tlstrans.o: tlstrans.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
- ../../dcmnet/include/dcmtk/dcmnet/dimse.h \
- ../../dcmnet/include/dcmtk/dcmnet/lst.h \
- ../../dcmnet/include/dcmtk/dcmnet/dul.h \
- ../../dcmnet/include/dcmtk/dcmnet/extneg.h \
- ../../dcmnet/include/dcmtk/dcmnet/dcuserid.h \
- ../../dcmnet/include/dcmtk/dcmnet/assoc.h
+ ../../dcmnet/include/dcmtk/dcmnet/dimse.h
index a2dd073fd4bf429250616967ab83df63f203892a..24a297cea1c5cd57cc9e78a7030fb60d80cefc3d 100644 (file)
@@ -20,7 +20,7 @@ dcmnetdir = $(top_srcdir)/../dcmnet
 LOCALINCLUDES = -I$(ofstddir)/include -I$(oflogdir)/include -I$(dcmdatadir)/include -I$(dcmnetdir)/include
 LOCALDEFS =
 
-objs = tlscond.o tlstrans.o tlslayer.o tlsopt.o tlsscu.o
+objs = tlscond.o tlstrans.o tlslayer.o tlsopt.o tlsscu.o tlsciphr.o
 library = libdcmtls.$(LIBEXT)
 
 
diff --git a/dcmtls/libsrc/tlsciphr.cc b/dcmtls/libsrc/tlsciphr.cc
new file mode 100644 (file)
index 0000000..c926dd9
--- /dev/null
@@ -0,0 +1,566 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module: dcmtls
+ *
+ *  Author: Marco Eichelberg
+ *
+ *  Purpose:
+ *    classes: DcmTLSCiphersuiteHandler
+ *
+ */
+
+#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
+#include "dcmtk/dcmtls/tlsciphr.h"
+#include "dcmtk/dcmtls/tlsdefin.h"
+#include "dcmtk/dcmtls/tlslayer.h"    /* for TLS_ERROR macro */
+
+#ifdef WITH_OPENSSL
+
+BEGIN_EXTERN_C
+#include <openssl/ssl.h>
+#include <openssl/tls1.h>
+END_EXTERN_C
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#define SSL_CTX_get_ciphers(ctx) (ctx)->cipher_list
+#endif
+
+/* POD struct for the list of supported ciphersuite
+ */
+struct DcmCipherSuiteList
+{
+  const char *TLSname;
+  const char *openSSLName;
+  DcmTLSCipherProtocolVersion protocolVersion;
+  DcmTLSCipherKeyExchange keyExchange;
+  DcmTLSCipherAuthentication authentication;
+  DcmTLSCipherEncryption encryption;
+  DcmTLSCipherMAC mac;
+  size_t keySize;
+  size_t effectiveKeySize;
+};
+
+
+/* This is a subset of the list of ciphersuites supported by OpenSSL 1.0.1 and newer.
+ * This list only contains ciphersuites that offer an acceptable level of security,
+ * plus the "historic" ciphersuites for older TLS profiles (Basic, AES, IHE ATNA NULL).
+ *
+ * IMPORTANT: This list must be sorted from the weakest to the strongest ciphersuite.
+ *   - first sort by availability of forward secrecy (RSA < ECDH < ECDHE < DHE)
+ *   - then sort by effective key size
+ *   - then sort by hash key algorithm  (SHA-1 < SHA-256 < SHA-384); (CBC < AEAD)
+ */
+static const DcmCipherSuiteList globalCipherSuiteList[] =
+{
+    // -- first all ciphersuites without forward secrecy --
+
+    // historic ciphersuites
+    {"TLS_RSA_WITH_NULL_SHA",                         SSL3_TXT_RSA_NULL_SHA,                           TPV_SSLv3,  TKE_RSA,        TCA_RSA,    TCE_None,     TCM_SHA1,     0,   0},
+    {"TLS_RSA_WITH_3DES_EDE_CBC_SHA",                 SSL3_TXT_RSA_DES_192_CBC3_SHA,                   TPV_SSLv3,  TKE_RSA,        TCA_RSA,    TCE_3DES,     TCM_SHA1,   168, 112},
+
+    // 128 bit encryption with static RSA
+    {"TLS_RSA_WITH_AES_128_CBC_SHA",                  TLS1_TXT_RSA_WITH_AES_128_SHA,                   TPV_SSLv3,  TKE_RSA,        TCA_RSA,    TCE_AES,      TCM_SHA1,   128, 128},
+    {"TLS_RSA_WITH_CAMELLIA_128_CBC_SHA",             TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA,          TPV_SSLv3,  TKE_RSA,        TCA_RSA,    TCE_Camellia, TCM_SHA1,   128, 128},
+    {"TLS_RSA_WITH_AES_128_CBC_SHA256",               TLS1_TXT_RSA_WITH_AES_128_SHA256,                TPV_TLSv12, TKE_RSA,        TCA_RSA,    TCE_AES,      TCM_SHA256, 128, 128},
+    {"TLS_RSA_WITH_AES_128_GCM_SHA256",               TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256,            TPV_TLSv12, TKE_RSA,        TCA_RSA,    TCE_AESGCM,   TCM_AEAD,   128, 128},
+
+    // 128 bit encryption with ECDH
+    {"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",           TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA,        TPV_SSLv3,  TKE_ECDH_ECDSA, TCA_ECDH,   TCE_AES,      TCM_SHA1,   128, 128},
+    {"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",             TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA,          TPV_SSLv3,  TKE_ECDH_RSA,   TCA_ECDH,   TCE_AES,      TCM_SHA1,   128, 128},
+    {"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",        TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256,         TPV_TLSv12, TKE_ECDH_ECDSA, TCA_ECDH,   TCE_AES,      TCM_SHA256, 128, 128},
+    {"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",          TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256,           TPV_TLSv12, TKE_ECDH_RSA,   TCA_ECDH,   TCE_AES,      TCM_SHA256, 128, 128},
+    {"TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",        TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,     TPV_TLSv12, TKE_ECDH_ECDSA, TCA_ECDH,   TCE_AESGCM,   TCM_AEAD,   128, 128},
+    {"TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",          TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256,       TPV_TLSv12, TKE_ECDH_RSA,   TCA_ECDH,   TCE_AESGCM,   TCM_AEAD,   128, 128},
+
+    // 256 bit encryption with static RSA
+    {"TLS_RSA_WITH_CAMELLIA_256_CBC_SHA",             TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA,          TPV_SSLv3,  TKE_RSA,        TCA_RSA,    TCE_Camellia, TCM_SHA1,   256, 256},
+    {"TLS_RSA_WITH_AES_256_CBC_SHA",                  TLS1_TXT_RSA_WITH_AES_256_SHA,                   TPV_SSLv3,  TKE_RSA,        TCA_RSA,    TCE_AES,      TCM_SHA1,   256, 256},
+    {"TLS_RSA_WITH_AES_256_CBC_SHA256",               TLS1_TXT_RSA_WITH_AES_256_SHA256,                TPV_TLSv12, TKE_RSA,        TCA_RSA,    TCE_AES,      TCM_SHA256, 256, 256},
+    {"TLS_RSA_WITH_AES_256_GCM_SHA384",               TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384,            TPV_TLSv12, TKE_RSA,        TCA_RSA,    TCE_AESGCM,   TCM_AEAD,   256, 256},
+
+    // 256 bit encryption with static ECDH
+    {"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",           TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA,        TPV_SSLv3,  TKE_ECDH_ECDSA, TCA_ECDH,   TCE_AES,      TCM_SHA1,   256, 256},
+    {"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",             TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA,          TPV_SSLv3,  TKE_ECDH_RSA,   TCA_ECDH,   TCE_AES,      TCM_SHA1,   256, 256},
+    {"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",        TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384,         TPV_TLSv12, TKE_ECDH_ECDSA, TCA_ECDH,   TCE_AES,      TCM_SHA384, 256, 256},
+    {"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",          TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384,           TPV_TLSv12, TKE_ECDH_RSA,   TCA_ECDH,   TCE_AES,      TCM_SHA384, 256, 256},
+    {"TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384",        TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,     TPV_TLSv12, TKE_ECDH_ECDSA, TCA_ECDH,   TCE_AESGCM,   TCM_AEAD,   256, 256},
+    {"TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384",          TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384,       TPV_TLSv12, TKE_ECDH_RSA,   TCA_ECDH,   TCE_AESGCM,   TCM_AEAD,   256, 256},
+
+    // -- then all ciphersuites with forward secrecy --
+
+    // 128 bit encryption with ECDHE
+    {"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",          TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,       TPV_SSLv3,  TKE_ECDH,       TCA_ECDSA,  TCE_AES,      TCM_SHA1,   128, 128},
+    {"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",            TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA,         TPV_SSLv3,  TKE_ECDH,       TCA_RSA,    TCE_AES,      TCM_SHA1,   128, 128},
+    {"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",       TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256,        TPV_TLSv12, TKE_ECDH,       TCA_ECDSA,  TCE_AES,      TCM_SHA256, 128, 128},
+    {"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",         TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256,          TPV_TLSv12, TKE_ECDH,       TCA_RSA,    TCE_AES,      TCM_SHA256, 128, 128},
+    {"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",       TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,    TPV_TLSv12, TKE_ECDH,       TCA_ECDSA,  TCE_AESGCM,   TCM_AEAD,   128, 128},
+    {"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",         TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256,      TPV_TLSv12, TKE_ECDH,       TCA_RSA,    TCE_AESGCM,   TCM_AEAD,   128, 128},
+
+    // 128 bit encryption with DHE
+    {"TLS_DHE_DSS_WITH_AES_128_CBC_SHA",              TLS1_TXT_DHE_DSS_WITH_AES_128_SHA,               TPV_SSLv3,  TKE_DH,         TCA_DSS,    TCE_AES,      TCM_SHA1,   128, 128},
+    {"TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA",         TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,      TPV_SSLv3,  TKE_DH,         TCA_DSS,    TCE_Camellia, TCM_SHA1,   128, 128},
+    {"TLS_DHE_RSA_WITH_AES_128_CBC_SHA",              TLS1_TXT_DHE_RSA_WITH_AES_128_SHA,               TPV_SSLv3,  TKE_DH,         TCA_RSA,    TCE_AES,      TCM_SHA1,   128, 128},
+    {"TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA",         TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,      TPV_SSLv3,  TKE_DH,         TCA_RSA,    TCE_Camellia, TCM_SHA1,   128, 128},
+    {"TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",           TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256,            TPV_TLSv12, TKE_DH,         TCA_DSS,    TCE_AES,      TCM_SHA256, 128, 128},
+    {"TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",           TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256,            TPV_TLSv12, TKE_DH,         TCA_RSA,    TCE_AES,      TCM_SHA256, 128, 128},
+    {"TLS_DHE_DSS_WITH_AES_128_GCM_SHA256",           TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256,        TPV_TLSv12, TKE_DH,         TCA_DSS,    TCE_AESGCM,   TCM_AEAD,   128, 128},
+    {"TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",           TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256,        TPV_TLSv12, TKE_DH,         TCA_RSA,    TCE_AESGCM,   TCM_AEAD,   128, 128},
+
+    // 256 bit encryption with ECDHE
+    {"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",          TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,       TPV_SSLv3,  TKE_ECDH,       TCA_ECDSA,  TCE_AES,      TCM_SHA1,   256, 256},
+    {"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",            TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA,         TPV_SSLv3,  TKE_ECDH,       TCA_RSA,    TCE_AES,      TCM_SHA1,   256, 256},
+    {"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",       TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384,        TPV_TLSv12, TKE_ECDH,       TCA_ECDSA,  TCE_AES,      TCM_SHA384, 256, 256},
+    {"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",         TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384,          TPV_TLSv12, TKE_ECDH,       TCA_RSA,    TCE_AES,      TCM_SHA384, 256, 256},
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+    /* OpenSSL 1.1.0 supports the ChaCha20-Poly1305 ciphersuites defined in RFC 7905 */
+    {"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,     TPV_TLSv12, TKE_ECDH,       TCA_ECDSA,  TCE_ChaCha20, TCM_AEAD,   256, 256},
+    {"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",   TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305,       TPV_TLSv12, TKE_ECDH,       TCA_RSA,    TCE_ChaCha20, TCM_AEAD,   256, 256},
+#endif
+    {"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",       TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,    TPV_TLSv12, TKE_ECDH,       TCA_ECDSA,  TCE_AESGCM,   TCM_AEAD,   256, 256},
+    {"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",         TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384,      TPV_TLSv12, TKE_ECDH,       TCA_RSA,    TCE_AESGCM,   TCM_AEAD,   256, 256},
+
+    // 256 bit encryption with DHE
+    {"TLS_DHE_DSS_WITH_AES_256_CBC_SHA",              TLS1_TXT_DHE_DSS_WITH_AES_256_SHA,               TPV_SSLv3,  TKE_DH,         TCA_DSS,    TCE_AES,      TCM_SHA1,   256, 256},
+    {"TLS_DHE_RSA_WITH_AES_256_CBC_SHA",              TLS1_TXT_DHE_RSA_WITH_AES_256_SHA,               TPV_SSLv3,  TKE_DH,         TCA_RSA,    TCE_AES,      TCM_SHA1,   256, 256},
+    {"TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA",         TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,      TPV_SSLv3,  TKE_DH,         TCA_DSS,    TCE_Camellia, TCM_SHA1,   256, 256},
+    {"TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA",         TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,      TPV_SSLv3,  TKE_DH,         TCA_RSA,    TCE_Camellia, TCM_SHA1,   256, 256},
+    {"TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",           TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256,            TPV_TLSv12, TKE_DH,         TCA_DSS,    TCE_AES,      TCM_SHA256, 256, 256},
+    {"TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",           TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256,            TPV_TLSv12, TKE_DH,         TCA_RSA,    TCE_AES,      TCM_SHA256, 256, 256},
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+    /* OpenSSL 1.1.0 supports the ChaCha20-Poly1305 ciphersuites defined in RFC 7905 */
+    {"TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256",     TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305,         TPV_TLSv12, TKE_DH,         TCA_RSA,    TCE_ChaCha20, TCM_AEAD,   256, 256},
+#endif
+    {"TLS_DHE_DSS_WITH_AES_256_GCM_SHA384",           TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384,        TPV_TLSv12, TKE_DH,         TCA_DSS,    TCE_AESGCM,   TCM_AEAD,   256, 256},
+    {"TLS_DHE_RSA_WITH_AES_256_GCM_SHA384",           TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384,        TPV_TLSv12, TKE_DH,         TCA_RSA,    TCE_AESGCM,   TCM_AEAD,   256, 256}
+
+};
+
+#define GLOBAL_NUM_CIPHERSUITES (sizeof(globalCipherSuiteList)/sizeof(DcmCipherSuiteList))
+
+const size_t DcmTLSCiphersuiteHandler::unknownCipherSuiteIndex = (size_t) -1;
+
+DcmTLSCiphersuiteHandler::DcmTLSCiphersuiteHandler()
+: ciphersuiteList()
+, currentProfile(TSP_Profile_None)
+, ciphersuiteSupported(new OFBool[GLOBAL_NUM_CIPHERSUITES])
+{
+  determineSupportedCiphers();
+}
+
+DcmTLSCiphersuiteHandler::~DcmTLSCiphersuiteHandler()
+{
+  delete[] ciphersuiteSupported;
+}
+
+void DcmTLSCiphersuiteHandler::determineSupportedCiphers()
+{
+  // initialize all ciphersuites to "unsupported"
+  size_t numEntries = GLOBAL_NUM_CIPHERSUITES;
+  for (size_t i = 0; i < numEntries; i++) ciphersuiteSupported[i] = OFFalse;
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+  SSL_CTX *ctx = SSL_CTX_new(SSLv23_method());
+#else
+  SSL_CTX *ctx = SSL_CTX_new(TLS_method());
+#endif
+
+  if (ctx)
+  {
+    // we don't want to support SSL2 and SSL3 and its ciphers
+    SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3);
+    // other than that, enable all ciphers including those without encryption
+    SSL_CTX_set_cipher_list(ctx, "ALL:eNULL");
+    STACK_OF(SSL_CIPHER) *sk = SSL_CTX_get_ciphers(ctx);
+    if (sk)
+    {
+      const SSL_CIPHER *c = NULL;
+      const char *p = NULL;
+      size_t idx = 0;
+      long numCiphers = sk_SSL_CIPHER_num(sk);
+      // for each ciphersuite supported by OpenSSL...
+      for (long j = 0; j < numCiphers; j++)
+      {
+        c = sk_SSL_CIPHER_value(sk, j);
+        p = SSL_CIPHER_get_name(c);
+        if (p)
+        {
+          // ...check if we also support it in DCMTK
+          idx = lookupCiphersuiteByOpenSSLName(p);
+          // if so, set the "supported" flag to true
+          if (idx < numEntries) ciphersuiteSupported[idx] = OFTrue;
+        }
+      }
+    }
+    SSL_CTX_free(ctx);
+  }
+}
+
+
+DcmTransportLayerStatus DcmTLSCiphersuiteHandler::addRequiredCipherSuite(const char *name)
+{
+  if (NULL == name) return TCS_illegalCall;
+  size_t idx = lookupCiphersuite(name);
+  if (idx < GLOBAL_NUM_CIPHERSUITES) ciphersuiteList.push_back(idx);
+  else
+  {
+     DCMTLS_FATAL("Ciphersuite '" << name << "' not supported by the OpenSSL library used to compile this application.");
+     return TCS_tlsError;
+  }
+  return TCS_ok;
+}
+
+
+void DcmTLSCiphersuiteHandler::addOptional3DESCipherSuite()
+{
+  size_t idx = lookupCiphersuite("TLS_RSA_WITH_3DES_EDE_CBC_SHA");
+  if (idx < GLOBAL_NUM_CIPHERSUITES) ciphersuiteList.push_back(idx);
+  else
+  {
+    // we cannot activate the basic profile because OpenSSL has been compiled without 3DES support.
+    DCMTLS_WARN("Ciphersuite 'TLS_RSA_WITH_3DES_EDE_CBC_SHA' not supported by the OpenSSL library used to compile this application, no backward compatibility with DICOM Basic TLS profile.");
+  }
+  return;
+}
+
+
+DcmTransportLayerStatus DcmTLSCiphersuiteHandler::setTLSProfile(DcmTLSSecurityProfile profile)
+{
+  currentProfile = profile;
+  DcmTransportLayerStatus result = TCS_ok;
+
+  switch (profile)
+  {
+    case TSP_Profile_None:
+      ciphersuiteList.clear();
+      break;
+    case TSP_Profile_Basic:
+      result = addRequiredCipherSuite("TLS_RSA_WITH_3DES_EDE_CBC_SHA");
+      if (TCS_ok != result) return result;
+      break;
+    case TSP_Profile_AES:
+      result = addRequiredCipherSuite("TLS_RSA_WITH_AES_128_CBC_SHA");
+      if (TCS_ok != result) return result;
+      addOptional3DESCipherSuite();
+      break;
+    case TSP_Profile_BCP195:
+      // recommended ciphersuites as defined in the DICOM profile, plus backwards compatibility
+      result = addRequiredCipherSuite("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256");
+      if (TCS_ok != result) return result;
+      result = addRequiredCipherSuite("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256");
+      if (TCS_ok != result) return result;
+      result = addRequiredCipherSuite("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384");
+      if (TCS_ok != result) return result;
+      result = addRequiredCipherSuite("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384");
+      if (TCS_ok != result) return result;
+      result = addRequiredCipherSuite("TLS_RSA_WITH_AES_128_CBC_SHA");
+      if (TCS_ok != result) return result;
+      addOptional3DESCipherSuite();
+      break;
+    case TSP_Profile_BCP195_ND:
+      // required ciphersuites as defined in the DICOM profile
+      result = addRequiredCipherSuite("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256");
+      if (TCS_ok != result) return result;
+      result = addRequiredCipherSuite("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256");
+      if (TCS_ok != result) return result;
+      result = addRequiredCipherSuite("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384");
+      if (TCS_ok != result) return result;
+      result = addRequiredCipherSuite("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384");
+      if (TCS_ok != result) return result;
+      break;
+    case TSP_Profile_IHE_ATNA_Unencrypted:
+      result = addRequiredCipherSuite("TLS_RSA_WITH_NULL_SHA");
+      if (TCS_ok != result) return result;
+      break;
+    // we don't want a default case here
+  }
+
+  return TCS_ok;
+}
+
+void DcmTLSCiphersuiteHandler::clearTLSProfile()
+{
+  currentProfile = TSP_Profile_None;
+  ciphersuiteList.clear();
+}
+
+DcmTransportLayerStatus DcmTLSCiphersuiteHandler::addCipherSuite(const char *suite)
+{
+  // first look up the index for the TLS ciphersuite name,
+  // then look up the OpenSSL ciphersuite name based on this index.
+  size_t idx = lookupCiphersuite(suite); // can handle NULL pointers
+  if (idx < GLOBAL_NUM_CIPHERSUITES)
+  {
+    if (! ciphersuiteSupported[idx])
+       {
+      // user has selected a ciphersuite not supported by the OpenSSL version we are using
+      DCMTLS_FATAL("Ciphersuite '" << suite << "' not supported by the OpenSSL library used to compile this application.");
+      return TCS_tlsError;
+    }
+
+    size_t keySize = 0;
+    switch (currentProfile)
+    {
+      case TSP_Profile_Basic:
+      case TSP_Profile_AES:
+      case TSP_Profile_BCP195:
+      case TSP_Profile_BCP195_ND:
+        // make sure that we don't add a NULL ciphersuite (i.e. a ciphersuite
+        // without encryption) to one of the secure TLS profiles, because this
+        // would jeopardize communication security. NULL ciphersuites are only
+        // permitted in the "IHE ATNA unencrypted" profile, or when no profile is used.
+        keySize = getCipherSuiteKeySize(idx);
+        if (keySize == 0)
+        {
+          DCMTLS_FATAL("Unencrypted ciphersuite '" << suite << "' not permitted with security profile '" << lookupProfileName(currentProfile) << "'");
+          return TCS_tlsError;
+        }
+        if (TKE_RSA == getCipherSuiteKeyExchange(idx))
+        {
+          DCMTLS_WARN("Ciphersuite '" << suite << "' uses RSA key transport. RFC 7525 recomments that such cipher suites should not be used.");
+        }
+               else
+        {
+          DCMTLS_WARN("Ciphersuite '" << suite << "' uses NO RSA key transport. RFC 7525 recomments that such cipher suites should not be used.");
+        }
+        break;
+
+      case TSP_Profile_None:
+      case TSP_Profile_IHE_ATNA_Unencrypted:
+        // do nothing
+        break;
+    }
+
+    ciphersuiteList.push_back(idx);
+    return TCS_ok;
+  }
+  // invalid/unknown cipher suite name
+  return TCS_illegalCall;
+}
+
+// Static helper function for the qsort() call in
+// DcmTLSCiphersuiteHandler::getListOfCipherSuitesForOpenSSL().
+static int cipherSuiteComparison(const void *lhs, const void *rhs)
+{
+  const size_t *lh = OFreinterpret_cast(const size_t *, lhs);
+  const size_t *rh = OFreinterpret_cast(const size_t *, rhs);
+
+  if (*lh < *rh) return 1;
+  if (*lh > *rh) return -1;
+  return 0;
+}
+
+void DcmTLSCiphersuiteHandler::getListOfCipherSuitesForOpenSSL(OFString& cslist, OFBool isServer) const
+{
+  cslist.clear();
+  const char *c = NULL;
+  OFVector<size_t> tempList = ciphersuiteList;
+
+  if (isServer)
+  {
+    // When acting as a TLS server, we follow the recommendation of BCP 195
+    // to select the strongest ciphersuite offered by the client. We do this by
+    // ignoring the order of preference proposed by the client; instead we select the first
+    // matching ciphersuite from our own (server-side) list of supported ciphersuites.
+    // We sort this list with the strongest ciphersuite first. Since the global list
+    // of ciphersuites (globalCipherSuiteList) is already sorted by strength (weakest
+    // ciphersuite first), we only have to sort the ciphersuite IDs in decreasing order.
+    qsort(&tempList[0], tempList.size(), sizeof(size_t), cipherSuiteComparison);
+  }
+
+  for (OFVector<size_t>::const_iterator it = tempList.begin(); it != tempList.end(); ++it)
+  {
+    c = getOpenSSLCipherSuiteName(*it);
+    if (c)
+    {
+      if (! cslist.empty()) cslist += ":";
+      cslist += c;
+    }
+  }
+}
+
+size_t DcmTLSCiphersuiteHandler::getNumberOfCipherSuites()
+{
+  return GLOBAL_NUM_CIPHERSUITES;
+}
+
+const char *DcmTLSCiphersuiteHandler::getTLSCipherSuiteName(size_t idx)
+{
+  if (idx < GLOBAL_NUM_CIPHERSUITES) return globalCipherSuiteList[idx].TLSname;
+  return NULL;
+}
+
+const char *DcmTLSCiphersuiteHandler::getOpenSSLCipherSuiteName(size_t idx)
+{
+  if (idx < GLOBAL_NUM_CIPHERSUITES) return globalCipherSuiteList[idx].openSSLName;
+  return NULL;
+}
+
+DcmTLSCipherProtocolVersion DcmTLSCiphersuiteHandler::getCipherSuiteProtocolVersion(size_t idx)
+{
+  if (idx < GLOBAL_NUM_CIPHERSUITES) return globalCipherSuiteList[idx].protocolVersion;
+  return TPV_TLSv12;  // invalid index, return a (rather arbitrary) default
+}
+
+DcmTLSCipherKeyExchange DcmTLSCiphersuiteHandler::getCipherSuiteKeyExchange(size_t idx)
+{
+  if (idx < GLOBAL_NUM_CIPHERSUITES) return globalCipherSuiteList[idx].keyExchange;
+  return TKE_RSA;  // invalid index, return a (rather arbitrary) default
+}
+
+DcmTLSCipherAuthentication DcmTLSCiphersuiteHandler::getCipherSuiteAuthentication(size_t idx)
+{
+  if (idx < GLOBAL_NUM_CIPHERSUITES) return globalCipherSuiteList[idx].authentication;
+  return TCA_RSA;  // invalid index, return a (rather arbitrary) default
+}
+
+DcmTLSCipherEncryption DcmTLSCiphersuiteHandler::getCipherSuiteEncryption(size_t idx)
+{
+  if (idx < GLOBAL_NUM_CIPHERSUITES) return globalCipherSuiteList[idx].encryption;
+  return TCE_None;  // invalid index, return a (rather arbitrary) default
+}
+
+DcmTLSCipherMAC DcmTLSCiphersuiteHandler::getCipherSuiteMAC(size_t idx)
+{
+  if (idx < GLOBAL_NUM_CIPHERSUITES) return globalCipherSuiteList[idx].mac;
+  return TCM_AEAD;
+}
+
+size_t DcmTLSCiphersuiteHandler::getCipherSuiteKeySize(size_t idx)
+{
+  if (idx < GLOBAL_NUM_CIPHERSUITES) return globalCipherSuiteList[idx].keySize;
+  return 0;
+}
+
+size_t DcmTLSCiphersuiteHandler::getCipherSuiteEffectiveKeySize(size_t idx)
+{
+  if (idx < GLOBAL_NUM_CIPHERSUITES) return globalCipherSuiteList[idx].effectiveKeySize;
+  return 0;
+}
+
+size_t DcmTLSCiphersuiteHandler::lookupCiphersuite(const char *tlsCipherSuiteName)
+{
+  if (tlsCipherSuiteName)
+  {
+    OFString aString(tlsCipherSuiteName);
+    size_t numEntries = GLOBAL_NUM_CIPHERSUITES;
+    for (size_t i = 0; i < numEntries; i++)
+    {
+      if (aString == globalCipherSuiteList[i].TLSname) return i;
+    }
+  }
+  // ciphersuite not found
+  return unknownCipherSuiteIndex;
+}
+
+size_t DcmTLSCiphersuiteHandler::lookupCiphersuiteByOpenSSLName(const char *opensslCipherSuiteName)
+{
+  if (opensslCipherSuiteName)
+  {
+    OFString aString(opensslCipherSuiteName);
+    size_t numEntries = GLOBAL_NUM_CIPHERSUITES;
+    for (size_t i = 0; i < numEntries; i++)
+    {
+      if (aString == globalCipherSuiteList[i].openSSLName) return i;
+    }
+  }
+  // ciphersuite not found
+  return unknownCipherSuiteIndex;
+}
+
+void DcmTLSCiphersuiteHandler::printSupportedCiphersuites(STD_NAMESPACE ostream& os) const
+{
+  size_t numEntries = GLOBAL_NUM_CIPHERSUITES;
+  for (size_t i = 0; i < numEntries; i++)
+  {
+    if (ciphersuiteSupported[i])
+       os << "  " << globalCipherSuiteList[i].TLSname << OFendl;
+  }
+}
+
+const char *DcmTLSCiphersuiteHandler::lookupProfileName(DcmTLSSecurityProfile profile)
+{
+  switch (profile)
+  {
+    case TSP_Profile_Basic:
+      return "Basic TLS Secure Transport Connection Profile";
+      break;
+    case TSP_Profile_AES:
+      return "AES TLS Secure Transport Connection Profile";
+      break;
+    case TSP_Profile_BCP195:
+      return "BCP 195 TLS Profile";
+      break;
+    case TSP_Profile_BCP195_ND:
+      return "Non-downgrading BCP 195 TLS Profile";
+      break;
+    case TSP_Profile_None:
+      return "None";
+      break;
+    case TSP_Profile_IHE_ATNA_Unencrypted:
+      return "Authenticated unencrypted communication";
+      break;
+  }
+  return "Unknown"; // should never happen
+}
+
+OFBool DcmTLSCiphersuiteHandler::cipher3DESsupported() const
+{
+  size_t idx = lookupCiphersuiteByOpenSSLName(SSL3_TXT_RSA_DES_192_CBC3_SHA);
+  if (idx < GLOBAL_NUM_CIPHERSUITES) return ciphersuiteSupported[idx];
+
+  // Default. Only happens if ciphersuite is not supported even by DCMTK anymore
+  return OFFalse;
+}
+
+OFBool DcmTLSCiphersuiteHandler::cipherNULLsupported() const
+{
+  size_t idx = lookupCiphersuiteByOpenSSLName(SSL3_TXT_RSA_NULL_SHA);
+  if (idx < GLOBAL_NUM_CIPHERSUITES) return ciphersuiteSupported[idx];
+
+  // Default. Only happens if ciphersuite is not supported even by DCMTK anymore
+  return OFFalse;
+}
+
+long DcmTLSCiphersuiteHandler::getTLSOptions() const
+{
+  long result = 0;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+  // When compiling with OpenSSL 1.1.0, SSL support is disabled in DcmTLSTransportLayer anyway.
+  // For older OpenSSL versions we explicitly disable them here.
+  result |= SSL_OP_NO_SSLv2;
+  result |= SSL_OP_NO_SSLv3;
+#endif
+
+  // For the Non-downgrading BCP 195 TLS Profile,
+  // we also disable TLS 1.0 and TLS 1.1
+  if (currentProfile == TSP_Profile_BCP195_ND)
+  {
+    result |= SSL_OP_NO_TLSv1;
+    result |= SSL_OP_NO_TLSv1_1;
+  }
+
+  return result;
+}
+
+#else  /* WITH_OPENSSL */
+
+/* make sure that the object file is not completely empty if compiled
+ * without OpenSSL because some linkers might fail otherwise.
+ */
+DCMTK_DCMTLS_EXPORT void tlsciphr_dummy_function()
+{
+  return;
+}
+
+#endif /* WITH_OPENSSL */
index 8ddf3aca2859e9573fd69ea527327b3032736eba..c404393f8ef2c509b8d88264b4378f1cae661081 100644 (file)
@@ -36,7 +36,7 @@ DcmTLSECUnknownCiphersuiteConst::DcmTLSECUnknownCiphersuiteConst()
     theModule = OFM_dcmtls;
     theCode = 3;
     theStatus = OF_error;
-    theText = "Unknown ciphersuite";
+    theText = "Unknown or invalid ciphersuite";
 }
 
 OFCondition DcmTLSECUnknownCiphersuiteConst::operator()( const char* ciphersuiteName ) const
index d601d85900b0eddf05b1b5470cb830559b1485c7..28ff92b433670ddbc2c4e087d9cf59d1a6da6068 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -11,7 +11,7 @@
  *    D-26121 Oldenburg, Germany
  *
  *
- *  Module: dcmnet
+ *  Module: dcmtls
  *
  *  Author: Marco Eichelberg
  *
@@ -21,7 +21,7 @@
  */
 
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
-
+#include "dcmtk/dcmtls/tlslayer.h"
 #include "dcmtk/dcmtls/tlsdefin.h"
 
 #ifdef WITH_OPENSSL
@@ -35,8 +35,10 @@ BEGIN_EXTERN_C
 #include <windows.h>
 #include <winbase.h>
 #endif
+#include <openssl/ssl.h>
 #include <openssl/rand.h>
 #include <openssl/err.h>
+#include <openssl/dh.h>
 END_EXTERN_C
 
 #include "dcmtk/dcmtls/tlslayer.h"
@@ -49,15 +51,91 @@ END_EXTERN_C
 #define DCMTK_SSL_CTX_get0_param(A) A->param;
 #endif
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
-#define SSL_CTX_get_cert_store(ctx) ctx->cert_store
-#define EVP_PKEY_base_id(key) EVP_PKEY_type(key->type)
+#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
+#define X509_get_signature_nid(x509) OBJ_obj2nid((x509)->sig_alg->algorithm)
+#endif
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#define SSL_CTX_get_cert_store(ctx) (ctx)->cert_store
+#define EVP_PKEY_base_id(key) EVP_PKEY_type((key)->type)
+#define DH_bits(dh) BN_num_bits((dh)->p)
+#define SSL_CTX_get_ciphers(ctx) (ctx)->cipher_list
 #endif
 
 extern "C" int DcmTLSTransportLayer_certificateValidationCallback(int ok, X509_STORE_CTX *storeContext);
 
 OFLogger DCM_dcmtlsLogger = OFLog::getLogger("dcmtk.dcmtls");
 
+
+/*  This static function creates a hard-coded set of Diffie-Hellman parameters
+ *  with 2048 bits key size that is used for ephemeral Diffie-Hellmane
+ *  (DHE_) ciphersuites unless the user replaces the parameter set
+ *  by calling DcmTLSTransportLayer::setTempDHParameters().
+ *  Using a hard-coded DH parameter set is safe because the DH key exchange
+ *  does not require these parameters to be secret. It is, however, still
+ *  preferable to use a user-generated set of parameters.
+ *
+ *  Generated by calling "openssl dhparam -C -noout 2048".
+ */
+static DH *get_dh2048()
+{
+    static unsigned char dh2048_p[] = {
+       0xC8, 0x04, 0xF6, 0xBF, 0x4B, 0xA6, 0xBA, 0x24, 0xD8, 0x79,
+       0xA9, 0x70, 0xFF, 0xA0, 0x6B, 0x9F, 0x9D, 0x56, 0x0F, 0x41,
+       0x75, 0x70, 0x69, 0x17, 0xBC, 0x89, 0xB5, 0x38, 0xEE, 0x8A,
+       0xA9, 0x2E, 0xFD, 0xC8, 0xD3, 0xBA, 0x43, 0x77, 0x51, 0x46,
+       0xBF, 0x59, 0xE0, 0x57, 0xFA, 0x55, 0x6A, 0xC2, 0x4B, 0x63,
+       0x24, 0xEE, 0x9E, 0x64, 0x96, 0xBE, 0x13, 0xF7, 0x0B, 0xEC,
+       0x0E, 0xEA, 0xC8, 0x8B, 0x3A, 0x59, 0xB5, 0x28, 0xF6, 0x49,
+       0x40, 0xC7, 0x89, 0x80, 0x39, 0x97, 0x66, 0x7A, 0xC5, 0x90,
+       0xB7, 0x98, 0x3F, 0x11, 0x45, 0xEA, 0xA2, 0xF1, 0x77, 0x7B,
+       0xBE, 0x3F, 0x5A, 0x5C, 0xD5, 0xA4, 0x5F, 0xBA, 0x96, 0x87,
+       0x77, 0x2D, 0x23, 0xA0, 0x56, 0x5B, 0x14, 0x2D, 0xD6, 0x6C,
+       0xF1, 0xCC, 0x0F, 0xD9, 0x7D, 0x42, 0x72, 0x9A, 0x8B, 0xBE,
+       0x3E, 0xCB, 0xB4, 0xE3, 0xB9, 0xA8, 0xC2, 0x8F, 0xBA, 0xEB,
+       0x12, 0xFE, 0x3E, 0x90, 0x4B, 0xDC, 0x8C, 0xA0, 0xD2, 0x26,
+       0x1F, 0x26, 0x78, 0x6E, 0x89, 0x15, 0x59, 0xED, 0x8B, 0x7E,
+       0x00, 0x5E, 0xFF, 0xDB, 0x55, 0x60, 0xE3, 0x52, 0x8A, 0x03,
+       0x9C, 0xE1, 0x33, 0xE6, 0x9F, 0x17, 0x39, 0x42, 0xE7, 0x26,
+       0xAE, 0x3D, 0xC0, 0x66, 0x9F, 0x3C, 0x97, 0xC6, 0x75, 0xAC,
+       0x5B, 0xD1, 0xB2, 0x51, 0xCA, 0xB6, 0x4F, 0xFD, 0xAF, 0x41,
+       0xF8, 0x8B, 0x5A, 0x8D, 0xC7, 0xCA, 0x3A, 0xB7, 0xE3, 0x00,
+       0x7D, 0x20, 0xFA, 0xF1, 0xDE, 0xDA, 0x10, 0xBD, 0x85, 0x09,
+       0xA0, 0xE1, 0x24, 0x18, 0x64, 0x38, 0xBA, 0x1C, 0x16, 0x15,
+       0x71, 0xA6, 0xC2, 0x02, 0xBA, 0x27, 0xF4, 0xE3, 0x3F, 0xA2,
+       0x2E, 0x89, 0xBA, 0xC9, 0xCD, 0x0B, 0x5A, 0x95, 0x26, 0x7D,
+       0x10, 0xBE, 0xE3, 0x96, 0x99, 0x4A, 0x2F, 0xAB, 0x9B, 0xBD,
+       0xD0, 0xB9, 0xDC, 0x43, 0xF9, 0xCB
+    };
+    static unsigned char dh2048_g[] = { 0x02 };
+
+    DH *dh;
+    if ((dh=DH_new()) == NULL) return(NULL);
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+    dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL);
+    dh->g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL);
+    if ((dh->p == NULL) || (dh->g == NULL))
+    {
+      DH_free(dh);
+      return(NULL);
+    }
+#else
+    // API change in OpenSSL 1.1.0: DH is now an opaque type
+    BIGNUM *dhp_bn = BN_bin2bn(dh2048_p, sizeof (dh2048_p), NULL);
+    BIGNUM *dhg_bn = BN_bin2bn(dh2048_g, sizeof (dh2048_g), NULL);
+    if (dhp_bn == NULL || dhg_bn == NULL || !DH_set0_pqg(dh, dhp_bn, NULL, dhg_bn))
+       {
+        DH_free(dh);
+        BN_free(dhp_bn);
+        BN_free(dhg_bn);
+        return NULL;
+    }
+#endif
+
+    return dh;
+}
+
 int DcmTLSTransportLayer_certificateValidationCallback(int ok, X509_STORE_CTX * /* storeContext */)
 {
   // this callback is called whenever OpenSSL has validated a X.509 certificate.
@@ -78,156 +156,178 @@ int DcmTLSTransportLayer_passwordCallback(char *buf, int size, int /* rwflag */,
 {
   if (userdata == NULL) return -1;
   OFString *password = OFreinterpret_cast(OFString *, userdata);
-  int passwordSize = password->length();
+  int passwordSize = OFstatic_cast(int, password->length());
   if (passwordSize > size) passwordSize = size;
   strncpy(buf, password->c_str(), passwordSize);
   return passwordSize;
 }
 
-
-struct DcmCipherSuiteList
-{
-  const char *TLSname;
-  const char *openSSLName;
-};
-
-static const DcmCipherSuiteList cipherSuiteList[] =
-{
-    {"TLS_RSA_WITH_NULL_MD5",                   SSL3_TXT_RSA_NULL_MD5},
-    {"TLS_RSA_WITH_NULL_SHA",                   SSL3_TXT_RSA_NULL_SHA},
-    {"TLS_RSA_WITH_RC4_128_MD5",                SSL3_TXT_RSA_RC4_128_MD5},
-    {"TLS_RSA_WITH_RC4_128_SHA",                SSL3_TXT_RSA_RC4_128_SHA},
-    {"TLS_RSA_WITH_IDEA_CBC_SHA",               SSL3_TXT_RSA_IDEA_128_SHA},
-    {"TLS_RSA_WITH_DES_CBC_SHA",                SSL3_TXT_RSA_DES_64_CBC_SHA},
-    {"TLS_RSA_WITH_3DES_EDE_CBC_SHA",           SSL3_TXT_RSA_DES_192_CBC3_SHA},
-    {"TLS_DH_DSS_WITH_DES_CBC_SHA",             SSL3_TXT_DH_DSS_DES_64_CBC_SHA},
-    {"TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA",        SSL3_TXT_DH_DSS_DES_192_CBC3_SHA},
-    {"TLS_DH_RSA_WITH_DES_CBC_SHA",             SSL3_TXT_DH_RSA_DES_64_CBC_SHA},
-    {"TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA",        SSL3_TXT_DH_RSA_DES_192_CBC3_SHA},
-    {"TLS_DHE_DSS_WITH_DES_CBC_SHA",            SSL3_TXT_EDH_DSS_DES_64_CBC_SHA},
-    {"TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA",       SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA},
-    {"TLS_DHE_RSA_WITH_DES_CBC_SHA",            SSL3_TXT_EDH_RSA_DES_64_CBC_SHA},
-    {"TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA",       SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA},
-    {"TLS_DH_anon_WITH_RC4_128_MD5",            SSL3_TXT_ADH_RC4_128_MD5},
-    {"TLS_DH_anon_WITH_DES_CBC_SHA",            SSL3_TXT_ADH_DES_64_CBC_SHA},
-    {"TLS_DH_anon_WITH_3DES_EDE_CBC_SHA",       SSL3_TXT_ADH_DES_192_CBC_SHA},
-    {"TLS_DHE_DSS_WITH_RC4_128_SHA",            TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA}
-
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-    ,
-    /* AES ciphersuites from RFC3268 */
-    {"TLS_RSA_WITH_AES_128_CBC_SHA",            TLS1_TXT_RSA_WITH_AES_128_SHA},
-    {"TLS_DH_DSS_WITH_AES_128_CBC_SHA",         TLS1_TXT_DH_DSS_WITH_AES_128_SHA},
-    {"TLS_DH_RSA_WITH_AES_128_CBC_SHA",         TLS1_TXT_DH_RSA_WITH_AES_128_SHA},
-    {"TLS_DHE_DSS_WITH_AES_128_CBC_SHA",        TLS1_TXT_DHE_DSS_WITH_AES_128_SHA},
-    {"TLS_DHE_RSA_WITH_AES_128_CBC_SHA",        TLS1_TXT_DHE_RSA_WITH_AES_128_SHA},
-    {"TLS_DH_anon_WITH_AES_128_CBC_SHA",        TLS1_TXT_ADH_WITH_AES_128_SHA},
-    {"TLS_RSA_WITH_AES_256_CBC_SHA",            TLS1_TXT_RSA_WITH_AES_256_SHA},
-    {"TLS_DH_DSS_WITH_AES_256_CBC_SHA",         TLS1_TXT_DH_DSS_WITH_AES_256_SHA},
-    {"TLS_DH_RSA_WITH_AES_256_CBC_SHA",         TLS1_TXT_DH_RSA_WITH_AES_256_SHA},
-    {"TLS_DHE_DSS_WITH_AES_256_CBC_SHA",        TLS1_TXT_DHE_DSS_WITH_AES_256_SHA},
-    {"TLS_DHE_RSA_WITH_AES_256_CBC_SHA",        TLS1_TXT_DHE_RSA_WITH_AES_256_SHA},
-    {"TLS_DH_anon_WITH_AES_256_CBC_SHA",        TLS1_TXT_ADH_WITH_AES_256_SHA}
-#endif
-
-};
-
-unsigned long DcmTLSTransportLayer::getNumberOfCipherSuites()
-{
-  return sizeof(cipherSuiteList)/sizeof(DcmCipherSuiteList);
-}
-
-const char *DcmTLSTransportLayer::getTLSCipherSuiteName(unsigned long idx)
-{
-  if (idx < sizeof(cipherSuiteList)/sizeof(DcmCipherSuiteList)) return cipherSuiteList[idx].TLSname;
-  return NULL;
-}
-
-const char *DcmTLSTransportLayer::getOpenSSLCipherSuiteName(unsigned long idx)
-{
-  if (idx < sizeof(cipherSuiteList)/sizeof(DcmCipherSuiteList)) return cipherSuiteList[idx].openSSLName;
-  return NULL;
-}
-
-const char *DcmTLSTransportLayer::findOpenSSLCipherSuiteName(const char *tlsCipherSuiteName)
-{
-  if (tlsCipherSuiteName == NULL) return NULL;
-  OFString aString(tlsCipherSuiteName);
-  unsigned long numEntries = sizeof(cipherSuiteList)/sizeof(DcmCipherSuiteList);
-  for (unsigned long i = 0; i < numEntries; i++)
-  {
-    if (aString == cipherSuiteList[i].TLSname) return cipherSuiteList[i].openSSLName;
-  }
-  return NULL;
-}
-
 DcmTLSTransportLayer::DcmTLSTransportLayer()
 : DcmTransportLayer()
 , transportLayerContext(NULL)
 , canWriteRandseed(OFFalse)
 , privateKeyPasswd()
+, role(NET_ACCEPTORREQUESTOR)
 {
-
 }
 
-DcmTLSTransportLayer::DcmTLSTransportLayer(int networkRole, const char *randFile, OFBool initializeOpenSSL)
-: DcmTransportLayer(networkRole)
+DcmTLSTransportLayer::DcmTLSTransportLayer(T_ASC_NetworkRole networkRole, const char *randFile, OFBool initOpenSSL)
+: DcmTransportLayer()
 , transportLayerContext(NULL)
 , canWriteRandseed(OFFalse)
 , privateKeyPasswd()
+, role(networkRole)
 {
-   if (initializeOpenSSL)
-   {
-     // the call to SSL_library_init was not needed in OpenSSL versions prior to 0.9.8,
-     // but the API has been available at least since 0.9.5.
-     SSL_library_init();
-     SSL_load_error_strings();
-     OpenSSL_add_all_algorithms();
-     seedPRNG(randFile);
-   }
+   if (initOpenSSL) initializeOpenSSL();
+   if (randFile) seedPRNG(randFile);
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
    // on versions of OpenSSL older than 1.1.0, we use the
    // SSLv23 methods and not the TLSv1 methods because the latter
    // only accept TLS 1.0 and prevent the negotiation of newer
    // versions of TLS.
    // We use SSL_CTX_set_options() to disable SSLv2 and SSLv3.
-   if (networkRole == DICOM_APPLICATION_ACCEPTOR)
+   switch (networkRole)
    {
-     transportLayerContext = SSL_CTX_new(SSLv23_server_method());
-   } else if (networkRole == DICOM_APPLICATION_REQUESTOR) {
-     transportLayerContext = SSL_CTX_new(SSLv23_client_method());
-   } else {
-     transportLayerContext = SSL_CTX_new(SSLv23_method());
+     case NET_ACCEPTOR:
+       transportLayerContext = SSL_CTX_new(SSLv23_server_method());
+       break;
+     case NET_REQUESTOR:
+       transportLayerContext = SSL_CTX_new(SSLv23_client_method());
+       break;
+     case NET_ACCEPTORREQUESTOR:
+       transportLayerContext = SSL_CTX_new(SSLv23_method());
+       break;
    }
-   SSL_CTX_set_options(transportLayerContext, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3);
-
+   if (transportLayerContext) SSL_CTX_set_options(transportLayerContext, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3);
 #else
    // starting with OpenSSL 1.1.0, a new TLS_method() is offered
    // that automatically selects the highest version of the TLS
    // protocol supported by client and server.
    // The previous TLSv1_methods are now deprecated and generate
    // a warning.
-   if (networkRole == DICOM_APPLICATION_ACCEPTOR)
+   switch (networkRole)
    {
-     transportLayerContext = SSL_CTX_new(TLS_server_method());
-   } else if (networkRole == DICOM_APPLICATION_REQUESTOR) {
-     transportLayerContext = SSL_CTX_new(TLS_client_method());
-   } else {
-     transportLayerContext = SSL_CTX_new(TLS_method());
+     case NET_ACCEPTOR:
+       transportLayerContext = SSL_CTX_new(TLS_server_method());
+       break;
+     case NET_REQUESTOR:
+       transportLayerContext = SSL_CTX_new(TLS_client_method());
+       break;
+     case NET_ACCEPTORREQUESTOR:
+       transportLayerContext = SSL_CTX_new(TLS_method());
+       break;
    }
-#endif
 
-#ifdef DEBUG
+   // starting with OpenSSL 1.1.0, we explicitly need to set the security level to 0
+   // if we want to support any of the NULL ciphersuites. Since we manage the list
+   // of supported ciphersuites ourselves and prevent a mix of NULL and non-NULL
+   // ciphersuites, this is safe.
+   if (transportLayerContext) SSL_CTX_set_security_level(transportLayerContext, 0);
+ #endif
+
    if (transportLayerContext == NULL)
    {
       const char *result = ERR_reason_error_string(ERR_peek_error());
       if (result == NULL) result = "unknown error in SSL_CTX_new()";
       DCMTLS_ERROR("unable to create TLS transport layer: " << result);
    }
-#endif
+   else
+   {
+     // create default set of DH parameters
+     DH *dhparams = get_dh2048();
+     if (dhparams)
+     {
+       SSL_CTX_set_tmp_dh(transportLayerContext,dhparams);
+       DH_free(dhparams); // safe because of reference counting
+     }
+     else DCMTLS_ERROR("unable to create Diffie-Hellman parameters.");
+
+     // create Elliptic Curve DH parameters
+#ifndef OPENSSL_NO_ECDH
+#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
+     // we create ECDH parameters for the NIST P-256 (secp256r1) curve
+     // as recommended by BCP 195.
+     EC_KEY  *ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
+     if (ecdh)
+     {
+       SSL_CTX_set_tmp_ecdh(transportLayerContext, ecdh);
+       EC_KEY_free(ecdh); /* Safe because of reference counts */
+     }
+     else DCMTLS_ERROR("unable to create Elliptic-Curve Diffie-Hellman parameters.");
+#else
+    // OpenSSL 1.0.2 and newer have this function, which causes
+    // the server to automatically select the most appropriate shared curve for each client.
+    if (0 == SSL_CTX_set_ecdh_auto(transportLayerContext, 1))
+    {
+      DCMTLS_ERROR("unable to create Elliptic-Curve Diffie-Hellman parameters.");
+    }
+#endif /* OPENSSL_VERSION_NUMBER < 0x10002000L */
+#endif /* OPENSSL_NO_ECDH */
+
+    // set default certificate verification strategy
+    setCertificateVerification(DCV_requireCertificate);
+
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+    // The TLS 1.2 Signature Algorithms extension is only supported in OpenSSL 1.0.2 and newer.
+
+    if (networkRole != NET_ACCEPTOR)
+    {
+      // BCP 195: Clients SHOULD indicate to servers that they request SHA-256,
+      // by using the "Signature Algorithms" extension defined in TLS 1.2.
+      // We implement this by requesting SHA-256 OR BETTER, i.e. we also indicate
+      // support for SHA-384 and SHA-512.
+
+      const int slist[] = {NID_sha256, EVP_PKEY_RSA, NID_sha256, EVP_PKEY_DSA, NID_sha256, EVP_PKEY_EC,
+                           NID_sha384, EVP_PKEY_RSA, NID_sha384, EVP_PKEY_DSA, NID_sha384, EVP_PKEY_EC,
+                           NID_sha512, EVP_PKEY_RSA, NID_sha512, EVP_PKEY_DSA, NID_sha512, EVP_PKEY_EC};
 
-   setCertificateVerification(DCV_requireCertificate); /* default */
+      if (0 == SSL_CTX_set1_sigalgs(transportLayerContext, slist, sizeof(slist)/sizeof(int)))
+      {
+        DCMTLS_ERROR("unable to configure the TLS 1.2 Signature Algorithms extension.");
+      }
+    }
+
+    // The TLS Supported Elliptic Curves extension (RFC 4492) is only supported in OpenSSL 1.0.2 and newer.
+
+    // BCP 195: Both clients and servers SHOULD include the "Supported Elliptic Curves" extension.
+    // For interoperability, clients and servers SHOULD support the NIST P-256 (secp256r1) curve
+    // (in OpenSSL this curve is called "prime256v1").
+
+    // BCP 195: Curves of less than 192 bits SHOULD NOT be used.
+    // Actually we only enable curves with at least 256 bits in DCMTK, following NIST and BSI recommendations.
+    const int eclist[] = {
+      // The list of elliptic curves actually supported by OpenSSL 1.0.2
+      // seems to be undocumented. See implementation of tls1_ec_nid2curve_id()
+      // for a list of supported NIDs. Here are all elliptic curves
+      // supported by OpenSSL 1.0.2 that have 256 or more bits.
+      NID_X9_62_prime256v1,  NID_secp256k1,         NID_secp384r1,
+      NID_secp521r1,         NID_sect283k1,         NID_sect283r1,
+      NID_sect409k1,         NID_sect409r1,         NID_sect571k1,
+      NID_sect571r1,         NID_brainpoolP256r1,   NID_brainpoolP384r1,
+      NID_brainpoolP512r1
+    };
+
+    if (0 == SSL_CTX_set1_curves(transportLayerContext, eclist, sizeof(eclist)/sizeof(int)))
+    {
+      DCMTLS_ERROR("unable to configure the TLS Supported Elliptic Curves extension.");
+    }
+#endif /* OPENSSL_VERSION_NUMBER >= 0x10002000L */
+
+    if (NET_REQUESTOR != networkRole)
+    {
+      // BCP 195: Servers MUST prefer TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 over weaker cipher suites whenever it is proposed, even if it is not the first proposal.
+      // BCP 195: Servers SHOULD prefer stronger cipher suites unless there are compelling reasons to choose otherwise
+      // BCP 195: Implementations MUST support and prefer to negotiate cipher suites offering forward secrecy
+      // This all requires that when acting as a server we select the ciphersuites by our order of preference,
+      // which implements all three recommendations by sorting the list of supported ciphersuites appropriately.
+      if (0 == SSL_CTX_set_options(transportLayerContext, SSL_OP_CIPHER_SERVER_PREFERENCE))
+      {
+        DCMTLS_ERROR("unable to configure the TLS layer to select ciphersuites by server preference.");
+      }
+    }
+
+  } /* transportLayerContext != NULL */
 }
 
 DcmTLSTransportLayer::DcmTLSTransportLayer(OFrvalue_ref(DcmTLSTransportLayer) rhs)
@@ -285,8 +385,16 @@ OFBool DcmTLSTransportLayer::setTempDHParameters(const char *filename)
     BIO_free(bio);
     if (dh)
     {
+      // check BCP 195 recommendation: With a key exchange based on modular
+      // exponential (MODP) Diffie-Hellman groups ("DHE" cipher suites),
+      // DH key lengths of at least 2048 bits are RECOMMENDED.
+      if (DH_bits(dh) < 2048)
+      {
+        DCMTLS_WARN("Key length of Diffie-Hellman parameter file too short: RFC 7525 recommends at least 2048 bits, but the key in file '"
+          << filename << "' is only " << DH_bits(dh) << " bits.");
+      }
       SSL_CTX_set_tmp_dh(transportLayerContext,dh);
-      DH_free(dh);
+      DH_free(dh); /* Safe because of reference counts in OpenSSL */
       return OFTrue;
     }
   }
@@ -297,7 +405,6 @@ void DcmTLSTransportLayer::setPrivateKeyPasswd(const char *thePasswd)
 {
   if (thePasswd) privateKeyPasswd = thePasswd;
   else privateKeyPasswd.clear();
-
   if (transportLayerContext)
   {
     /* register callback that replaces console input */
@@ -340,18 +447,23 @@ void DcmTLSTransportLayer::setCertificateVerification(DcmCertificateVerification
   return;
 }
 
-
-DcmTransportLayerStatus DcmTLSTransportLayer::setCipherSuites(const char *suites)
+DcmTransportLayerStatus DcmTLSTransportLayer::activateCipherSuites()
 {
-  if (transportLayerContext && suites)
+  OFString cslist;
+  ciphersuites.getListOfCipherSuitesForOpenSSL(cslist, (role != NET_REQUESTOR));
+  if (transportLayerContext)
   {
-    if (!SSL_CTX_set_cipher_list(transportLayerContext, suites))
+    if (!SSL_CTX_set_cipher_list(transportLayerContext, cslist.c_str()))
     {
       const char *err = ERR_reason_error_string(ERR_peek_error());
       if (err) DCMTLS_ERROR("OpenSSL error: " << err);
       return TCS_tlsError;
     }
+
+    SSL_CTX_set_options(transportLayerContext, ciphersuites.getTLSOptions());
+
   } else return TCS_illegalCall;
+
   return TCS_ok;
 }
 
@@ -360,12 +472,11 @@ DcmTLSTransportLayer::~DcmTLSTransportLayer()
   clear();
 }
 
-DcmTransportLayerStatus DcmTLSTransportLayer::setPrivateKeyFile(const char *fileName, int fileType)
+DcmTransportLayerStatus DcmTLSTransportLayer::setPrivateKeyFile(const char *fileName, DcmKeyFileFormat fileType)
 {
-  /* fileType should be SSL_FILETYPE_ASN1 or SSL_FILETYPE_PEM */
   if (transportLayerContext)
   {
-    if (0 >= SSL_CTX_use_PrivateKey_file(transportLayerContext, fileName, fileType))
+    if (0 >= SSL_CTX_use_PrivateKey_file(transportLayerContext, fileName, lookupOpenSSLCertificateFormat(fileType)))
     {
       const char *err = ERR_reason_error_string(ERR_peek_error());
       if (err) DCMTLS_ERROR("OpenSSL error: " << err);
@@ -375,12 +486,32 @@ DcmTransportLayerStatus DcmTLSTransportLayer::setPrivateKeyFile(const char *file
   return TCS_ok;
 }
 
-DcmTransportLayerStatus DcmTLSTransportLayer::setCertificateFile(const char *fileName, int fileType)
+DcmTransportLayerStatus DcmTLSTransportLayer::setCertificateFile(const char *fileName, DcmKeyFileFormat fileType)
 {
-  /* fileType should be SSL_FILETYPE_ASN1 or SSL_FILETYPE_PEM */
   if (transportLayerContext)
   {
-    if (0 >= SSL_CTX_use_certificate_file(transportLayerContext, fileName, fileType))
+    int result = 0;
+    X509 *certificate = loadCertificateFile(fileName, fileType);
+    if (certificate)
+    {
+      // TODO: Check if the certificate is RSA, and if so, if the public key is >= 2048 bits
+      int bits = getRSAKeySize(certificate);
+      if ((bits > 0) && (bits < 2048))
+      {
+        DCMTLS_WARN("Key length of RSA public key too short: RFC 7525 recommends at least 2048 bits for RSA keys, but the key in certificate file '"
+          << fileName << "' is only " << bits << " bits.");
+      }
+      const char *hash = checkRSAHashKeyIsSHA2(certificate);
+      if (hash)
+      {
+        DCMTLS_WARN("Certificate hash key not SHA-256: RFC 7525 recommends the use of SHA-256 for RSA certificates, but certificate file '"
+          << fileName << "' uses '" << hash << "'.");
+      }
+      result = SSL_CTX_use_certificate(transportLayerContext, certificate); // copies certificate into context
+      X509_free(certificate);
+    } else result = -1;
+
+    if (result <= 0)
     {
       const char *err = ERR_reason_error_string(ERR_peek_error());
       if (err) DCMTLS_ERROR("OpenSSL error: " << err);
@@ -405,9 +536,8 @@ DcmTransportLayerStatus DcmTLSTransportLayer::addVerificationFlags(unsigned long
   return parameter && X509_VERIFY_PARAM_set_flags(parameter,flags) ? TCS_ok : TCS_unspecifiedError;
 }
 
-DcmTransportLayerStatus DcmTLSTransportLayer::addTrustedCertificateFile(const char *fileName, int fileType)
+DcmTransportLayerStatus DcmTLSTransportLayer::addTrustedCertificateFile(const char *fileName, DcmKeyFileFormat fileType)
 {
-  /* fileType should be SSL_FILETYPE_ASN1 or SSL_FILETYPE_PEM */
   if (transportLayerContext)
   {
     X509_LOOKUP *x509_lookup = X509_STORE_add_lookup(SSL_CTX_get_cert_store(transportLayerContext), X509_LOOKUP_file());
@@ -417,7 +547,7 @@ DcmTransportLayerStatus DcmTLSTransportLayer::addTrustedCertificateFile(const ch
       if (err) DCMTLS_ERROR("OpenSSL error: " << err);
       return TCS_tlsError;
     }
-    if (! X509_LOOKUP_load_file(x509_lookup, fileName, fileType))
+    if (! X509_LOOKUP_load_file(x509_lookup, fileName, lookupOpenSSLCertificateFormat(fileType)))
     {
       const char *err = ERR_reason_error_string(ERR_peek_error());
       if (err) DCMTLS_ERROR("OpenSSL error: " << err);
@@ -427,9 +557,8 @@ DcmTransportLayerStatus DcmTLSTransportLayer::addTrustedCertificateFile(const ch
   return TCS_ok;
 }
 
-DcmTransportLayerStatus DcmTLSTransportLayer::addTrustedCertificateDir(const char *pathName, int fileType)
+DcmTransportLayerStatus DcmTLSTransportLayer::addTrustedCertificateDir(const char *pathName, DcmKeyFileFormat fileType)
 {
-  /* fileType should be SSL_FILETYPE_ASN1 or SSL_FILETYPE_PEM */
   if (transportLayerContext)
   {
     X509_LOOKUP *x509_lookup = X509_STORE_add_lookup(SSL_CTX_get_cert_store(transportLayerContext), X509_LOOKUP_hash_dir());
@@ -439,7 +568,7 @@ DcmTransportLayerStatus DcmTLSTransportLayer::addTrustedCertificateDir(const cha
       if (err) DCMTLS_ERROR("OpenSSL error: " << err);
       return TCS_tlsError;
     }
-    if (! X509_LOOKUP_add_dir(x509_lookup, pathName, fileType))
+    if (! X509_LOOKUP_add_dir(x509_lookup, pathName, lookupOpenSSLCertificateFormat(fileType)))
     {
       const char *err = ERR_reason_error_string(ERR_peek_error());
       if (err) DCMTLS_ERROR("OpenSSL error: " << err);
@@ -454,14 +583,15 @@ DcmTransportLayerStatus DcmTLSTransportLayer::addTrustedClientCertificateFile(co
   if (transportLayerContext)
   {
     STACK_OF(X509_NAME) *caNames = sk_X509_NAME_dup(SSL_CTX_get_client_CA_list(transportLayerContext));
-    if (caNames == NULL)
-      caNames = sk_X509_NAME_new_null();
+    if (caNames == NULL) caNames = sk_X509_NAME_new_null();
     STACK_OF(X509_NAME) *newCaNames = SSL_load_client_CA_file(fileName);
     for (int i = 0; i < sk_X509_NAME_num(newCaNames); ++i)
     {
       X509_NAME *newCaName = sk_X509_NAME_value(newCaNames,i);
       if (sk_X509_NAME_find(caNames,newCaName) == -1)
+      {
         sk_X509_NAME_push(caNames,X509_NAME_dup(newCaName));
+      }
     }
     sk_X509_NAME_pop_free(newCaNames,X509_NAME_free);
     SSL_CTX_set_client_CA_list(transportLayerContext,caNames);
@@ -478,6 +608,9 @@ DcmTransportConnection *DcmTLSTransportLayer::createConnection(DcmNativeSocketTy
       SSL *newConnection = SSL_new(transportLayerContext);
       if (newConnection)
       {
+        // On Win64, the following line will cause a warning because the native
+        // type for sockets there is 64-bit, and OpenSSL uses a 32-bit int file descriptor.
+        // This should be fixed in OpenSSL, there is nothing we can do here.
         SSL_set_fd(newConnection, openSocket);
         return new DcmTLSConnection(openSocket, newConnection);
       }
@@ -583,7 +716,7 @@ OFString DcmTLSTransportLayer::dumpX509Certificate(X509 *peerCertificate)
       EVP_PKEY_free(pubkey);
     }
     OFOStringStream out;
-    out << "X.509v" << certVersion << " Certificate" << OFendl
+    out << "Peer X.509v" << certVersion << " Certificate" << OFendl
         << "  Subject     : " << certSubjectName << OFendl
         << "  Issued by   : " << certIssuerName << OFendl
         << "  Serial no.  : " << certSerialNumber << OFendl
@@ -592,15 +725,127 @@ OFString DcmTLSTransportLayer::dumpX509Certificate(X509 *peerCertificate)
     OFSTRINGSTREAM_GETOFSTRING(out, ret)
     return ret;
   } else {
-    return "No X.509 Certificate.";
+    return "Peer did not provide a certificate or certificate verification is disabled.";
   }
 }
 
+DcmTransportLayerStatus DcmTLSTransportLayer::setTLSProfile(DcmTLSSecurityProfile profile)
+{
+  return ciphersuites.setTLSProfile(profile);
+}
+
+void DcmTLSTransportLayer::clearTLSProfile()
+{
+  ciphersuites.clearTLSProfile();
+}
+
+DcmTransportLayerStatus DcmTLSTransportLayer::addCipherSuite(const char *suite)
+{
+  return ciphersuites.addCipherSuite(suite);
+}
+
 DcmTLSTransportLayer::native_handle_type DcmTLSTransportLayer::getNativeHandle()
 {
   return transportLayerContext;
 }
 
+int DcmTLSTransportLayer::lookupOpenSSLCertificateFormat(DcmKeyFileFormat fileType)
+{
+  int result = -1;
+  switch (fileType)
+  {
+    case DCF_Filetype_PEM:
+      result = SSL_FILETYPE_PEM;
+      break;
+    case DCF_Filetype_ASN1:
+      result = SSL_FILETYPE_ASN1;
+      break;
+  }
+  return result;
+}
+
+
+void DcmTLSTransportLayer::printSupportedCiphersuites(STD_NAMESPACE ostream& os) const
+{
+  ciphersuites.printSupportedCiphersuites(os);
+}
+
+void DcmTLSTransportLayer::getListOfCipherSuitesForOpenSSL(OFString& cslist) const
+{
+  ciphersuites.getListOfCipherSuitesForOpenSSL(cslist, (role != NET_REQUESTOR));
+}
+
+int DcmTLSTransportLayer::getRSAKeySize(X509 *certificate)
+{
+  if (certificate)
+  {
+    EVP_PKEY *pubkey = X509_get_pubkey(certificate); // creates a copy of the public key
+    if (pubkey && (EVP_PKEY_base_id(pubkey) == EVP_PKEY_RSA))
+    {
+      int certPubKeyBits = EVP_PKEY_bits(pubkey); // RSA public key size, in bits
+      EVP_PKEY_free(pubkey);
+      return certPubKeyBits;
+    }
+  }
+  return 0; // certificate not present or not RSA
+}
+
+const char *DcmTLSTransportLayer::checkRSAHashKeyIsSHA2(X509 *certificate)
+{
+  if (certificate)
+  {
+    EVP_PKEY *pubkey = X509_get_pubkey(certificate); // creates copy of public key
+    if (pubkey && (EVP_PKEY_base_id(pubkey) == EVP_PKEY_RSA))
+    {
+      int nid = X509_get_signature_nid(certificate);
+      EVP_PKEY_free(pubkey);
+      switch (nid)
+      {
+          case NID_sha256WithRSAEncryption:
+          case NID_sha384WithRSAEncryption:
+          case NID_sha512WithRSAEncryption:
+          return NULL; // hash key uses SHA256 (or better)
+        default:
+          return OBJ_nid2sn(nid); // hash key does not follow BCP 195 recommendation to use SHA256
+      }
+    }
+  }
+  return NULL; // default: everything is OK
+}
+
+X509 *DcmTLSTransportLayer::loadCertificateFile(const char *fileName, DcmKeyFileFormat fileType)
+{
+  X509 *result = NULL;
+  BIO *in=BIO_new_file(fileName, "rb");
+  if (in)
+  {
+    if (fileType == DCF_Filetype_ASN1)
+    {
+      result=d2i_X509_bio(in,NULL);
+    }
+    else if (fileType == DCF_Filetype_PEM)
+    {
+      result=PEM_read_bio_X509(in, NULL, NULL, NULL);
+    }
+    BIO_free(in);
+  }
+  return result;
+}
+
+void DcmTLSTransportLayer::initializeOpenSSL()
+{
+  // the call to SSL_library_init was not needed in OpenSSL versions prior to 0.9.8,
+  // but the API has been available at least since 0.9.5.
+  SSL_library_init();
+  SSL_load_error_strings();
+  OpenSSL_add_all_algorithms();
+}
+
+const char *DcmTLSTransportLayer::getOpenSSLVersionName()
+{
+  return OPENSSL_VERSION_TEXT;
+}
+
 #else  /* WITH_OPENSSL */
 
 /* make sure that the object file is not completely empty if compiled
index 23a8e5eaaaee4cc38e141892853aff2fb3a3176e..6839fe2bfd8ff75d546f893fa3d9a5c60d7e73df 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, OFFIS e.V.
+ *  Copyright (C) 2017-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -13,7 +13,7 @@
  *
  *  Module: dcmtls
  *
- *  Author: Jan Schlamelcher
+ *  Author: Jan Schlamelcher, Marco Eichelberg
  *
  *  Purpose:
  *    classes: DcmTLSOptions
  */
 
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
-
+#include "dcmtk/dcmtls/tlsopt.h"
 #include "dcmtk/ofstd/ofcmdln.h"
 #include "dcmtk/dcmtls/tlscond.h"
-#include "dcmtk/dcmtls/tlsopt.h"
+#include "dcmtk/dcmnet/assoc.h"       /* for ASC_setTransportLayer() */
 
 void DcmTLSOptions::printLibraryVersion()
 {
 #ifdef WITH_OPENSSL
-    COUT << "- " << OPENSSL_VERSION_TEXT << OFendl;
-#endif
+    COUT << "- " << DcmTLSTransportLayer::getOpenSSLVersionName() << OFendl;
+#endif // WITH_OPENSSL
 }
 
-DcmTLSOptions::DcmTLSOptions( OFConsoleApplication& app, OFCommandLine& cmd )
+DcmTLSOptions::DcmTLSOptions(T_ASC_NetworkRole networkRole)
 #ifdef WITH_OPENSSL
-: m_ConsoleApp( app )
-, m_CommandLine( cmd )
-, opt_keyFileFormat( SSL_FILETYPE_PEM )
+: opt_keyFileFormat( DCF_Filetype_PEM )
 , opt_doAuthenticate( OFFalse )
 , opt_privateKeyFile( OFnullptr )
 , opt_certificateFile( OFnullptr )
 , opt_passwd( OFnullptr )
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-, opt_ciphersuites( TLS1_TXT_RSA_WITH_AES_128_SHA ":" SSL3_TXT_RSA_DES_192_CBC3_SHA )
-#else
-, opt_ciphersuites( SSL3_TXT_RSA_DES_192_CBC3_SHA )
-#endif
+, opt_tlsProfile( TSP_Profile_BCP195 ) // default: BCP 195 profile
 , opt_readSeedFile( OFnullptr )
 , opt_writeSeedFile( OFnullptr )
 , opt_certVerification( DCV_requireCertificate )
 , opt_dhparam( OFnullptr )
 , opt_secureConnection( OFFalse ) // default: no secure connection
+, opt_networkRole( networkRole )
+, tLayer( OFnullptr )
+#endif
 {
-    m_CommandLine.addGroup( "transport layer security (TLS) options:" );
-        m_CommandLine.addSubGroup( "transport protocol stack:");
-            m_CommandLine.addOption( "--disable-tls",         "-tls",    "use normal TCP/IP connection (default)" );
-            m_CommandLine.addOption( "--enable-tls",          "+tls", 2, "[p]rivate key file, [c]ertificate file: string",
-                                                              "use authenticated secure TLS connection" );
-            m_CommandLine.addOption( "--anonymous-tls",       "+tla",    "use secure TLS connection without certificate" );
-        m_CommandLine.addSubGroup( "private key password (only with --enable-tls):" );
-            m_CommandLine.addOption( "--std-passwd",          "+ps",     "prompt user to type password on stdin (default)" );
-            m_CommandLine.addOption( "--use-passwd",          "+pw",  1, "[p]assword: string ",
-                                                              "use specified password" );
-            m_CommandLine.addOption( "--null-passwd",         "-pw",     "use empty string as password" );
-        m_CommandLine.addSubGroup( "key and certificate file format:" );
-            m_CommandLine.addOption( "--pem-keys",            "-pem",    "read keys and certificates as PEM file (default)" );
-            m_CommandLine.addOption( "--der-keys",            "-der",    "read keys and certificates as DER file" );
-        m_CommandLine.addSubGroup( "certification authority:" );
-            m_CommandLine.addOption( "--add-cert-file",       "+cf",  1, "[c]ertificate filename: string",
-                                                              "add certificate file to list of certificates", OFCommandLine::AF_NoWarning );
-            m_CommandLine.addOption( "--add-cert-dir",        "+cd",  1, "[c]ertificate directory: string",
-                                                              "add certificates in d to list of certificates", OFCommandLine::AF_NoWarning );
-        m_CommandLine.addSubGroup( "ciphersuite:");
-            m_CommandLine.addOption( "--cipher",              "+cs",  1, "[c]iphersuite name: string",
-                                                              "add ciphersuite to list of negotiated suites" );
-            m_CommandLine.addOption( "--dhparam",             "+dp",  1, "[f]ilename: string",
-                                                              "read DH parameters for DH/DSS ciphersuites" );
-        m_CommandLine.addSubGroup( "pseudo random generator:" );
-            m_CommandLine.addOption( "--seed",                "+rs",  1, "[f]ilename: string",
-                                                              "seed random generator with contents of f" );
-            m_CommandLine.addOption( "--write-seed",          "+ws",     "write back modified seed (only with --seed)" );
-            m_CommandLine.addOption( "--write-seed-file",     "+wf",  1, "[f]ilename: string (only with --seed)",
-                                                              "write modified seed to file f" );
-        m_CommandLine.addSubGroup( "peer authentication:" );
-            m_CommandLine.addOption( "--require-peer-cert",   "-rc",     "verify peer certificate, fail if absent (default)" );
-            m_CommandLine.addOption( "--verify-peer-cert",    "-vc",     "verify peer certificate if present" );
-            m_CommandLine.addOption( "--ignore-peer-cert",    "-ic",     "don't verify peer certificate" );
 }
-#else // WITH_OPENSSL
+
+DcmTLSOptions::~DcmTLSOptions()
 {
-    // no OpenSSL available, don't add any command line arguments
+#ifdef WITH_OPENSSL
+  delete tLayer;
+#endif
 }
+
+void DcmTLSOptions::addTLSCommandlineOptions(OFCommandLine& cmd)
+{
+#ifdef WITH_OPENSSL
+  DcmTLSCiphersuiteHandler csh;
+
+  cmd.addGroup("transport layer security (TLS) options:");
+    cmd.addSubGroup("transport protocol stack:");
+      cmd.addOption("--disable-tls",        "-tls",    "use normal TCP/IP connection (default)");
+      cmd.addOption("--enable-tls",         "+tls", 2, "[p]rivate key file, [c]ertificate file: string",
+                                                       "use authenticated secure TLS connection");
+      if (opt_networkRole == NET_REQUESTOR)
+      {
+         // this command line options only makes sense for association requesters (TLS clients)
+         cmd.addOption("--anonymous-tls",   "+tla",    "use secure TLS connection without certificate");
+      }
+    cmd.addSubGroup("private key password (only with --enable-tls):");
+      cmd.addOption("--std-passwd",         "+ps",     "prompt user to type password on stdin (default)");
+      cmd.addOption("--use-passwd",         "+pw",  1, "[p]assword: string ",
+                                                       "use specified password");
+      cmd.addOption("--null-passwd",        "-pw",     "use empty string as password");
+    cmd.addSubGroup("key and certificate file format:");
+      cmd.addOption("--pem-keys",           "-pem",    "read keys and certificates as PEM file (default)");
+      cmd.addOption("--der-keys",           "-der",    "read keys and certificates as DER file");
+    cmd.addSubGroup("certification authority:");
+      cmd.addOption("--add-cert-file",      "+cf",  1, "[c]ertificate filename: string",
+                                                       "add certificate file to list of certificates");
+      cmd.addOption("--add-cert-dir",       "+cd",  1, "[c]ertificate directory: string",
+                                                       "add certificates in d to list of certificates");
+    cmd.addSubGroup("security profile:");
+      cmd.addOption("--profile-bcp195",     "+px",     "BCP 195 TLS Profile (default)");
+      cmd.addOption("--profile-bcp195-nd",  "+py",     "Non-downgrading BCP 195 TLS Profile");
+      if (csh.cipher3DESsupported())
+      {
+        cmd.addOption("--profile-basic",    "+pb",     "Basic TLS Secure Transport Connection Profile\n(retired)");
+      }
+      cmd.addOption("--profile-aes" ,       "+pa",     "AES TLS Secure Transport Connection Profile\n(retired)");
+      if (csh.cipherNULLsupported())
+      {
+        cmd.addOption("--profile-null",     "+pn",     "Authenticated unencrypted communication\n(retired, was used in IHE ATNA)");
+      }
+
+    cmd.addSubGroup("ciphersuite:");
+      cmd.addOption("--list-ciphers",       "+cc",     "show list of supported TLS ciphersuites and exit", OFCommandLine::AF_Exclusive);
+      cmd.addOption("--cipher",             "+cs",  1, "[c]iphersuite name: string",
+                                                       "add ciphersuite to list of negotiated suites");
+      if (opt_networkRole != NET_REQUESTOR)
+      {
+        // this command line options only makes sense for association acceptors (TLS servers)
+        // or systems that accept and request associations
+        cmd.addOption("--dhparam",          "+dp",  1, "[f]ilename: string",
+                                                       "read DH parameters for DH/DSS ciphersuites");
+      }
+    cmd.addSubGroup("pseudo random generator:");
+      cmd.addOption("--seed",               "+rs",  1, "[f]ilename: string",
+                                                       "seed random generator with contents of f");
+      cmd.addOption("--write-seed",         "+ws",     "write back modified seed (only with --seed)");
+      cmd.addOption("--write-seed-file",    "+wf",  1, "[f]ilename: string (only with --seed)",
+                                                       "write modified seed to file f");
+    cmd.addSubGroup("peer authentication:");
+      cmd.addOption("--require-peer-cert",  "-rc",     "verify peer certificate, fail if absent (default)");
+      if (opt_networkRole != NET_REQUESTOR)
+      {
+        // this command line options only makes sense for association acceptors (TLS servers)
+        // or systems that accept and request associations
+        cmd.addOption("--verify-peer-cert", "-vc",     "verify peer certificate if present");
+      }
+      cmd.addOption("--ignore-peer-cert",   "-ic",     "don't verify peer certificate");
+
 #endif // WITH_OPENSSL
+}
 
-OFCondition DcmTLSOptions::parseArguments()
+void DcmTLSOptions::parseArguments(OFConsoleApplication& app, OFCommandLine& cmd)
 {
 #ifdef WITH_OPENSSL
-    m_CommandLine.beginOptionBlock();
-    if( m_CommandLine.findOption( "--disable-tls" ) )
+    DcmTLSCiphersuiteHandler csh;
+
+    const char *tlsopts = (opt_networkRole == NET_REQUESTOR ?
+        "--enable-tls or --anonymous-tls" : "--enable-tls");
+
+    cmd.beginOptionBlock();
+    if( cmd.findOption( "--disable-tls" ) )
         opt_secureConnection = OFFalse;
-    if( m_CommandLine.findOption( "--enable-tls" ) )
+    if( cmd.findOption( "--enable-tls" ) )
     {
         opt_secureConnection = OFTrue;
         opt_doAuthenticate = OFTrue;
-        m_ConsoleApp.checkValue( m_CommandLine.getValue( opt_privateKeyFile ) );
-        m_ConsoleApp.checkValue( m_CommandLine.getValue( opt_certificateFile ) );
+        app.checkValue( cmd.getValue( opt_privateKeyFile ) );
+        app.checkValue( cmd.getValue( opt_certificateFile ) );
     }
-    if( m_CommandLine.findOption( "--anonymous-tls" ) )
-        opt_secureConnection = OFTrue;
-    m_CommandLine.endOptionBlock();
+    if (opt_networkRole == NET_REQUESTOR)
+    {
+        if( cmd.findOption( "--anonymous-tls" ) ) opt_secureConnection = OFTrue;
+    }
+    cmd.endOptionBlock();
 
-    m_CommandLine.beginOptionBlock();
-    if( m_CommandLine.findOption( "--std-passwd" ) )
+    cmd.beginOptionBlock();
+    if( cmd.findOption( "--std-passwd" ) )
     {
-        m_ConsoleApp.checkDependence("--std-passwd", "--enable-tls", opt_doAuthenticate);
+        app.checkDependence("--std-passwd", "--enable-tls", opt_doAuthenticate);
         opt_passwd = OFnullptr;
     }
-    if( m_CommandLine.findOption("--use-passwd") )
+    if( cmd.findOption("--use-passwd") )
     {
-        m_ConsoleApp.checkDependence( "--use-passwd", "--enable-tls", opt_doAuthenticate );
-        m_ConsoleApp.checkValue( m_CommandLine.getValue( opt_passwd ) );
+        app.checkDependence( "--use-passwd", "--enable-tls", opt_doAuthenticate );
+        app.checkValue( cmd.getValue( opt_passwd ) );
     }
-    if( m_CommandLine.findOption( "--null-passwd" ) )
+    if( cmd.findOption( "--null-passwd" ) )
     {
-        m_ConsoleApp.checkDependence( "--null-passwd", "--enable-tls", opt_doAuthenticate );
+        app.checkDependence( "--null-passwd", "--enable-tls", opt_doAuthenticate );
         opt_passwd = "";
     }
-    m_CommandLine.endOptionBlock();
-
-    m_CommandLine.beginOptionBlock();
-    if( m_CommandLine.findOption( "--pem-keys" ) )
-        opt_keyFileFormat = SSL_FILETYPE_PEM;
-    if( m_CommandLine.findOption( "--der-keys" ) )
-        opt_keyFileFormat = SSL_FILETYPE_ASN1;
-    m_CommandLine.endOptionBlock();
-
-    if( m_CommandLine.findOption( "--dhparam" ) )
-        m_ConsoleApp.checkValue( m_CommandLine.getValue( opt_dhparam ) );
-    if( m_CommandLine.findOption( "--seed" ) )
-        m_ConsoleApp.checkValue( m_CommandLine.getValue( opt_readSeedFile ) );
-
-    m_CommandLine.beginOptionBlock();
-    if( m_CommandLine.findOption( "--write-seed" ) )
+    cmd.endOptionBlock();
+
+    cmd.beginOptionBlock();
+    if( cmd.findOption( "--pem-keys" ) )
+    {
+        app.checkDependence("--pem-keys", tlsopts, opt_secureConnection);
+        opt_keyFileFormat = DCF_Filetype_PEM;
+    }
+    if( cmd.findOption( "--der-keys" ) )
+    {
+        app.checkDependence("--der-keys", tlsopts, opt_secureConnection);
+        opt_keyFileFormat = DCF_Filetype_ASN1;
+    }
+    cmd.endOptionBlock();
+
+    if( (opt_networkRole != NET_REQUESTOR) && cmd.findOption( "--dhparam" ) )
+    {
+        app.checkDependence("--dhparam", tlsopts, opt_secureConnection);
+        app.checkValue( cmd.getValue( opt_dhparam ) );
+    }
+    if( cmd.findOption( "--seed" ) )
+    {
+        app.checkDependence("--seed", tlsopts, opt_secureConnection);
+        app.checkValue( cmd.getValue( opt_readSeedFile ) );
+    }
+
+    cmd.beginOptionBlock();
+    if( cmd.findOption( "--write-seed" ) )
     {
-        m_ConsoleApp.checkDependence( "--write-seed", "--seed", opt_readSeedFile != OFnullptr );
+        app.checkDependence("--write-seed", tlsopts, opt_secureConnection);
+        app.checkDependence( "--write-seed", "--seed", opt_readSeedFile != OFnullptr );
         opt_writeSeedFile = opt_readSeedFile;
     }
-    if( m_CommandLine.findOption( "--write-seed-file" ) )
+    if( cmd.findOption( "--write-seed-file" ) )
     {
-        m_ConsoleApp.checkDependence( "--write-seed-file", "--seed", opt_readSeedFile != OFnullptr );
-        m_ConsoleApp.checkValue( m_CommandLine.getValue( opt_writeSeedFile ) );
+        app.checkDependence("--write-seed-file", tlsopts, opt_secureConnection);
+        app.checkDependence( "--write-seed-file", "--seed", opt_readSeedFile != OFnullptr );
+        app.checkValue( cmd.getValue( opt_writeSeedFile ) );
     }
-    m_CommandLine.endOptionBlock();
+    cmd.endOptionBlock();
 
-    m_CommandLine.beginOptionBlock();
-    if( m_CommandLine.findOption( "--require-peer-cert" ) )
+    cmd.beginOptionBlock();
+    if( cmd.findOption( "--require-peer-cert" ) )
+    {
+        app.checkDependence("--require-peer-cert", tlsopts, opt_secureConnection);
         opt_certVerification = DCV_requireCertificate;
-    if( m_CommandLine.findOption( "--verify-peer-cert" ) )
-        opt_certVerification = DCV_checkCertificate;
-    if( m_CommandLine.findOption( "--ignore-peer-cert" ) )
+    }
+    if( cmd.findOption( "--ignore-peer-cert" ) )
+    {
+        app.checkDependence("--ignore-peer-cert", tlsopts, opt_secureConnection);
         opt_certVerification = DCV_ignoreCertificate;
-    m_CommandLine.endOptionBlock();
+    }
+    if ( (opt_networkRole != NET_REQUESTOR) && cmd.findOption( "--verify-peer-cert" ) )
+    {
+        app.checkDependence("--verify-peer-cert", tlsopts, opt_secureConnection);
+        opt_certVerification = DCV_checkCertificate;
+    }
+    cmd.endOptionBlock();
 
-    const char* current = OFnullptr;
-    const char* currentOpenSSL;
-    if( m_CommandLine.findOption( "--cipher", 0, OFCommandLine::FOM_First ) )
+    cmd.beginOptionBlock();
+    if (cmd.findOption("--profile-bcp195"))
     {
-        opt_ciphersuites.clear();
-        do
-        {
-            m_ConsoleApp.checkValue( m_CommandLine.getValue( current ) );
-            if( !( currentOpenSSL = DcmTLSTransportLayer::findOpenSSLCipherSuiteName( current ) ) )
-            {
-                return DCMTLS_EC_UnknownCiphersuite( current );
-            }
-            else
-            {
-                if( !opt_ciphersuites.empty() )
-                    opt_ciphersuites += ":";
-                opt_ciphersuites += currentOpenSSL;
-            }
-        }
-        while( m_CommandLine.findOption( "--cipher", 0, OFCommandLine::FOM_Next ) );
+        app.checkDependence("--profile-bcp195", tlsopts, opt_secureConnection);
+        opt_tlsProfile = TSP_Profile_BCP195;
     }
+    if (cmd.findOption("--profile-bcp195-nd"))
+    {
+        app.checkDependence("--profile-bcp195-nd", tlsopts, opt_secureConnection);
+        opt_tlsProfile = TSP_Profile_BCP195_ND;
+    }
+    if (csh.cipher3DESsupported())
+    {
+      if (cmd.findOption("--profile-basic"))
+      {
+          app.checkDependence("--profile-basic", tlsopts, opt_secureConnection);
+          opt_tlsProfile = TSP_Profile_Basic;
+      }
+    }
+    if (cmd.findOption("--profile-aes"))
+    {
+        app.checkDependence("--profile-basic", tlsopts, opt_secureConnection);
+        opt_tlsProfile = TSP_Profile_AES;
+    }
+    if (csh.cipherNULLsupported())
+    {
+      if (cmd.findOption("--profile-null"))
+      {
+          app.checkDependence("--profile-null", tlsopts, opt_secureConnection);
+          opt_tlsProfile = TSP_Profile_IHE_ATNA_Unencrypted;
+      }
+    }
+    cmd.endOptionBlock();
+
+    // check the other TLS specific options that will only be evaluated
+    // later in DcmTLSOptions::createTransportLayer().
+    if (cmd.findOption("--add-cert-file", 0, OFCommandLine::FOM_First))
+      app.checkDependence("--add-cert-file", tlsopts, opt_secureConnection);
+    if (cmd.findOption("--add-cert-dir", 0, OFCommandLine::FOM_First))
+      app.checkDependence("--add-cert-dir", tlsopts, opt_secureConnection);
+    if (cmd.findOption("--cipher", 0, OFCommandLine::FOM_First))
+      app.checkDependence("--cipher", tlsopts, opt_secureConnection);
+
 #endif
-    return EC_Normal;
 }
 
-OFrvalue<OFvariant<OFCondition,DcmTLSTransportLayer> >
-DcmTLSOptions::createTransportLayer( int networkRole )
+OFCondition DcmTLSOptions::createTransportLayer(
+      T_ASC_Network *net,
+      T_ASC_Parameters *params,
+      OFConsoleApplication& app,
+      OFCommandLine& cmd)
 {
-    // Pre C++11 compilers won't understand that the result is implicitly
-    // convertable, therefore, we need to explicitly construct the return type.
-    // This typedef eases it a bit.
-    typedef OFrvalue<OFvariant<OFCondition,DcmTLSTransportLayer> > return_type;
 
 #ifdef WITH_OPENSSL
-    if( opt_secureConnection )
+    if (opt_secureConnection)
     {
-        DcmTLSTransportLayer tlsLayer( networkRole, opt_readSeedFile );
-        if( !tlsLayer )
-            return return_type( DCMTLS_EC_FailedToCreateTLSTransportLayer );
+      delete tLayer;
+      tLayer = new DcmTLSTransportLayer(opt_networkRole, opt_readSeedFile, OFFalse);
+      if (tLayer == NULL) return DCMTLS_EC_FailedToCreateTLSTransportLayer;
 
-        if( m_CommandLine.findOption( "--add-cert-file", 0, OFCommandLine::FOM_First ) )
+      if (cmd.findOption("--add-cert-file", 0, OFCommandLine::FOM_First))
+      {
+        const char *current = NULL;
+        do
         {
-            const char *current = OFnullptr;
-            do
-            {
-                m_ConsoleApp.checkValue( m_CommandLine.getValue( current ) );
-                if( TCS_ok != tlsLayer.addTrustedCertificateFile( current, opt_keyFileFormat ) )
-                    DCMTLS_WARN( "unable to load certificate file '" << current << "', ignoring" );
-            }
-            while( m_CommandLine.findOption( "--add-cert-file", 0, OFCommandLine::FOM_Next ) );
-        }
+          app.checkValue(cmd.getValue(current));
+          if (TCS_ok != tLayer->addTrustedCertificateFile(current, opt_keyFileFormat))
+          {
+              DCMTLS_WARN("unable to load certificate file '" << current << "', ignoring");
+          }
+        } while (cmd.findOption("--add-cert-file", 0, OFCommandLine::FOM_Next));
+      }
 
-        if( m_CommandLine.findOption( "--add-cert-dir", 0, OFCommandLine::FOM_First ) )
+      if (cmd.findOption("--add-cert-dir", 0, OFCommandLine::FOM_First))
+      {
+        const char *current = NULL;
+        do
         {
-            const char *current = OFnullptr;
-            do
-            {
-                m_ConsoleApp.checkValue( m_CommandLine.getValue( current ) );
-                if( TCS_ok != tlsLayer.addTrustedCertificateDir( current, opt_keyFileFormat ) )
-                    DCMTLS_WARN( "unable to load certificates from directory '" << current << "', ignoring" );
-            }
-            while( m_CommandLine.findOption( "--add-cert-dir", 0, OFCommandLine::FOM_Next ) );
-        }
+          app.checkValue(cmd.getValue(current));
+          if (TCS_ok != tLayer->addTrustedCertificateDir(current, opt_keyFileFormat))
+          {
+            DCMTLS_WARN("unable to load certificates from directory '" << current << "', ignoring");
+          }
+        } while (cmd.findOption("--add-cert-dir", 0, OFCommandLine::FOM_Next));
+      }
+
+      if (opt_dhparam && ! (tLayer->setTempDHParameters(opt_dhparam)))
+         DCMTLS_WARN("unable to load temporary DH parameter file '" << opt_dhparam << "', ignoring");
+
+      if (opt_doAuthenticate)
+      {
+        if (opt_passwd)
+           tLayer->setPrivateKeyPasswd(opt_passwd);
+           else tLayer->setPrivateKeyPasswdFromConsole();
+
+        if (TCS_ok != tLayer->setPrivateKeyFile(opt_privateKeyFile, opt_keyFileFormat))
+           return DCMTLS_EC_FailedToLoadPrivateKey( opt_privateKeyFile );
+        if (TCS_ok != tLayer->setCertificateFile(opt_certificateFile, opt_keyFileFormat))
+           return DCMTLS_EC_FailedToLoadCertificate( opt_certificateFile );
+        if (! tLayer->checkPrivateKeyMatchesCertificate())
+           return DCMTLS_EC_MismatchedPrivateKeyAndCertificate( opt_privateKeyFile, opt_certificateFile );
+      }
 
-        if( opt_dhparam && !tlsLayer.setTempDHParameters( opt_dhparam ) )
-            DCMTLS_WARN( "unable to load temporary DH parameter file '" << opt_dhparam << "', ignoring" );
+      // set TLS profile
+      if (TCS_ok != tLayer->setTLSProfile(opt_tlsProfile))
+         return DCMTLS_EC_FailedToSetCiphersuites;
 
-        if( opt_doAuthenticate )
+      // add additional ciphersuites
+      if (cmd.findOption("--cipher", 0, OFCommandLine::FOM_First))
+      {
+        const char *current = NULL;
+        do
         {
-            if( opt_passwd )
-                tlsLayer.setPrivateKeyPasswd( opt_passwd );
-            if( TCS_ok != tlsLayer.setPrivateKeyFile( opt_privateKeyFile, opt_keyFileFormat ) )
-                return return_type( DCMTLS_EC_FailedToLoadPrivateKey( opt_privateKeyFile ) );
-            if( TCS_ok != tlsLayer.setCertificateFile( opt_certificateFile, opt_keyFileFormat ) )
-                return return_type( DCMTLS_EC_FailedToLoadCertificate( opt_certificateFile ) );
-            if( !tlsLayer.checkPrivateKeyMatchesCertificate() )
-                return return_type( DCMTLS_EC_MismatchedPrivateKeyAndCertificate( opt_privateKeyFile, opt_certificateFile ) );
-        }
+          app.checkValue(cmd.getValue(current));
+          if (TCS_ok != tLayer->addCipherSuite(current))
+             return DCMTLS_EC_UnknownCiphersuite( current );
+        } while (cmd.findOption("--cipher", 0, OFCommandLine::FOM_Next));
+      }
+
+      if (TCS_ok != tLayer->activateCipherSuites())
+         return DCMTLS_EC_FailedToSetCiphersuites;
 
-        if( TCS_ok != tlsLayer.setCipherSuites( opt_ciphersuites.c_str() ) )
-            return return_type( DCMTLS_EC_FailedToSetCiphersuites );
+      tLayer->setCertificateVerification(opt_certVerification);
 
-        tlsLayer.setCertificateVerification( opt_certVerification );
+      if (net)
+      {
+        OFCondition cond = ASC_setTransportLayer(net, tLayer, 0);
+        if (cond.bad()) return cond;
+      }
 
-        return return_type( OFmove( tlsLayer ) );
+      if (params)
+      {
+        OFCondition cond2 = ASC_setTransportLayerType(params, opt_secureConnection);
+        if (cond2.bad()) return cond2;
+      }
     }
+
+#endif // WITH_OPENSSL
+    return EC_Normal;
+}
+
+OFBool DcmTLSOptions::listOfCiphersRequested(OFCommandLine& cmd)
+{
+#ifdef WITH_OPENSSL
+  if (cmd.findOption("--list-ciphers")) return OFTrue;
+#endif
+  return OFFalse;
+}
+
+void DcmTLSOptions::printSupportedCiphersuites(OFConsoleApplication& app, STD_NAMESPACE ostream& os)
+{
+#ifdef WITH_OPENSSL
+  DcmTLSCiphersuiteHandler csh;
+  app.printHeader(OFTrue /*print host identifier*/);
+  os << OFendl << "Supported TLS ciphersuites are:" << OFendl;
+  csh.printSupportedCiphersuites(os);
+#endif
+}
+
+OFBool DcmTLSOptions::secureConnectionRequested() const
+{
+#ifdef WITH_OPENSSL
+  return opt_secureConnection;
+#else
+  return OFFalse;
+#endif
+}
+
+DcmTLSTransportLayer *DcmTLSOptions::getTransportLayer()
+{
+#ifdef WITH_OPENSSL
+  return tLayer;
+#else
+  return NULL;
 #endif
-    return return_type( EC_Normal );
 }
 
-OFCondition DcmTLSOptions::writeRandomSeedFileIfEnabled( DcmTLSTransportLayer& layer )
+OFCondition DcmTLSOptions::writeRandomSeed()
 {
 #ifdef WITH_OPENSSL
-    if( opt_writeSeedFile )
+    if( opt_writeSeedFile && tLayer)
     {
-        if( layer.canWriteRandomSeed() )
+        if( tLayer->canWriteRandomSeed() )
         {
-            if( !layer.writeRandomSeed( opt_writeSeedFile ) )
+            if( ! tLayer->writeRandomSeed( opt_writeSeedFile ) )
                 return DCMTLS_EC_FailedToWriteRandomSeedFile( opt_writeSeedFile );
         }
         else return DCMTLS_EC_FailedToWriteRandomSeedFile;
index 80b22e62bbc1dd1295de1bc44bb2d492d67b98cf..bc798d01342f6a9cc9dbf61869db793def0c04d7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2010-2013, OFFIS e.V.
+ *  Copyright (C) 2010-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
  */
 
 #include "dcmtk/config/osconfig.h"  /* make sure OS specific configuration is included first */
+#include "dcmtk/dcmtls/tlsdefin.h"  /* for DCMTK_DCMTLS_EXPORT */
 
 #ifdef WITH_OPENSSL
 #include "dcmtk/dcmtls/tlsscu.h"
 #include "dcmtk/dcmnet/diutil.h"    /* for dcmnet logger */
 
+BEGIN_EXTERN_C
+#include <openssl/ssl.h>
+END_EXTERN_C
+
 
 DcmTLSSCU::DcmTLSSCU() :
   m_tLayer(NULL),
@@ -32,23 +37,15 @@ DcmTLSSCU::DcmTLSSCU() :
   m_trustedCertDirs(),
   m_trustedCertFiles(),
   m_privateKeyFile(""),
-  m_privateKeyFileFormat(SSL_FILETYPE_PEM),
+  m_privateKeyFileFormat(DCF_Filetype_PEM),
   m_certificateFile(""),
-  m_certKeyFileFormat(SSL_FILETYPE_PEM),
+  m_certKeyFileFormat(DCF_Filetype_PEM),
   m_passwd(NULL),
-  m_ciphersuites(""),
   m_readSeedFile(""),
   m_writeSeedFile(""),
   m_certVerification(DCV_requireCertificate),
   m_dhparam("")
 {
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-  m_ciphersuites = TLS1_TXT_RSA_WITH_AES_128_SHA;
-  m_ciphersuites += ":";
-  m_ciphersuites += SSL3_TXT_RSA_DES_192_CBC3_SHA;
-#else
-  m_ciphersuites = SSL3_TXT_RSA_DES_192_CBC3_SHA;
-#endif
 }
 
 
@@ -60,23 +57,15 @@ DcmTLSSCU::DcmTLSSCU(const OFString& peerHost,
   m_trustedCertDirs(),
   m_trustedCertFiles(),
   m_privateKeyFile(""),
-  m_privateKeyFileFormat(SSL_FILETYPE_PEM),
+  m_privateKeyFileFormat(DCF_Filetype_PEM),
   m_certificateFile(""),
-  m_certKeyFileFormat(SSL_FILETYPE_PEM),
+  m_certKeyFileFormat(DCF_Filetype_PEM),
   m_passwd(NULL),
-  m_ciphersuites(""),
   m_readSeedFile(""),
   m_writeSeedFile(""),
   m_certVerification(DCV_requireCertificate),
   m_dhparam("")
 {
-#if OPENSSL_VERSION_NUMBER >= 0x0090700fL
-  m_ciphersuites = TLS1_TXT_RSA_WITH_AES_128_SHA;
-  m_ciphersuites += ":";
-  m_ciphersuites += SSL3_TXT_RSA_DES_192_CBC3_SHA;
-#else
-  m_ciphersuites = SSL3_TXT_RSA_DES_192_CBC3_SHA;
-#endif
   setPeerHostName(peerHost);
   setPeerAETitle(peerAETitle);
   setPeerPort(portNum);
@@ -98,7 +87,7 @@ OFCondition DcmTLSSCU::initNetwork()
   OFCondition cond;
 
   /* First, create TLS layer */
-  m_tLayer = new DcmTLSTransportLayer(DICOM_APPLICATION_REQUESTOR, m_readSeedFile.c_str());
+  m_tLayer = new DcmTLSTransportLayer(NET_REQUESTOR, m_readSeedFile.c_str(), OFTrue /* initialize OpenSSL */);
   if (m_tLayer == NULL)
   {
     DCMTLS_ERROR("Unable to create TLS transport layer for SCP, maybe problem with seed file?");
@@ -133,13 +122,6 @@ OFCondition DcmTLSSCU::initNetwork()
     }
   }
 
-  /* Set cipher suites to be supported */
-  if ( cond.good() && (TCS_ok != m_tLayer->setCipherSuites(m_ciphersuites.c_str())) )
-  {
-    DCMTLS_ERROR("Unable to set selected cipher suites for SCP");
-    cond = EC_IllegalCall; // TODO: need to find better error code
-  }
-
   /* Initialize Diffie-Hellman parameters from file if given */
   if (!m_dhparam.empty() && cond.good())
   {
@@ -217,8 +199,8 @@ void DcmTLSSCU::closeAssociation(const DcmCloseAssociationType closeType)
 void DcmTLSSCU::enableAuthentication(const OFString& privateKey,
                                      const OFString& certFile,
                                      const char* passphrase,
-                                     const int privKeyFormat,
-                                     const int certFormat)
+                                     const DcmKeyFileFormat privKeyFormat,
+                                     const DcmKeyFileFormat certFormat)
 {
   m_doAuthenticate = OFTrue;
   m_privateKeyFile = privateKey;
@@ -236,7 +218,7 @@ void DcmTLSSCU::enableAuthentication(const OFString& privateKey,
     return;
   }
 
-  int passLength = strlen(passphrase) + 1;
+  size_t passLength = strlen(passphrase) + 1;
   m_passwd = new char[passLength];
   strncpy(m_passwd, passphrase, passLength);
   return;
@@ -260,19 +242,22 @@ void DcmTLSSCU::disableAuthentication()
   m_doAuthenticate = OFFalse;
 }
 
+DcmTransportLayerStatus DcmTLSSCU::addCipherSuite(const OFString& suite)
+{
+  if (m_tLayer)
+     return m_tLayer->addCipherSuite(suite.c_str());
+     else return TCS_illegalCall;
+}
 
-void DcmTLSSCU::addCiphersuite(const OFString& cs)
+DcmTransportLayerStatus DcmTLSSCU::setTLSProfile(DcmTLSSecurityProfile profile)
 {
-  if (m_ciphersuites.empty())
-    m_ciphersuites = cs;
-  else
+  if (m_tLayer)
   {
-    m_ciphersuites+= ":";
-    m_ciphersuites+= cs;
-  }
+    m_tLayer->setTLSProfile(profile);
+    return TCS_ok;
+  } else return TCS_illegalCall;
 }
 
-
 void DcmTLSSCU::setReadSeedFile(const OFString& seedFile)
 {
   m_readSeedFile = seedFile;
@@ -337,12 +322,6 @@ void DcmTLSSCU::getTrustedCertDirs(OFList<OFString>& trustedDirs /*out*/) const
 }
 
 
-OFString DcmTLSSCU::getCiphersuites() const
-{
-  return m_ciphersuites;
-}
-
-
 OFString DcmTLSSCU::getReadSeedFile() const
 {
   return m_readSeedFile;
@@ -360,5 +339,14 @@ OFString DcmTLSSCU::getDHParam() const
   return m_dhparam;
 }
 
+#else
+
+/* make sure that the object file is not completely empty if compiled
+ * without OpenSSL because some linkers might fail otherwise.
+ */
+DCMTK_DCMTLS_EXPORT void tlsscu_dummy_function()
+{
+  return;
+}
 
 #endif // WITH_OPENSSL
index ab621d787835d2900e4afe4b6bf09438fbc71c2e..a97ee6d31bc48d485bf9462f6d4bc69b9ff5b237 100644 (file)
@@ -48,6 +48,7 @@ BEGIN_EXTERN_C
 #include <sys/select.h>
 #endif
 #include <openssl/err.h>
+#include <openssl/ssl.h>
 END_EXTERN_C
 
 #ifdef DCMTK_HAVE_POLL
@@ -82,6 +83,7 @@ DcmTransportLayerStatus DcmTLSConnection::serverSideHandshake()
   {
     case SSL_ERROR_NONE:
       /* success */
+      logTLSConnection();
       break;
     case SSL_ERROR_SYSCALL:
     case SSL_ERROR_SSL:
@@ -114,6 +116,7 @@ DcmTransportLayerStatus DcmTLSConnection::clientSideHandshake()
   switch (SSL_get_error(tlsConnection, SSL_connect(tlsConnection)))
   {
     case SSL_ERROR_NONE:
+      logTLSConnection();
       /* success */
       break;
     case SSL_ERROR_SYSCALL:
@@ -185,14 +188,14 @@ DcmTransportLayerStatus DcmTLSConnection::renegotiate(const char *newSuite)
 
 ssize_t DcmTLSConnection::read(void *buf, size_t nbyte)
 {
-  if (tlsConnection) return SSL_read(tlsConnection, OFreinterpret_cast(char*, buf), nbyte);
+  if (tlsConnection) return SSL_read(tlsConnection, OFreinterpret_cast(char*, buf), OFstatic_cast(int, nbyte));
   errno = EIO; /* IO Error */
   return -1;
 }
 
 ssize_t DcmTLSConnection::write(void *buf, size_t nbyte)
 {
-  if (tlsConnection) return SSL_write(tlsConnection, OFreinterpret_cast(char*, buf), nbyte);
+  if (tlsConnection) return SSL_write(tlsConnection, OFreinterpret_cast(char*, buf), OFstatic_cast(int, nbyte));
   errno = EIO; /* IO Error */
   return -1;
 }
@@ -273,7 +276,7 @@ OFBool DcmTLSConnection::networkDataAvailable(int timeout)
   t.tv_usec = 0;
 
 #ifdef DCMTK_HAVE_POLL
-  struct pollfd pfd[] = 
+  struct pollfd pfd[] =
   {
    { getSocket(), POLLIN, 0 }
   };
@@ -314,16 +317,15 @@ OFString& DcmTLSConnection::dumpConnectionParameters(OFString& str)
   if (tlsConnection == NULL)
   {
     // This should never happen (famous last words)
-    str = "Transport connection: TLS/SSL over TCP/IP\n  Error: No Connection";
+    str = "Transport connection: TLS over TCP/IP\n  Error: No Connection";
     return str;
   }
 
   X509 *peerCert = SSL_get_peer_certificate(tlsConnection);
   OFOStringStream stream;
-  stream << "Transport connection: TLS/SSL over TCP/IP" << OFendl
+  stream << "Transport connection: TLS over TCP/IP" << OFendl
          << "  Protocol    : " << SSL_get_version(tlsConnection) << OFendl
          << "  Ciphersuite : " << SSL_CIPHER_get_name(SSL_get_current_cipher(tlsConnection))
-         << ", version: " << SSL_CIPHER_get_version(SSL_get_current_cipher(tlsConnection))
          << ", encryption: " << SSL_CIPHER_get_bits(SSL_get_current_cipher(tlsConnection), NULL) << " bits" << OFendl
          << DcmTLSTransportLayer::dumpX509Certificate(peerCert);
   // stream << OFendl << "Certificate verification: " << X509_verify_cert_error_string(SSL_get_verify_result(tlsConnection));
@@ -363,6 +365,15 @@ const char *DcmTLSConnection::errorString(DcmTransportLayerStatus code)
   return "unknown error code";
 }
 
+void DcmTLSConnection::logTLSConnection()
+{
+  OFString s;
+  dumpConnectionParameters(s);
+  DCMTLS_DEBUG(
+    "================== BEGIN TLS CONNECTION DETAILS =================\n" << s <<
+    "\n=================== END TLS CONNECTION DETAILS ==================");
+}
+
 #else  /* WITH_OPENSSL */
 
 /* make sure that the object file is not completely empty if compiled
diff --git a/dcmtls/tests/dcmtls_testsuite_generate.pl b/dcmtls/tests/dcmtls_testsuite_generate.pl
new file mode 100755 (executable)
index 0000000..4344b76
--- /dev/null
@@ -0,0 +1,401 @@
+#! /usr/bin/perl
+#
+#  Copyright (C) 2018, OFFIS e.V.
+#  All rights reserved.  See COPYRIGHT file for details.
+#
+#  This software and supporting documentation were developed by
+#
+#    OFFIS e.V.
+#    R&D Division Health
+#    Escherweg 2
+#    D-26121 Oldenburg, Germany
+#
+#
+#  Module: dcmtls
+#
+#  Author: Marco Eichelberg
+#
+#  Purpose:
+#    This script generates the set of files needed to run the functional
+#    (integration) test suite for module dcmtls.
+#    This script requires a Linux/Posix system, but the generated files
+#    can also be used on other platforms such as Windows.
+#
+
+# First we need to generate three certification authorities
+&createNewCA("ca1", "DCMTK Test CA 1");
+system ("cp ca1/cacert.pem ./cacert1.pem");
+&createNewCA("ca2", "DCMTK Test CA 2");
+system ("cp ca2/cacert.pem ./cacert2.pem");
+&createNewCA("ca3", "DCMTK Test CA 3");
+system ("cp ca3/cacert.pem ./cacert3.pem");
+mkdir("cadir", 0755);
+$cahash1 = `openssl x509 -hash -noout -in ./cacert1.pem`;
+chop $cahash1;
+$cahash2 = `openssl x509 -hash -noout -in ./cacert2.pem`;
+chop $cahash2;
+
+# Generate directory with CA certificates
+system ("cp ./cacert1.pem cadir/$cahash1.0");
+if ($cahash1 eq $cahash2)
+{
+  # both certificates have the same hash key. Unlikely but possible.
+  system ("cp ./cacert2.pem cadir/$cahash1.1");
+} else {
+  system ("cp ./cacert2.pem cadir/$cahash2.0");
+}
+
+# Now generate user certificates
+# user 1 is a normal certificate/key pair
+&createNewCertificate("ca1", "user1_cert.pem", "user1_key.pem", "Test User 1", "-nodes", "", 2048);
+# this is a certificate/key pair encoded in DER format (instead of PEM).
+# We create a PEM certificate and then convert to DER
+&createNewCertificate("ca1", "user2_cert.pem", "user2_key.pem", "DER Test User", "-nodes", "", 2048);
+system ("openssl x509 -in user2_cert.pem -out user2_cert.der -outform DER");
+system ("openssl pkey -in user2_key.pem -out user2_key.der -outform DER");
+unlink("user2_cert.pem");
+unlink("user2_key.pem");
+# user 3 uses an encrypted private key. The password is "PASSWORD".
+&createNewCertificate("ca1", "user3_cert.pem", "user3_key.pem", "Test User 3", "-passout pass:PASSWORD", "", 2048);
+# user 4 uses a weak 512-bit RSA private key.
+&createNewCertificate("ca1", "user4_cert.pem", "user4_key.pem", "Test User 4 (512-bit RSA key)", "-nodes", "", 512);
+# user 5 is a certificate that is signed with MD5, a weak hash key
+&createNewCertificate("ca1", "user5_cert.pem", "user5_key.pem", "Test User 5 (MD5 digest)", "-nodes", "-md md5", 2048);
+# ca2user is a certificate/key pair issued by CA 2
+&createNewCertificate("ca2", "ca2user_cert.pem", "ca2user_key.pem", "CA2 Test User 1", "-nodes", "", 2048);
+# ca3user is a certificate/key pair issued by CA 3
+&createNewCertificate("ca3", "ca3user_cert.pem", "ca3user_key.pem", "CA3 Test User 1", "-nodes", "", 2048);
+
+# Generate other files needed
+
+# A file with 1024 random bits for seeding the PRNG
+system ("openssl rand -out randseed.bin 1024");
+
+# A Diffie-Hellman parameter set with 2048 bits
+system ("openssl dhparam -out dhparam2048.pem 2048");
+
+# A weak Diffie-Hellman parameter set with only 512 bits
+system ("openssl dhparam -out dhparam512.pem 512");
+
+#
+# createNewCertificate(string cadir, string certfile, string certkey)
+#   creates a new key pair consisting of a private key file and a certificate file
+#   signed by the CA.
+#   @param ca_directory directory of the CA
+#   @param certfile   certificate file to be written
+#   @param certkey    private key file to be written
+#   @param subject    certificate subject name (CN)
+#   @req_options      additional parameters for openssl req
+#   @ca_options       additional parameters for openssl ca
+#
+sub createNewCertificate
+{
+  local($ca_directory, $certfile, $certkey, $subject, $req_options, $ca_options, $bits) = @_;
+  local($days) = 3652;
+  if (! -d "$ca_directory")
+  {
+    die "error: $ca_directory not found, bailing out.";
+  }
+  system ("openssl req -config ${ca_directory}/openssl.cnf $req_options -subj '/C=DE/ST=Niedersachsen/O=OFFIS/OU=OFFIS DICOM Team/emailAddress=dicom\@offis.de/CN=$subject' -newkey rsa:$bits -keyout $certkey -out ${ca_directory}/private/tempreq.pem");
+  system ("openssl ca -config ${ca_directory}/openssl.cnf  $ca_options -policy policy_anything -in ${ca_directory}/private/tempreq.pem -out $certfile -days $days -batch");
+  unlink "${ca_directory}/private/tempreq.pem";
+  @newfiles = `cd ${ca_directory}/newcerts; ls *.pem`;
+  foreach (@newfiles)
+  {
+    chop;
+    system("mv ${ca_directory}/newcerts/$_ ${ca_directory}/certs");
+    system("cd ${ca_directory}/certs; ln -s $_ `openssl x509 -hash -noout -in $_`.0");
+  }
+  return $?;
+}
+
+
+# createNewCA(directory, CA name)
+#   creates all files required for a new Certification Authority
+#   @param directory  directory to be created for the new CA, must not yet exist.
+#
+sub createNewCA
+{
+  local($ca_directory, $ca_name) = @_;
+  local($days) = 7305; # 20 years
+  local($bits) = 4096; # RSA key length
+  if (-e "$ca_directory")
+  {
+    print "warning: $ca_directory already exists, skipping CA creation step.\n";
+    return;
+  }
+  mkdir($ca_directory, 0700);
+  mkdir("${ca_directory}/certs", 0700);
+  mkdir("${ca_directory}/crl", 0700);
+  mkdir("${ca_directory}/newcerts", 0700);
+  mkdir("${ca_directory}/private", 0700);
+  open OUT, ">${ca_directory}/serial";
+  print OUT "01\n";
+  close OUT;
+  open OUT, ">${ca_directory}/index.txt";
+  close OUT;
+  &createNewConfigFile($ca_directory);
+  system ("openssl rand -out ${ca_directory}/private/randseed.bin 1024");
+  system ("openssl req -config ${ca_directory}/openssl.cnf -newkey rsa:$bits -x509 -subj '/C=DE/ST=Niedersachsen/O=OFFIS/OU=$ca_name/emailAddress=dicom\@offis.de' -nodes -keyout ${ca_directory}/private/cakey.pem -out ${ca_directory}/cacert.pem -days $days");
+  system ("cp ${ca_directory}/cacert.pem ${ca_directory}/certs/00.pem");
+  system ("cd ${ca_directory}/certs; ln -s 00.pem `openssl x509 -hash -noout -in 00.pem`.0");
+  return $?;
+}
+
+#
+# createNewConfigFile(directory)
+#   creates new default configuration file named openssl.cnf in CA directory.
+#   @param directory  CA directory.
+#
+sub createNewConfigFile
+{
+  local($ca_directory) = @_;
+  open OUT, ">${ca_directory}/openssl.cnf";
+
+#####################################################################
+print OUT <<END_OF_CONFIGURATION_FILE;
+#
+# OpenSSL configuration file for DCMTK
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME            = .
+RANDFILE        = \$ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file       = \$ENV::HOME/.oid
+oid_section     = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions        =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=\${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca  = CA_default        # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir     = ${ca_directory}   # Where everything is kept
+certs       = \$dir/certs       # Where the issued certs are kept
+crl_dir     = \$dir/crl     # Where the issued crl are kept
+database    = \$dir/index.txt   # database index file.
+new_certs_dir   = \$dir/newcerts    # default place for new certs.
+
+certificate = \$dir/cacert.pem  # The CA certificate
+serial      = \$dir/serial      # The current serial number
+crl     = \$dir/crl.pem         # The current CRL
+private_key = \$dir/private/cakey.pem   # The private key
+RANDFILE    = \$dir/private/randseed.bin    # private random number file
+
+x509_extensions = usr_cert      # The extentions to add to the cert
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crl_extensions    = crl_ext
+
+default_days    = 3652          # how long to certify for
+default_crl_days= 30            # how long before next CRL
+default_md  = sha256        # which md to use.
+preserve    = no            # keep passed DN ordering
+prompt = no
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy      = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName     = match
+stateOrProvinceName = match
+organizationName    = match
+organizationalUnitName  = optional
+commonName      = supplied
+emailAddress        = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName     = optional
+stateOrProvinceName = optional
+localityName        = optional
+organizationName    = optional
+organizationalUnitName  = optional
+commonName      = supplied
+emailAddress        = optional
+
+####################################################################
+[ req ]
+
+default_bits        = 2048
+default_keyfile     = privkey.pem
+distinguished_name  = req_distinguished_name
+attributes      = req_attributes
+x509_extensions     = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix   : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName         = Country Name (2 letter code)
+countryName_default     = DE
+countryName_min         = 2
+countryName_max         = 2
+
+stateOrProvinceName     = State or Province Name (full name)
+stateOrProvinceName_default = Some-State
+
+localityName            = Locality Name (eg, city)
+
+0.organizationName      = Organization Name (eg, company)
+0.organizationName_default  = OFFIS
+
+# we can do this but it is not needed normally :-)
+#1.organizationName     = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName      = Organizational Unit Name (eg, section)
+organizationalUnitName_default  = DCMTK
+
+commonName          = Common Name (eg, YOUR name)
+commonName_max          = 64
+
+emailAddress            = Email Address
+emailAddress_max        = 40
+emailAddress_default            = dicom\@offis.de
+
+# SET-ex3           = SET extension number 3
+
+[ req_attributes ]
+challengePassword       = A challenge password
+challengePassword_min       = 4
+challengePassword_max       = 20
+
+unstructuredName        = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType            = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment           = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl      = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# Extensions to add to a certificate request
+[ v3_req ]
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+
+# Extensions for a typical CA
+[ v3_ca ]
+
+# PKIX recommendation.
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+nsCertType = sslCA, emailCA, objCA
+
+# Include email address in subject alt name: another PKIX recommendation
+subjectAltName         = email:copy
+# Copy issuer details
+issuerAltName          = issuer:copy
+
+# crlDistributionPoints  = URI:http://crlserver.domain.de/CA.crl
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+END_OF_CONFIGURATION_FILE
+#####################################################################
+
+  close OUT;
+}
diff --git a/dcmtls/tests/dcmtls_testsuite_run.pl b/dcmtls/tests/dcmtls_testsuite_run.pl
new file mode 100755 (executable)
index 0000000..c9d6eb7
--- /dev/null
@@ -0,0 +1,518 @@
+#! /usr/bin/perl
+#
+#  Copyright (C) 2018, OFFIS e.V.
+#  All rights reserved.  See COPYRIGHT file for details.
+#
+#  This software and supporting documentation were developed by
+#
+#    OFFIS e.V.
+#    R&D Division Health
+#    Escherweg 2
+#    D-26121 Oldenburg, Germany
+#
+#
+#  Module: dcmtls
+#
+#  Author: Marco Eichelberg
+#
+#  Purpose:
+#    This script is a temporary test suite for module dcmtls that
+#    exercises all options of the TLS code in dcmtk that can be reached
+#    through echoscu and storescp. This script will later be replaced
+#    with a solution based on CMake/CTest.
+#
+
+use File::Copy ('copy');
+use Digest::MD5;
+
+# determine if we're running on Windows
+if ($^O =~ /MSWin32/) { $windows = 1; } else { $windows = 0; }
+
+$tlsport = 10004;
+$dcmtk_bin_path = "~/dicom/out3/bin";
+$echoscu = "$dcmtk_bin_path/echoscu";
+$storescp = "$dcmtk_bin_path/storescp";
+$tcpclient = "~/dicom/tests/drivers/apps/tcpclient";
+
+$numPassed = 0;
+$numFailed = 0;
+
+# Determine and print OpenSSL version DCMTK was compiled with
+system("$echoscu --version >echoscu_version.log");
+open(ECHOSCUFILE, "<echoscu_version.log") || die "unable to open file 'echoscu_version.log'";
+$with_openssl = 0;
+while ($row = <ECHOSCUFILE>)
+{
+  chomp $row;
+  if ($row =~ /OpenSSL/) { printf("OpenSSL version: %s\n\n", substr($row,2)); $with_openssl = 1; }
+}
+close INFILE;
+if (! $with_openssl)
+{
+  print "DCMTK compiled without OpenSSL support. Stopping dcmtls test suite\n";
+  exit 0;
+}
+
+print "Test 01: unencrypted communication: ";
+$pid = &startBackgroundProcess("$storescp -d $tlsport >test01_server_out.log 2>test01_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu localhost -d $tlsport >test01_client_out.log 2>test01_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 02: attempt TLS connection to unencrypted server: ";
+$pid = &startBackgroundProcess("$storescp -d $tlsport >test02_server_out.log 2>test02_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla localhost $tlsport >test02_client_out.log 2>test02_client_err.log");
+if (($result != 0) && (&findInFiles("Unrecognized PDU type", "test02_server_err.log", "test02_server_out.log"))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 03: attempt unencrypted connection to TLS server: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem $tlsport >test03_server_out.log 2>test03_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d localhost $tlsport >test03_client_out.log 2>test03_client_err.log");
+# different openssl versions report different error messages here
+if (($result != 0) && (
+  (&findInFiles("wrong version number", "test03_server_err.log", "test03_server_out.log")) ||
+  (&findInFiles("unknown protocol", "test03_server_err.log", "test03_server_out.log")))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 04: connect with anonymous TLS to TLS server accepting such connections: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test04_server_out.log 2>test04_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla -ic localhost $tlsport >test04_client_out.log 2>test04_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 05: connect with valid certificate to TLS server: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test05_server_out.log 2>test05_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user1_key.pem user1_cert.pem -ic localhost $tlsport >test05_client_out.log 2>test05_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 06: connect with weak certificate (MD5 hash) to TLS server: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic +cf cacert1.pem $tlsport >test06_server_out.log 2>test06_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user5_key.pem user5_cert.pem -ic localhost $tlsport >test06_client_out.log 2>test06_client_err.log");
+# here we do not look at the return code because the result differs depending on the openssl version used.
+# openssl 1.0.x will report a warning but run echoscu, while 1.1.x will refuse to use the certificate.
+# The warning is printed in both cases, however, and this is what we look for.
+if (&findInFiles("Certificate hash key not SHA-256", "test06_client_err.log", "test06_client_out.log")) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 07: connect with DER encoded certificate to TLS server: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test07_server_out.log 2>test07_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d -der +tls user2_key.der user2_cert.der -ic localhost $tlsport >test07_client_out.log 2>test07_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 08: use private key file protected with a password: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test08_server_out.log 2>test08_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user3_key.pem user3_cert.pem +pw PASSWORD -ic localhost $tlsport >test08_client_out.log 2>test08_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 09: use private key file protected with a password; use wrong password: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test09_server_out.log 2>test09_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user3_key.pem user3_cert.pem +pw WRONG_PASSWORD -ic localhost $tlsport >test09_client_out.log 2>test09_client_err.log");
+if (($result != 0) && (&findInFiles("Unable to load private TLS key", "test09_client_err.log", "test09_client_out.log"))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 10: use private key file protected with a password; use null password: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test10_server_out.log 2>test10_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user3_key.pem user3_cert.pem --null-passwd -ic localhost $tlsport >test10_client_out.log 2>test10_client_err.log");
+if (($result != 0) && (&findInFiles("Unable to load private TLS key", "test10_client_err.log", "test10_client_out.log"))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 11: use random seed file: ";
+copy("randseed.bin", "randseed11.bin") || die "unable to copy randseed.bin";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test11_server_out.log 2>test11_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d --seed randseed11.bin +tls user1_key.pem user1_cert.pem -ic localhost $tlsport >test11_client_out.log 2>test11_client_err.log");
+$digest1 = md5digest("randseed.bin");
+$digest2 = md5digest("randseed11.bin");
+unlink "randseed11.bin";
+if ($result == 0 && ($digest1 eq $digest2)) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 12: use and write back random seed file: ";
+copy("randseed.bin", "randseed12.bin") || die "unable to copy randseed.bin";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test12_server_out.log 2>test12_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d --seed randseed12.bin --write-seed +tls user1_key.pem user1_cert.pem -ic localhost $tlsport >test12_client_out.log 2>test12_client_err.log");
+$digest1 = md5digest("randseed.bin");
+$digest2 = md5digest("randseed12.bin");
+unlink "randseed12.bin";
+if ($result == 0 && ($digest1 ne $digest2)) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 13: use random seed file, write back to different file: ";
+copy("randseed.bin", "randseed13.bin") || die "unable to copy randseed.bin";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test13_server_out.log 2>test13_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+unlink "randseed13a.bin";
+$result = system("$echoscu -d --seed randseed13.bin +wf randseed13a.bin +tls user1_key.pem user1_cert.pem -ic localhost $tlsport >test13_client_out.log 2>test13_client_err.log");
+if (! -f "randseed13a.bin")
+{ # output file was not created. This is a failure
+  &testFailed();
+}
+else
+{
+  $digest1 = md5digest("randseed13.bin");
+  $digest2 = md5digest("randseed13a.bin");
+  unlink "randseed13.bin";
+  unlink "randseed13a.bin";
+  if ($result == 0 && ($digest1 ne $digest2)) { &testPassed(); } else { &testFailed(); }
+}
+&doKill($pid);
+$tlsport++;
+
+print "Test 14: client verifies server certificate: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test14_server_out.log 2>test14_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user1_key.pem user1_cert.pem -rc +cf cacert1.pem localhost $tlsport >test14_client_out.log 2>test14_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 15: server provides certificate from unknown CA: ";
+$pid = &startBackgroundProcess("$storescp -d +tls ca2user_key.pem ca2user_cert.pem -ic $tlsport >test15_server_out.log 2>test15_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user1_key.pem user1_cert.pem -rc +cf cacert1.pem localhost $tlsport >test15_client_out.log 2>test15_client_err.log");
+if (($result != 0) && (&findInFiles("certificate verify failed", "test15_client_err.log", "test15_client_out.log"))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 16: server verifies client certificate: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -rc +cf cacert1.pem $tlsport >test16_server_out.log 2>test16_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user1_key.pem user1_cert.pem -rc +cf cacert1.pem localhost $tlsport >test16_client_out.log 2>test16_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 17: server tries to verify client certificate, but client uses anonymous TLS: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -rc +cf cacert1.pem $tlsport >test17_server_out.log 2>test17_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla -rc +cf cacert1.pem localhost $tlsport >test17_client_out.log 2>test17_client_err.log");
+if (($result != 0) && (&findInFiles("peer did not return a certificate", "test17_server_err.log", "test17_server_out.log"))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 18: client uses certificate from unknown CA: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -rc +cf cacert1.pem $tlsport >test18_server_out.log 2>test18_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls ca2user_key.pem ca2user_cert.pem -rc +cf cacert1.pem localhost $tlsport >test18_client_out.log 2>test18_client_err.log");
+# different openssl versions report different error messages here
+if (($result != 0) && (
+  (&findInFiles("certificate verify failed", "test18_server_err.log", "test18_server_out.log")) ||
+  (&findInFiles("no certificate returned", "test18_server_err.log", "test18_server_out.log")))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 19: server verifies client certificate only if present, client uses anonymous TLS: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -vc +cf cacert1.pem $tlsport >test19_server_out.log 2>test19_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla -rc +cf cacert1.pem localhost $tlsport >test19_client_out.log 2>test19_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 20: server verifies client certificate only if present, client sends certificate: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -vc +cf cacert1.pem $tlsport >test20_server_out.log 2>test20_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user1_key.pem user1_cert.pem -rc +cf cacert1.pem localhost $tlsport >test20_client_out.log 2>test20_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 21: server verifies client certificate only if present, client uses certificate from unknown CA: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -vc +cf cacert1.pem $tlsport >test21_server_out.log 2>test21_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls ca2user_key.pem ca2user_cert.pem -rc +cf cacert1.pem localhost $tlsport >test21_client_out.log 2>test21_client_err.log");
+# different openssl versions report different error messages here
+if (($result != 0) && (
+  (&findInFiles("certificate verify failed", "test21_server_err.log", "test21_server_out.log")) ||
+  (&findInFiles("no certificate returned", "test21_server_err.log", "test21_server_out.log")))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 22: server uses a directory of CA certificates, client uses CA1 certificate: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -rc +cd cadir $tlsport >test22_server_out.log 2>test22_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user1_key.pem user1_cert.pem  -rc +cf cacert1.pem localhost $tlsport >test22_client_out.log 2>test22_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 23: server uses a directory of CA certificates, client uses CA2 certificate: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -rc +cd cadir $tlsport >test23_server_out.log 2>test23_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls ca2user_key.pem ca2user_cert.pem -rc +cf cacert1.pem localhost $tlsport >test23_client_out.log 2>test23_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 24: server uses a directory of CA certificates, client uses certificate from unknown CA: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -rc +cd cadir $tlsport >test24_server_out.log 2>test24_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls ca3user_key.pem ca3user_cert.pem -rc +cf cacert1.pem localhost $tlsport >test24_client_out.log 2>test24_client_err.log");
+# different openssl versions report different error messages here
+if (($result != 0) && (
+  (&findInFiles("certificate verify failed", "test24_server_err.log", "test24_server_out.log")) ||
+  (&findInFiles("no certificate returned", "test24_server_err.log", "test24_server_out.log")))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 25: server uses user-defined Diffie-Hellman parameter set: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem --dhparam dhparam2048.pem -ic $tlsport >test25_server_out.log 2>test25_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user1_key.pem user1_cert.pem -ic localhost $tlsport >test25_client_out.log 2>test25_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 26: server uses weak (512 bit) user-defined Diffie-Hellman parameter set: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem --dhparam dhparam512.pem -ic $tlsport >test26_server_out.log 2>test26_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user1_key.pem user1_cert.pem -ic localhost $tlsport >test26_client_out.log 2>test26_client_err.log");
+# here we do not look at the return code because the result differs depending on the openssl version used.
+# openssl 1.1.x will report a warning but run echoscu, while 1.0.x will refuse to use the DH parameter set.
+# The warning is printed in both cases, however, and this is what we look for.
+if (&findInFiles("Key length of Diffie-Hellman parameter file too short", "test26_server_err.log", "test26_server_out.log")) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 27: connect with weak certificate (512-bit RSA) to TLS server: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test27_server_out.log 2>test27_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tls user4_key.pem user4_cert.pem -ic localhost $tlsport >test27_client_out.log 2>test27_client_err.log");
+# here we do not look at the return code because the result differs depending on the openssl version used.
+# openssl 1.0.x will report a warning but run echoscu, while 1.1.x will refuse to use the certificate.
+# The warning is printed in both cases, however, and this is what we look for.
+if (&findInFiles("Key length of RSA public key too short", "test27_client_err.log", "test27_client_out.log")) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 28: client uses Basic TLS Secure Transport Connection Profile (3DES): ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test28_server_out.log 2>test28_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla --profile-basic -ic localhost $tlsport >test28_client_out.log 2>test28_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 29: client uses Basic Profile (3DES), server uses Non-downgrading BCP 195 TLS Profile: ";
+$pid = &startBackgroundProcess("$storescp -d --profile-bcp195-nd +tls user1_key.pem user1_cert.pem -ic $tlsport >test29_server_out.log 2>test29_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla --profile-basic -ic localhost $tlsport >test29_client_out.log 2>test29_client_err.log");
+if (($result != 0) && (&findInFiles("no shared cipher", "test29_server_err.log", "test29_server_out.log"))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 30: client uses AES TLS Secure Transport Connection Profile: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test30_server_out.log 2>test30_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla --profile-aes -ic localhost $tlsport >test30_client_out.log 2>test30_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 31: client uses AES Profile, server uses Non-downgrading BCP 195 TLS Profile: ";
+$pid = &startBackgroundProcess("$storescp -d --profile-bcp195-nd +tls user1_key.pem user1_cert.pem -ic $tlsport >test31_server_out.log 2>test31_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla --profile-aes -ic localhost $tlsport >test31_client_out.log 2>test31_client_err.log");
+if (($result != 0) && (&findInFiles("no shared cipher", "test31_server_err.log", "test31_server_out.log"))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 32: client uses BCP 195 Profile, server uses Non-downgrading BCP 195 TLS Profile: ";
+$pid = &startBackgroundProcess("$storescp -d --profile-bcp195-nd +tls user1_key.pem user1_cert.pem -ic $tlsport >test32_server_out.log 2>test32_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla --profile-bcp195 -ic localhost $tlsport >test32_client_out.log 2>test32_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 33: client uses Non-downgrading BCP 195 TLS Profile, server uses BCP 195 Profile: ";
+$pid = &startBackgroundProcess("$storescp -d --profile-bcp195 +tls user1_key.pem user1_cert.pem -ic $tlsport >test33_server_out.log 2>test33_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla --profile-bcp195-nd -ic localhost $tlsport >test33_client_out.log 2>test33_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 34: client uses NULL TLS Profile, server uses BCP 195 Profile: ";
+$pid = &startBackgroundProcess("$storescp -d --profile-bcp195 +tls user1_key.pem user1_cert.pem -ic $tlsport >test34_server_out.log 2>test34_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla --profile-null -ic localhost $tlsport >test34_client_out.log 2>test34_client_err.log");
+if (($result != 0) && (&findInFiles("no shared cipher", "test34_server_err.log", "test34_server_out.log"))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 35: client and server use NULL TLS Profile: ";
+$pid = &startBackgroundProcess("$storescp -d --profile-null +tls user1_key.pem user1_cert.pem -ic $tlsport >test35_server_out.log 2>test35_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla --profile-null -ic localhost $tlsport >test35_client_out.log 2>test35_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 36: client lists supported ciphers: ";
+$result = system("$echoscu --list-ciphers >test36_client_out.log 2>test36_client_err.log");
+if (($result == 0) && (&findInFiles("TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA", "test36_client_err.log", "test36_client_out.log"))) { &testPassed(); } else { &testFailed(); }
+
+print "Test 37: client adds non-recommended ciphersuite: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test37_server_out.log 2>test37_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla --cipher TLS_RSA_WITH_AES_128_GCM_SHA256 -ic localhost $tlsport >test37_client_out.log 2>test37_client_err.log");
+if (($result == 0) && (&findInFiles("RFC 7525 recomments that such cipher suites should not be used", "test37_client_err.log", "test37_client_out.log"))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 38: client adds NULL ciphersuite: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test38_server_out.log 2>test38_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla --cipher TLS_RSA_WITH_NULL_SHA -ic localhost $tlsport >test38_client_out.log 2>test38_client_err.log");
+if (($result != 0) && (&findInFiles("Unencrypted ciphersuite 'TLS_RSA_WITH_NULL_SHA' not permitted", "test38_client_err.log", "test38_client_out.log"))) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Test 39: client adds CAMELLIA ciphersuite: ";
+$pid = &startBackgroundProcess("$storescp -d +tls user1_key.pem user1_cert.pem -ic $tlsport >test39_server_out.log 2>test39_server_err.log");
+do { $result = system("$tcpclient localhost $tlsport >tcpclient.log"); } while ($result != 0);
+$result = system("$echoscu -d +tla --cipher TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA -ic localhost $tlsport >test39_client_out.log 2>test39_client_err.log");
+if ($result == 0) { &testPassed(); } else { &testFailed(); }
+&doKill($pid);
+$tlsport++;
+
+print "Tests completed: $numPassed tests passed, $numFailed tests failed.\n";
+exit(0);
+
+###############################################################################
+
+sub testPassed
+{
+  print "passed.\n";
+  $numPassed++;
+}
+
+sub testFailed
+{
+  print "failed.\n";
+  $numFailed++;
+}
+
+#
+# startBackgroundProcess(command)
+# run command in separate process
+#
+sub startBackgroundProcess
+{
+   my  $pid = fork();
+   if ($pid)
+   { # Parent
+      return $pid;
+   }
+   elsif ($pid == 0)
+   { # Child
+     if (! $windows)
+     {
+       setpgrp(0,0); # set process group to process ID; this function is not available on Windows.
+     }
+     # this allows us to use kill '-TERM' to kill both the shell actually started by exec()
+     # and the real process (e.g. storescp) started from the shell, which has a different PID
+     # and is a child process of this one, i.e. inherits its process group ID.
+     exec(@_) || die("unable to execute background command");
+   }
+   else
+   { # Unable to fork
+     die "Error: unable to fork.";
+   }
+}
+
+#
+# find line matching regular expression in a text file
+# @param regex regular expression
+# @param filename filename
+#
+sub findInFile
+{
+  local($regex, $filename) = @_;
+  open(INFILE, "<$filename") || die "unable to open file '$filename'";
+  while (my $row = <INFILE>)
+  {
+    chomp $row;
+    if ($row =~ /$regex/) { close INFILE; return 1; }
+  }
+  close INFILE;
+  return 0;
+}
+
+#
+# find line matching regular expression in two text files (for stdout and stderr)
+# @param regex regular expression
+# @param filename1 filename 1
+# @param filename2 filename 2
+#
+sub findInFiles
+{
+  local($regex, $filename1, $filename2) = @_;
+  open(INFILE, "<$filename1") || die "unable to open file '$filename1'";
+  while (my $row = <INFILE>)
+  {
+    chomp $row;
+    if ($row =~ /$regex/) { close INFILE; return 1; }
+  }
+  close INFILE;
+  open(INFILE2, "<$filename2") || die "unable to open file '$filename2'";
+  while (my $row = <INFILE2>)
+  {
+    chomp $row;
+    if ($row =~ /$regex/) { close INFILE2; return 1; }
+  }
+  close INFILE2;
+  return 0;
+}
+
+#
+# compute MD5 digest of a file
+# @param filename filename
+#
+sub md5digest
+{
+  local($filename) = @_;
+  open (my $fh, '<', $filename) || die "unable to open file '$filename'";
+  binmode ($fh);
+  local ($result) = Digest::MD5->new->addfile($fh)->hexdigest;
+  close ($fh);
+  return $result;
+}
+
+#
+# kill process group
+# @param pid process ID
+#
+sub doKill
+{
+  local($pid) = @_;
+  # don't use kill on Windows, because here $pid will always point to the Perl interpreter, i.e. we'd kill ourselves.
+  if (! $windows) { kill '-TERM', $pid; }
+}
index a178cf187b8fe8d09a4c48d95373e2d227d20779..504b52090b9f9f8c3749148ea8ba8b32da471c9d 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmtract)
+project(dcmtract)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmtract_SOURCE_DIR}/include" "${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
+include_directories("${dcmtract_SOURCE_DIR}/include" "${dcmiod_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" ${ZLIB_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc include)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc include)
+  add_subdirectory(${SUBDIR})
+endforeach()
index d1c7d65eb7bdd1856337ef8b28e0f2b31debb6e9..2a0057930949ff8b7fe859c5946a1d32c2b9960e 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmtract DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h" PATTERN "CVS" EXCLUDE)
+install(DIRECTORY dcmtk/dcmtract DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 01fe2be4e6c00b95916d2b6bfafa65725e5b5cc1..94cd429ad8980f72f746b12466b38ca555fab9e2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -222,17 +222,17 @@ public:
    */
   virtual void clearData();
 
+  /** Check whether measurement values for all tracks are set
+   *  @return OFTrue if values are completely present, OFFalse otherwise
+   */
+  virtual OFBool checkValuesComplete();
+
 protected:
 
   /** Protected constructor, use create() method to create a new track set
    */
   TrcMeasurement();
 
-  /** Check whether measurement values for all tracks are set
-   *  @return OFTrue if values are completely present, OFFalse otherwise
-   */
-  virtual OFBool checkValuesComplete();
-
 private:
 
   /// Single item from Concept Name Code Sequence (type of measurement)
index 671bd521a7cae679007f8e440f8b1e46ea94e63b..d465e5f969c55bdb6de841d3c6789745c00c79aa 100644 (file)
@@ -1,6 +1,6 @@
     /*
  *
- *  Copyright (C) 2016, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -61,7 +61,10 @@ public:
    *          Types"
    *  @param  trackSetAlgorithmIdentification Algorithm used in order to
    *          create Track Set. DICOM prescribes code from CID 7262 "Diffusion
-   *          Tractography Algorithm Families".
+   *          Tractography Algorithm Families". A trackset can contain more than
+   *          one algorithm description. If you want to add more than one
+   *          description macro, getTrackingAlgorithmIdentification() and add
+   *          as many as needed to the returned vector.
    *  @param  trackSet Returns the created Track Set, if successfull (NULL
    *          otherwise)
    *  @return EC_Normal if creation was successful, error otherwise
@@ -70,7 +73,7 @@ public:
                             const OFString& trackSetDescription,
                             const CodeWithModifiers& trackSetAnatomy,
                             const CodeSequenceMacro& trackSetDiffusionModelCode,
-                            const CodeSequenceMacro& trackSetAlgorithmIdentification,
+                            const AlgorithmIdentificationMacro& trackSetAlgorithmIdentification,
                             TrcTrackSet*& trackSet /* result */);
 
   /** Destructor, frees memory
@@ -189,7 +192,7 @@ public:
    *          otherwise
    */
   virtual OFCondition getMeasurement(const size_t measurementIndex,
-                                     const TrcMeasurement*& measurement);
+                                     TrcMeasurement*& measurement);
 
   /** Get descriptive information of all measurements
    *  @param typesAndUnits  Returns vector of pairs, which each pair holding
@@ -220,7 +223,7 @@ public:
   /** Get access to tracking algorithm identification codes
    *  @return Reference to tracking algorithm identification codes
    */
-  virtual OFVector<CodeSequenceMacro*>& getTrackingAlgorithmIdentification();
+  virtual OFVector<AlgorithmIdentificationMacro*>& getTrackingAlgorithmIdentification();
 
   /** Returns number of Tracks in Track Set
    *  @return Number of Tracks in Track Set
@@ -461,7 +464,7 @@ private:
   CodeSequenceMacro m_DiffusionModelCode;
 
   /// Codes for algorithms used to create this Track Set
-  OFVector<CodeSequenceMacro*> m_TrackingAlgorithmIdentification;
+  OFVector<AlgorithmIdentificationMacro*> m_TrackingAlgorithmIdentification;
 
 };
 
index 1089a7db0702d01f096bf29e2fad7c34c4423dda..24dc7bcd8f45642ee2f64f71f56a875a6f2fc9f1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016-2017, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -66,7 +66,9 @@ public:
                             const IODReferences& imageReferences,
                             TrcTractographyResults*& result);
 
-  /** CAUTION: Parameter order (readFoR and readSeries) changed!
+  /** CAUTION: Parameter order (readFoR and readSeries) changed, and there is a
+   *  new parameter "takeOverCharset" which per default takes over the charset
+   *  from the given source file!
    *  Take over general information for Patient, Study, Series and/or Frame of Reference
    *  from existing file
    *  @param  filename The filename to read from
@@ -81,15 +83,19 @@ public:
    *          reason is that the study and series information (including UIDs)
    *          are likely to change during this call, which requires another
    *          sorting of references inside the Common Instance Reference module.
+   *  @param  takeOverCharset If OFTrue (default), Specific Character Set is
+   *          taken over from imported dataset. If it's not present or empty
+   *          (invalid), the attribute will not be present in this class either.
    *  @return EC_Normal if reading was successful (i.e.\ if any information could
    *          be read), otherwise an error is returned
    */
-  virtual OFCondition importHierarchy(const OFString& filename,
-                                            const OFBool readPatient,
-                                            const OFBool readStudy,
-                                            const OFBool readFoR = OFFalse,
-                                            const OFBool readSeries = OFFalse,
-                                            const OFBool updateCommonInstanceReferences = OFTrue);
+  virtual OFCondition import(const OFString& filename,
+                             const OFBool readPatient,
+                             const OFBool readStudy,
+                             const OFBool readFoR = OFFalse,
+                             const OFBool readSeries = OFFalse,
+                             const OFBool updateCommonInstanceReferences = OFTrue,
+                             const OFBool takeOverCharset = OFTrue);
 
   /** Add Track Set to object. If successful, the resulting Track Set can be
    *  filled by calling addTrack() (and other methods) on it.
@@ -106,7 +112,10 @@ public:
    *          Model Value Types"
    *  @param  algoIdentCode Code describing the algorithm identification. DICOM
    *          prescribes code from CID 7262 "Diffusion Tractography Algorithm
-   *          Families".
+   *          Families". A trackset can contain more than one algorithm
+   *          description. If you want to add more than one description macro,
+   *          use getTrackSets()->getTrackingAlgorithmIdentification() and add
+   *          as many as needed to the returned vector.
    *  @param  trackSet Returns the resulting Track Set if successful, NULL
    *          otherwise.
    *  @return EC_Normal if creation was successful, error otherwise
@@ -115,7 +124,7 @@ public:
                                   const OFString& trackSetDescription,
                                   const CodeWithModifiers& anatomyCode,
                                   const CodeSequenceMacro& diffusionModelCode,
-                                  const CodeSequenceMacro& algoIdentCode,
+                                  const AlgorithmIdentificationMacro& algoIdentCode,
                                   TrcTrackSet*& trackSet);
 
   // -------------------- destruction -------------------------------
index ca4f957e6e564829620dc9e26d2142db1d5487b5..715c30ece9ea1e846013ec4a21c7cd83619ca4e8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -41,6 +41,13 @@ extern DCMTK_DCMTRACT_EXPORT OFLogger DCM_dcmtractLogger;
 #define DCMTRACT_FATAL(msg) OFLOG_FATAL(DCM_dcmtractLogger, msg)
 
 
+// include this file in doxygen documentation
+
+/** @file trctypes.h
+ *  @brief type definitions, constants and classes for the dcmtract module
+ */
+
+
 /*
  * Definition of error codes
  */
index 8f9fabd023aef52309c471bea4f296c4793e00f6..4f3bad29ced2e036c02ab7d49a51ae2a50bb7276 100644 (file)
@@ -45,6 +45,7 @@ trcmeasurement.o: trcmeasurement.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -52,6 +53,7 @@ trcmeasurement.o: trcmeasurement.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -169,6 +171,7 @@ trcmodtractresults.o: trcmodtractresults.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -176,6 +179,7 @@ trcmodtractresults.o: trcmodtractresults.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -298,6 +302,7 @@ trcstatistic.o: trcstatistic.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -305,6 +310,7 @@ trcstatistic.o: trcstatistic.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -422,6 +428,7 @@ trctrack.o: trctrack.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -429,6 +436,7 @@ trctrack.o: trctrack.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -498,6 +506,7 @@ trctrackset.o: trctrackset.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -505,6 +514,7 @@ trctrackset.o: trctrackset.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -626,6 +636,7 @@ trctractographyresults.o: trctractographyresults.cc \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
@@ -633,6 +644,7 @@ trctractographyresults.o: trctractographyresults.cc \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -758,6 +770,7 @@ trctypes.o: trctypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
@@ -766,6 +779,7 @@ trctypes.o: trctypes.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdeftag.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
  ../include/dcmtk/dcmtract/trcdef.h
index d51f158ac2239775cc7a9b160e18b0f28c595bd3..925145e1cd1f924c0810b074533887057c272869 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -80,7 +80,7 @@ OFCondition TrcMeasurement::get(const size_t trackNumber,
 {
   type = m_Type;
   units = m_Units;
-  if (trackNumber < m_Values.size() -1 )
+  if (m_Values.size() >= trackNumber + 1)
   {
     return TRC_EC_NoSuchMeasurement;
   }
@@ -296,6 +296,7 @@ OFCondition TrcMeasurement::Values::get(const Float32*& dataValues,
     if (result.bad())
     {
       trackPointIndices = NULL;
+      numIndices = numValues;
       result = EC_Normal; // no track point indices mean that measurements cover all points
     }
   }
index a4dbd9e1f493cf8921e52d333466972f1d2182bc..5e3487afac09828c169be5c44060b2ef1a58c7bf 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -40,7 +40,10 @@ TrcTractographyResultsModule::TrcTractographyResultsModule(
 
 
 TrcTractographyResultsModule::TrcTractographyResultsModule()
-: IODModule()
+: IODModule(),
+  m_ContentIdentification(),
+  m_TrackSets(),
+  m_ReferencedInstances()
 {
   resetRules();
 }
index 36586d8e1f2c1b6060c6eb1132f47b37bdee44eb..e971495788310a8bfe6fa42bdeca7b5047b46754 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016-2017, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -31,7 +31,8 @@ TrcStatistic::TrcStatistic()
 : IODComponent(),
   m_Type(),
   m_TypeModifier(),
-  m_Units()
+  m_Units(),
+  m_Values()
 {
   // This is an abstract class so it is enough to call resetRules() is called
   // from derived classes
index 41d48c671d01aedf5baa13f4d25432ece4eefef3..3bf3662c01b722a646026670c667d1992d1b5198 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016-2017, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -216,7 +216,7 @@ TrcTypes::E_TrackColorMode TrcTrack::getRecommendedDisplayCIELabMode()
   DcmElement *elem = NULL;
   if (m_Item->findAndGetElement(DCM_RecommendedDisplayCIELabValue, elem).good())
   {
-    if (elem->getVM() == 3)
+    if (elem->getNumberOfValues() == 3)
     {
       if (m_Item->findAndGetElement(DCM_RecommendedDisplayCIELabValueList, elem).good())
       {
@@ -304,7 +304,6 @@ OFCondition TrcTrack::setRecommendedDisplayCIELabValues(const Uint16* colors,
 
 OFBool TrcTrack::fixPointCoordinatesDataVM()
 {
-  DcmElement *elem = NULL;
   const Float32* values = NULL;
   unsigned long numValues = 0;
   if (m_Item->findAndGetFloat32Array(DCM_PointCoordinatesData, values, &numValues).good())
@@ -315,9 +314,9 @@ OFBool TrcTrack::fixPointCoordinatesDataVM()
     }
     else
     {
-      if (elem->putFloat32Array(values, numValues - (numValues % 3)).good())
+      if (m_Item->putAndInsertFloat32Array(DCM_PointCoordinatesData, values, numValues - (numValues % 3)).good())
       {
-        DCMTRACT_WARN("Wrong number of values in track (" << numValues << "), cutting " << numValues % 3 << " coordinates off at the end");
+        DCMTRACT_WARN("Wrong number of values in track (" << numValues << "), cutting off " << numValues % 3 << " coordinates at the end");
         return OFTrue;
       }
     }
index 8c8c4b70a17fb2bfccd0981b4c1772168362ce8c..0cb45df4e93a1b2cb49b726f0c2aa5d2b617038e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2016-2017, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -68,7 +68,7 @@ OFCondition TrcTrackSet::create(const OFString& trackSetLabel,
                                 const OFString& trackSetDescription,
                                 const CodeWithModifiers& trackSetAnatomy,
                                 const CodeSequenceMacro& trackSetDiffusionModelCode,
-                                const CodeSequenceMacro& trackSetAlgorithmIdentification,
+                                const AlgorithmIdentificationMacro& trackSetAlgorithmIdentification,
                                 TrcTrackSet*& trackSet)
 {
   // Track Set Number is set within TrcTractographyResults::addTrackSet()
@@ -99,11 +99,11 @@ OFCondition TrcTrackSet::create(const OFString& trackSetLabel,
 
   if (result.good())
   {
-    result = OFconst_cast(CodeSequenceMacro*, &trackSetAlgorithmIdentification)->check();
+    result = OFconst_cast(AlgorithmIdentificationMacro*, &trackSetAlgorithmIdentification)->check();
     if (result.good())
     {
       // add deep copy (via IODComponent) of input param
-      trackSet->m_TrackingAlgorithmIdentification.push_back(new CodeSequenceMacro(trackSetAlgorithmIdentification));
+      trackSet->m_TrackingAlgorithmIdentification.push_back(new AlgorithmIdentificationMacro(trackSetAlgorithmIdentification));
     }
   }
 
@@ -313,7 +313,7 @@ CodeSequenceMacro& TrcTrackSet::getDiffusionModelCode()
 }
 
 
-OFVector<CodeSequenceMacro*>& TrcTrackSet::getTrackingAlgorithmIdentification()
+OFVector<AlgorithmIdentificationMacro*>& TrcTrackSet::getTrackingAlgorithmIdentification()
 {
   return m_TrackingAlgorithmIdentification;
 }
@@ -378,7 +378,7 @@ OFCondition TrcTrackSet::findMeasurementsByType(const CodeSequenceMacro& type,
 
 
 OFCondition TrcTrackSet::getMeasurement(const size_t measurementIndex,
-                                        const TrcMeasurement*& measurement)
+                                        TrcMeasurement*& measurement)
 {
   if (measurementIndex > m_Measurements.size() - 1)
   {
index cfb7c496c806086276df26de56ab5ea4661fbfb6..9c83e10269c1a2a703f545e8f4dd44c0e8e58799 100644 (file)
@@ -1,6 +1,6 @@
   /*
  *
- *  Copyright (C) 2016-2017, Open Connections GmbH
+ *  Copyright (C) 2016-2018, Open Connections GmbH
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation are maintained by
@@ -28,7 +28,8 @@
 TrcTractographyResults::TrcTractographyResults()
 : DcmIODCommon(),
   m_EnhancedGeneralEquipmentModule(DcmIODCommon::getData(), DcmIODCommon::getRules()),
-  m_TractographyResultsModule(DcmIODCommon::getData(), DcmIODCommon::getRules())
+  m_TractographyResultsModule(DcmIODCommon::getData(), DcmIODCommon::getRules()),
+  m_References()
 {
   TrcTractographyResults::initIODRules();
 }
@@ -138,7 +139,7 @@ OFCondition TrcTractographyResults::addTrackSet(const OFString& trackSetLabel,
                                                 const OFString& trackSetDescription,
                                                 const CodeWithModifiers& anatomyCode,
                                                 const CodeSequenceMacro& diffusionModelCode,
-                                                const CodeSequenceMacro& algoIdentCode,
+                                                const AlgorithmIdentificationMacro& algoIdentCode,
                                                 TrcTrackSet*& trackSet)
 {
   OFCondition result = TrcTrackSet::create(trackSetLabel, trackSetDescription, anatomyCode, diffusionModelCode, algoIdentCode, trackSet);
@@ -215,13 +216,14 @@ OFCondition TrcTractographyResults::write(DcmItem &dataset)
 }
 
 
-OFCondition TrcTractographyResults::importHierarchy(
+OFCondition TrcTractographyResults::import(
   const OFString& filename,
   const OFBool readPatient,
   const OFBool readStudy,
   const OFBool readFoR,
   const OFBool readSeries,
-  const OFBool updateCommonInstanceReferences)
+  const OFBool updateCommonInstanceReferences,
+  const OFBool takeOverCharset)
 {
   DcmFileFormat dcmff;
   OFCondition result = dcmff.loadFile(filename.c_str());
@@ -230,7 +232,7 @@ OFCondition TrcTractographyResults::importHierarchy(
     DcmDataset *dset = dcmff.getDataset();
     if (dset != NULL)
     {
-      result = DcmIODCommon::importHierarchy(*dset, readPatient, readStudy, readFoR, readSeries);
+      result = DcmIODCommon::importHierarchy(*dset, readPatient, readStudy, readFoR, readSeries, takeOverCharset);
       if (result.good() && updateCommonInstanceReferences)
       {
         getCommonInstanceReference().clearData();
index 6ced5319ea90d7523107e095d6f4f87eb77bfdec..ae51efe3fc78ea57ba6ac37609f4b89b539c8dbb 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(dcmwlm)
+project(dcmwlm)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${dcmwlm_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmnet_SOURCE_DIR}/include" ${ZLIB_INCDIR})
+include_directories("${dcmwlm_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${oflog_SOURCE_DIR}/include" "${dcmdata_SOURCE_DIR}/include" "${dcmnet_SOURCE_DIR}/include" ${ZLIB_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc apps include data tests)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc apps include data tests)
+  add_subdirectory(${SUBDIR})
+endforeach()
index ff553ba42347c76ed3175fdecaaf896dc67a016c..b91efd8900d39b09f42b12bdbea24f935d072e32 100644 (file)
@@ -1,5 +1,5 @@
 # declare additional include directories
-INCLUDE_DIRECTORIES("${dcmtls_SOURCE_DIR}/include")
+include_directories("${dcmtls_SOURCE_DIR}/include")
 
 # declare executables
 DCMTK_ADD_EXECUTABLE(wlmscpfs wlmscpfs wlcefs)
index 8506feb52209966aeaedc9e39b70d0986c348bec..46ce7289ba893b997c98f64a83570729874afa61 100644 (file)
@@ -44,12 +44,14 @@ wlcefs.o: wlcefs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmwlm/wltypdef.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -129,12 +131,14 @@ wlmscpfs.o: wlmscpfs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmwlm/wltypdef.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
index 8e16ed81454e20726fe6f27055a2e9c10a3a5d96..0bb377ca7c31d1a6ef59e555247a89181be524d8 100644 (file)
@@ -1,2 +1,2 @@
 # declare directories to be installed
-INSTALL(DIRECTORY wlistdb wlistqry DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data)
+install(DIRECTORY wlistdb wlistqry DESTINATION "${CMAKE_INSTALL_DATADIR}/dcmtk" COMPONENT data)
index 1e895a0b597429b1bb7e250aa6b003e9992e76dd..84d40afa13dfd16624f2cdd4a9b2ec840fdc80cb 100644 (file)
@@ -2,7 +2,7 @@
 (0008,0005) CS  [ISO_IR 100]
 (0010,0010) PN  HAYDN^FRANZ^JOSEPH
 (0010,0020) LO  HF
-(0010,0030) DA  17320431
+(0010,0030) DA  17320331
 (0010,0040) CS  M
 (0010,2000) LO  ABZESS
 (0010,2110) LO  TANTAL
index 14ef7c311759827ba0ed9c3cd9720bbcf9548027..adb2922062fcd064055f8014bbfe8a01c904ad77 100644 (file)
@@ -2,7 +2,7 @@
 (0008,0005) CS  [ISO_IR 100]
 (0010,0010) PN  HAYDN^FRANZ^JOSEPH
 (0010,0020) LO  HF
-(0010,0030) DA  17320431
+(0010,0030) DA  17320331
 (0010,0040) CS  M
 (0010,2000) LO  ABZESS
 (0010,2110) LO  THORIUM
index 92a686297c7809c3ac9d55c72de2f8f04a601cb8..d17d3a2b8a827da4ff1e2f42468ba4e7c7f9fa91 100644 (file)
@@ -2,7 +2,7 @@
 (0008,0005) CS  [ISO_IR 100]
 (0010,0010) PN  HAYDN^FRANZ^JOSEPH
 (0010,0020) LO  HF
-(0010,0030) DA  17320431
+(0010,0030) DA  17320331
 (0010,0040) CS  M
 (0010,2000) LO  ABZESS
 (0010,2110) LO  BARIUMSULFAT
index e6ea5973c4ed802c3744b95954b7bf4271f16766..c346c59f21fde968510aa574f69fb20e614c6f6e 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/dcmwlm DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/dcmwlm DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index 8931da7f5041931d4e042e6593a7d1f5cdbea4b1..fcde0bb3aa2fe3efc5106d2a2fd3491c6939c205 100644 (file)
@@ -298,42 +298,6 @@ class DCMTK_DCMWLM_EXPORT WlmDataSource
        */
     OFBool ContainsOnlyValidCharacters( const char *s, const char *charset );
 
-      /** This function checks if the given value is a valid date or date range.
-       *  @param value The value which shall be checked.
-       *  @return OFTrue in case the given value is a valid date or date range, OFFalse otherwise.
-       */
-    OFBool IsValidDateOrDateRange( const OFString& value );
-
-      /** This function checks if the given date value is valid.
-       *  According to the 2001 DICOM standard, part 5, Table 6.2-1, a date
-       *  value is either in format "yyyymmdd" or in format "yyyy.mm.dd",
-       *  so that e.g. "19840822" represents August 22, 1984.
-       *  @param value The value which shall be checked.
-       *  @return OFTrue in case the Date is valid, OFFalse otherwise.
-       */
-    OFBool IsValidDate( const OFString& value );
-
-      /** This function checks if the given value is a valid time or time range.
-       *  @param value The value which shall be checked.
-       *  @return OFTrue in case the given value is a valid time or time range, OFFalse otherwise.
-       */
-    OFBool IsValidTimeOrTimeRange( const OFString& value );
-
-      /** This function checks if the given time value is valid.
-       *  According to the 2001 DICOM standard, part 5, Table 6.2-1, a time
-       *  value is either in format "hhmmss.fracxx" or "hh:mm:ss.fracxx" where
-       *  - hh represents the hour (0-23)
-       *  - mm represents the minutes (0-59)
-       *  - ss represents the seconds (0-59)
-       *  - fracxx represents the fraction of a second in millionths of seconds (000000-999999)
-       *  Note that one or more of the components mm, ss, or fracxx may be missing as
-       *  long as every component to the right of a missing component is also missing.
-       *  If fracxx is missing, the "." character in front of fracxx is also missing.
-       *  @param value The value which shall be checked.
-       *  @return OFTrue in case the time is valid, OFFalse otherwise.
-       */
-    OFBool IsValidTime( const OFString& value );
-
       /** This function returns the value of the given DICOM string element (attribute)
        *  in the parameter resultVal and returns OFTrue if successful.
        *  If the element does not refer to a string attribute or contains an empty value,
index 23aa7e7d09b3065cbfd0e48394d9c182f837dafb..cf7747b8646c3282a70b95bd0eb183c057d70bdb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2017, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -13,7 +13,7 @@
  *
  *  Module:  dcmwlm
  *
- *  Author:  Thomas Wilkens
+ *  Author:  Thomas Wilkens, Jan Schlamelcher
  *
  *  Purpose: Class for managing file system interaction.
  *
 #include "dcmtk/ofstd/ofstring.h"
 #include "dcmtk/ofstd/oftypes.h"   /* for OFBool */
 #include "dcmtk/ofstd/ofvector.h"
+#include "dcmtk/ofstd/ofmem.h"
 #include "dcmtk/dcmwlm/wldefine.h"
 
-template <class T> class OFOrderedSet;
 struct WlmSuperiorSequenceInfoType;
 class DcmDataset;
 class DcmTagKey;
 class OFCondition;
 class DcmItem;
+class OFdirectory_iterator;
 
 /** This class encapsulates data structures and operations for managing
  *  data base interaction in the framework of the DICOM basic worklist
@@ -63,24 +64,13 @@ class DCMTK_DCMWLM_EXPORT WlmFileSystemInteractionManager
     OFBool enableRejectionOfIncompleteWlFiles;
     /// called AE title
     OFString calledApplicationEntityTitle;
-    /// array of matching records
-    DcmDataset **matchingRecords;
-    /// number of array fields
-    unsigned long numOfMatchingRecords;
+    /// matching records
+    OFVector<OFshared_ptr<DcmDataset> > matchingRecords;
 
-      /** This function determines all worklist files in the directory specified by
-       *  dfPath and calledApplicationEntityTitle, and returns the complete path and
-       *  filename information in an array of strings.
-       *  @param worklistFiles Set of strings, each specifying path and filename to one worklist file.
+      /** Increment the given directory iterator until it refers to a worklist file (or past-the-end).
+       *  @param it A reference to an OFdirectory_iterator.
        */
-    void DetermineWorklistFiles( OFVector<OFString> &worklistFiles );
-
-      /** This function returns OFTrue if the given filename refers to a worklist file,
-       *  i.e. has an extension of ".wl".
-       *  @param fname The name of the file.
-       *  @return OFTrue in case the given filename refers to a worklist file, OFFalse otherwise.
-       */
-    OFBool IsWorklistFile( const char *fname );
+    OFdirectory_iterator& FindNextWorklistFile( OFdirectory_iterator& it );
 
       /** This function checks if the given dataset (which represents the information from a
        *  worklist file) contains all necessary return type 1 information. According to the
@@ -155,21 +145,23 @@ class DCMTK_DCMWLM_EXPORT WlmFileSystemInteractionManager
        */
     OFBool MatchSequences( DcmSequenceOfItems& candidate, DcmSequenceOfItems& query, const MatchingKeys& matchingKeys );
 
-      /** Determine if the sequences elements are universal matching.
+      /** Determine if a sequence is an universal match.
        *  @param query The query sequence.
        *  @param matchingKeys The matching keys to regard.
-       *  @param normalize normalize each element value. Defaults to OFTrue.
-       *  @param enableWildCardMatching enable or disable wild card matching. Defaults to OFTrue,
-       *    which means wild card matching is performed if the element's VR supports it. Set to
-       *    OFFalse to force single value matching instead.
-       *  @return returns OFTrue if sequence has no items or the element of the items are all empty or,
-       *    if enableWildCardMatching is enabled, containing only wildcard chars.
-       *    Returns OFFalse otherwise.
+       *  @param normalize Normalize each attribute value before the check. Defaults to OFTrue, which
+       *    means the value will be normalized as appropriate for the given VR, e.g. ignoring spaces
+       *    used as padding.
+       *  @param normalizeWildCards. Whether to interpret a query only consisting of wild cards as
+       *    an universal match. Defaults to OFTrue, which means wild cards will be normalized if an
+       *    attribute's VR supports it and it is allowed for the attribute (as defined by the matchingKeys
+       *    argument). Set to OFFalse to force strict interpretation instead.
+       *  @return OFTrue if the sequence has no items or if all attributes in its item can be considered
+       *    an universal match. Returns OFFalse otherwise.
        */
-    OFBool isUniversalMatchingSequences( DcmSequenceOfItems& query,
-                                         const MatchingKeys& matchingKeys,
-                                         const OFBool normalize = OFTrue,
-                                         const OFBool enableWildCardMatching = OFTrue );
+    OFBool IsUniversalMatch( DcmSequenceOfItems& query,
+                             const MatchingKeys& matchingKeys,
+                             const OFBool normalize = OFTrue,
+                             const OFBool normalizeWildCards = OFTrue );
 
       /** This function returns OFTrue, if the matching key attribute values in the
        *  dataset match the matching key attribute values in the search mask.
@@ -178,7 +170,7 @@ class DCMTK_DCMWLM_EXPORT WlmFileSystemInteractionManager
        *  @param matchingKeys The matching keys to regard.
        *  @return OFTrue in case the dataset matches the search mask in the matching key attribute values, OFFalse otherwise.
        */
-    OFBool DatasetMatchesSearchMask( DcmItem *dataset, DcmItem *searchMask, const MatchingKeys& matchingKeys );
+    OFBool DatasetMatchesSearchMask( DcmItem& dataset, DcmItem& searchMask, const MatchingKeys& matchingKeys );
 
   public:
       /** default constructor.
@@ -189,7 +181,7 @@ class DCMTK_DCMWLM_EXPORT WlmFileSystemInteractionManager
        */
     ~WlmFileSystemInteractionManager();
 
-      /**  Set value in member variable.
+      /** Set value in member variable.
        *  @param value The value to set.
        */
     void SetEnableRejectionOfIncompleteWlFiles( OFBool value );
@@ -214,14 +206,26 @@ class DCMTK_DCMWLM_EXPORT WlmFileSystemInteractionManager
        */
     OFBool IsCalledApplicationEntityTitleSupported( const OFString& calledApplicationEntityTitlev );
 
-      /** This function determines the records from the worklist files which match
+      /** This function determines the records from the Worklist files that match
        *  the given search mask and returns the number of matching records. Also,
-       *  this function will store the matching records in memory in the array
-       *  member variable matchingRecords.
-       *  @param searchMask - [in] The search mask.
-       *  @return Number of matching records.
+       *  this function will store the matching records inside the member variable
+       *  matchingRecords.
+       *  @param searchMask A pointer to the search mask.
+       *  @return The number of matching records.
+       */
+    size_t DetermineMatchingRecords( DcmDataset* searchMask );
+
+      /** Determine whether a Worklist file matches the search mask.
+       *  @param searchMask A reference to the search mask.
+       *  @param  worklistFile An OFpath (hopefully) referring to a Worklist
+       *    file.
+       *  @details
+       *  This method will attempt to load the Worklist file referenced by the
+       *  argument worklistFile and, on success, compare it against searchMask.
+       *  If the file matches the search mask, its dataset part will be added
+       *  to the matching records member variable.
        */
-    unsigned long DetermineMatchingRecords( DcmDataset *searchMask );
+    void MatchWorklistFile( DcmDataset& searchMask, const OFpath& worklistFile );
 
       /** For the matching record that is identified through idx, this function returns the number
        *  of items that are contained in the sequence element that is referred to by sequenceTag.
index c60ed7f81bb2867c996c7af5a4d977cd758471d3..74d1acd3989cd69bffe142afb1015f1f89d91f0c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2017, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -30,7 +30,7 @@
 // include this file in doxygen documentation
 
 /** @file wltypdef.h
- *  @brief type definitions and macros for the dcmwlm module
+ *  @brief type definitions and constants for the dcmwlm module
  */
 
 
index a2cfac4a584e1c9a4f91486bb61ab63326040679..857ddc297ea730bffe7a633d377c37812d0fabfc 100644 (file)
@@ -44,12 +44,14 @@ wlds.o: wlds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmwlm/wltypdef.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -64,6 +66,7 @@ wlds.o: wlds.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcstack.h \
  ../../dcmdata/include/dcmtk/dcmdata/dclist.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcpcache.h \
+ ../../dcmdata/include/dcmtk/dcmdata/dcmatch.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrat.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrlo.h \
@@ -130,12 +133,14 @@ wldsfs.o: wldsfs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmwlm/wltypdef.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
@@ -161,9 +166,9 @@ wldsfs.o: wldsfs.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/dcmwlm/wlds.h ../include/dcmtk/dcmwlm/wlfsim.h \
  ../include/dcmtk/dcmwlm/wldsfs.h
 wlfsim.o: wlfsim.cc ../../config/include/dcmtk/config/osconfig.h \
- ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../dcmnet/include/dcmtk/dcmnet/diutil.h \
  ../../dcmnet/include/dcmtk/dcmnet/dicom.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
  ../../dcmnet/include/dcmtk/dcmnet/cond.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofstream.h \
@@ -207,12 +212,14 @@ wlfsim.o: wlfsim.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcdatset.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcitem.h \
@@ -234,6 +241,7 @@ wlfsim.o: wlfsim.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../dcmnet/include/dcmtk/dcmnet/assoc.h \
  ../../ofstd/include/dcmtk/ofstd/ofdate.h \
  ../../ofstd/include/dcmtk/ofstd/oftime.h \
+ ../../ofstd/include/dcmtk/ofstd/offilsys.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcvrda.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcbytstr.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcelem.h \
@@ -337,12 +345,14 @@ wlmactmg.o: wlmactmg.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../include/dcmtk/dcmwlm/wltypdef.h \
  ../../dcmdata/include/dcmtk/dcmdata/dctagkey.h \
index 19a37354a0a05c8eb6e3f31b598cc82eda3c8749..b037635fa6c07ea5ca2f5fe13872aa783c102cd8 100644 (file)
@@ -27,6 +27,7 @@
 #include "dcmtk/dcmwlm/wltypdef.h"   // for type definitions
 #include "dcmtk/ofstd/oftypes.h"     // for OFBool
 #include "dcmtk/dcmdata/dcdatset.h"  // for DcmDataset
+#include "dcmtk/dcmdata/dcmatch.h"   // for DcmAttributeMatching
 #include "dcmtk/dcmdata/dcvrat.h"    // for DcmAttributTag
 #include "dcmtk/dcmdata/dcvrlo.h"    // for DcmLongString
 #include "dcmtk/dcmdata/dcvrae.h"
@@ -648,33 +649,50 @@ OFBool WlmDataSource::CheckMatchingKey( const DcmElement *elem )
   switch( elem->ident() )
   {
     case EVR_DA:
-      // get string value
-      ok = GetStringValue( elem, val );
-      // if there is a value and if the value is not a date or a date range, return invalid value
-      if( ok && !IsValidDateOrDateRange( val ) )
+    case EVR_DT:
+    case EVR_TM:
+    {
+      const char* data;
+      size_t size;
+
       {
-        DcmTag tag( elem->getTag() );
-        PutOffendingElements( tag );
-        errorComment->putString("Invalid value for an attribute of datatype DA");
-        ok = OFFalse;
+        char* c;
+        Uint32 s;
+        if( OFconst_cast( DcmElement*, elem )->getString( c, s ).bad() )
+            break;
+        data = c;
+        size = s;
       }
-      else
-        ok = OFTrue;
-      break;
 
-    case EVR_TM:
-      // get string value
-      ok = GetStringValue( elem, val );
-      // if there is a value and if the value is not a time or a time range, return invalid value
-      if( ok && !IsValidTimeOrTimeRange( val ) )
+      OFStandard::trimString( data, size );
+      if( !size )
+        break;
+
+      switch( elem->ident() )
+      {
+      case EVR_DA:
+        ok = DcmAttributeMatching::isDateQuery( data, size );
+        break;
+      case EVR_DT:
+        ok = DcmAttributeMatching::isDateTimeQuery( data, size );
+        break;
+      case EVR_TM:
+        ok = DcmAttributeMatching::isTimeQuery( data, size );
+        break;
+      default:
+        ok = false;
+        break;
+      }
+
+      if( !ok )
       {
         DcmTag tag( elem->getTag() );
         PutOffendingElements( tag );
-        errorComment->putString("Invalid value for an attribute of datatype TM");
-        ok = OFFalse;
+        OFString message( "Invalid value for an attribute with VR=" );
+        message += DcmVR( elem->ident() ).getVRName();
+        errorComment->putString( message.data(), message.size() );
       }
-      else
-        ok = OFTrue;
+    }
       break;
 
     case EVR_CS:
@@ -761,261 +779,6 @@ OFBool WlmDataSource::CheckMatchingKey( const DcmElement *elem )
 
 // ----------------------------------------------------------------------------
 
-OFBool WlmDataSource::IsValidDateOrDateRange( const OFString& value )
-// Date         : March 19, 2002
-// Author       : Thomas Wilkens
-// Task         : This function checks if the given value is a valid date or date range.
-// Parameters   : value - [in] The value which shall be checked.
-// Return Value : OFTrue  - The given value is a valid date or date range.
-//                OFFalse - The given value is not a valid date or date range.
-{
-  // create new string without leading or trailing blanks
-  OFString dateRange = DeleteLeadingAndTrailingBlanks( value );
-
-  if (dateRange.empty())
-    return OFFalse;
-
-  // check if only allowed characters occur in the string
-  if( !ContainsOnlyValidCharacters( dateRange.c_str(), "0123456789.-" ) )
-    return( OFFalse );
-
-  // initialize return value
-  OFBool isValidDateRange = OFFalse;
-
-  // Determine if a hyphen occurs in the date range
-  size_t hyphen = dateRange.find('-');
-  if( hyphen != OFString_npos )
-  {
-    // determine if two date values are given or not
-    if( dateRange[0] == '-' )
-    {
-      // if the hyphen occurs at the beginning, there is just one date value which has to be checked for validity
-      isValidDateRange = IsValidDate( dateRange.substr(1) );
-    }
-    else if( dateRange[ dateRange.length() - 1 ] == '-' )
-    {
-      // if the hyphen occurs at the end, there is just one date value which has to be checked for validity
-      isValidDateRange = IsValidDate( dateRange.substr(0, dateRange.length() -1 ));
-    }
-    else
-    {
-      // in this case the hyphen occurs somewhere in between beginning and end; hence there are two date values
-      // which have to be checked for validity. Determine where the hyphen occurs exactly
-      // check both dates for validity
-      if( IsValidDate( dateRange.substr(0, dateRange.length()-hyphen-1 )) &&
-          IsValidDate( dateRange.substr(        hyphen + 1             )) )
-      {
-        isValidDateRange = OFTrue;
-      }
-    }
-  }
-  else
-  {
-    // if there is no hyphen, there is just one date value which has to be checked for validity
-    isValidDateRange = IsValidDate( dateRange );
-  }
-
-  // return result
-  return( isValidDateRange );
-}
-
-// ----------------------------------------------------------------------------
-
-OFBool WlmDataSource::IsValidDate( const OFString& value )
-// Date         : March 19, 2002
-// Author       : Thomas Wilkens
-// Task         : This function checks if the given date value is valid.
-//                According to the 2001 DICOM standard, part 5, Table 6.2-1, a date
-//                value is either in format "yyyymmdd" or in format "yyyy.mm.dd",
-//                so that e.g. "19840822" represents August 22, 1984.
-// Parameters   : value - [in] The value which shall be checked.
-// Return Value : OFTrue  - Date is valid.
-//                OFFalse - Date is not valid.
-{
-  int year=0, month=0, day=0;
-
-  // create new string without leading or trailing blanks
-  OFString date = DeleteLeadingAndTrailingBlanks( value );
-  // check parameter
-
-  if( value.empty() )
-    return( OFFalse );
-
-  // check if only allowed characters occur in the string
-  if( !ContainsOnlyValidCharacters( date.c_str(), "0123456789." ) )
-    return( OFFalse );
-
-  // initialize return value
-  OFBool isValidDate = OFFalse;
-
-  // check which of the two formats applies to the given string
-  if( date.length() == 8 )
-  {
-    // scan given date string
-    sscanf( date.c_str(), "%4d%2d%2d", &year, &month, &day );
-    if( year > 0 && month >= 1 && month <= 12 && day >= 1 && day <= 31 )
-      isValidDate = OFTrue;
-  }
-  else if( date.length() == 10 )
-  {
-    // scan given date string
-    sscanf( date.c_str(), "%4d.%2d.%2d", &year, &month, &day );
-    if( year > 0 && month >= 1 && month <= 12 && day >= 1 && day <= 31 )
-      isValidDate = OFTrue;
-  }
-
-  // return result
-  return( isValidDate );
-}
-
-// ----------------------------------------------------------------------------
-
-OFBool WlmDataSource::IsValidTimeOrTimeRange( const OFString& value )
-// Date         : March 19, 2002
-// Author       : Thomas Wilkens
-// Task         : This function checks if the given value is a valid time or time range.
-// Parameters   : timeRange - [in] The value which shall be checked.
-// Return Value : OFTrue  - The given value is a valid time or time range.
-//                OFFalse - The given value is not a valid time or time range.
-{
-  // create new string without leading or trailing blanks
-  OFString timeRange = DeleteLeadingAndTrailingBlanks( value );
-
-  // check if string is empty now
-  if( timeRange.empty() )
-    return( OFFalse );
-
-  // check if only allowed characters occur in the string
-  if( !ContainsOnlyValidCharacters( timeRange.c_str(), "0123456789.:-" ) )
-    return( OFFalse );
-
-  // Determine if a hyphen occurs in the time range
-  size_t hyphen = timeRange.find('-');
-  if( hyphen != OFString_npos )
-  {
-    // determine if two time values are given or not
-    if( timeRange[0] == '-' )
-    {
-      // if the hyphen occurs at the beginning, there is just one time value which has to be checked for validity
-      return IsValidTime( timeRange.substr(1) );
-    }
-    else if( timeRange[ timeRange.length() - 1 ] == '-' )
-    {
-      // if the hyphen occurs at the end, there is just one time value which has to be checked for validity
-      return IsValidTime( timeRange.substr(0, timeRange.length()-1) );
-    }
-    else
-    {
-      // in this case the hyphen occurs somewhere in between beginning and end; hence there are two time values
-      // which have to be checked for validity.
-
-      // check both times for validity
-      if( IsValidTime( timeRange.substr(0, timeRange.length() - hyphen -1 )) &&
-          IsValidTime( timeRange.substr( hyphen + 1 )                     ))
-        return OFTrue;
-    }
-  }
-  else
-  {
-    // if there is no hyphen, there is just one date value which has to be checked for validity
-    return IsValidTime( timeRange );
-  }
-  return OFFalse;
-}
-
-// ----------------------------------------------------------------------------
-
-OFBool WlmDataSource::IsValidTime( const OFString& value )
-// Date         : March 19, 2002
-// Author       : Thomas Wilkens
-// Task         : This function checks if the given time value is valid.
-//                According to the 2001 DICOM standard, part 5, Table 6.2-1, a time
-//                value is either in format "hhmmss.fracxx" or "hh:mm:ss.fracxx" where
-//                 - hh represents the hour (0-23)
-//                 - mm represents the minutes (0-59)
-//                 - ss represents the seconds (0-59)
-//                 - fracxx represents the fraction of a second in millionths of seconds (000000-999999)
-//                Note that one or more of the components mm, ss, or fracxx may be missing as
-//                long as every component to the right of a missing component is also missing.
-//                If fracxx is missing, the "." character in front of fracxx is also missing.
-// Parameters   : value - [in] The value which shall be checked.
-// Return Value : OFTrue  - Time is valid.
-//                OFFalse - Time is not valid.
-{
-  int hour=0, min=0, sec=0, frac=0, fieldsRead=0;
-  // create new string without leading or trailing blanks
-  OFString timevalue = DeleteLeadingAndTrailingBlanks( value );
-
-  // check if string is empty now
-  if( timevalue.empty() )
-    return( OFFalse );
-
-  // check if only allowed characters occur in the string
-  if( !ContainsOnlyValidCharacters( timevalue.c_str(), "0123456789.:" ) )
-    return( OFFalse );
-
-  // check which of the two formats applies to the given string
-  size_t colon = timevalue.find(':');
-  if( colon != OFString_npos )
-  {
-    // time format is "hh:mm:ss.fracxx"
-
-    // check which components are missing
-    if( timevalue.length() == 5 )
-    {
-      // scan given time string "hh:mm"
-      fieldsRead = sscanf( timevalue.c_str(), "%2d:%2d", &hour, &min );
-      if( fieldsRead == 2 && hour >= 0 && hour <= 23 && min >= 0 && min <= 59 )
-        return OFTrue;
-    }
-    else if( timevalue.length() == 8 )
-    {
-      // scan given time string "hh:mm:ss"
-      fieldsRead = sscanf( timevalue.c_str(), "%2d:%2d:%2d", &hour, &min, &sec );
-      if( fieldsRead == 3 && hour >= 0 && hour <= 23 && min >= 0 && min <= 59 && sec >= 0 && sec <= 59 )
-        return OFTrue;
-    }
-    else if( timevalue.length() > 8 && timevalue.length() < 16 )
-    {
-      // scan given time string "hh:mm:ss.fracxx"
-      fieldsRead = sscanf( timevalue.c_str(), "%2d:%2d:%2d.%6d", &hour, &min, &sec, &frac );
-      if( fieldsRead == 4 && hour >= 0 && hour <= 23 && min >= 0 && min <= 59 && sec >= 0 && sec <= 59 && frac >= 0 && frac <= 999999 )
-        return OFTrue;
-    }
-  }
-  else
-  {
-    // time format is "hhmmss.fracxx"
-
-    // check which components are missing
-    if( timevalue.length() == 4 )
-    {
-      // scan given time string "hhmm"
-      fieldsRead = sscanf( timevalue.c_str(), "%2d%2d", &hour, &min );
-      if( fieldsRead == 2 && hour >= 0 && hour <= 23 && min >= 0 && min <= 59 )
-        return OFTrue;
-    }
-    else if( timevalue.length() == 6 )
-    {
-      // scan given time string "hhmmss"
-      fieldsRead = sscanf( timevalue.c_str(), "%2d%2d%2d", &hour, &min, &sec );
-      if( fieldsRead == 3 && hour >= 0 && hour <= 23 && min >= 0 && min <= 59 && sec >= 0 && sec <= 59 )
-        return OFTrue;
-    }
-    else if( timevalue.length() > 6 && timevalue.length() < 14 )
-    {
-      // scan given time string "hhmmss.fracxx"
-      fieldsRead = sscanf( timevalue.c_str(), "%2d%2d%2d.%6d", &hour, &min, &sec, &frac );
-      if( fieldsRead == 4 && hour >= 0 && hour <= 23 && min >= 0 && min <= 59 && sec >= 0 && sec <= 59 && frac >= 0 && frac <= 999999 )
-        return OFTrue;
-    }
-  }
-
- return OFFalse;
-}
-
-// ----------------------------------------------------------------------------
-
 OFBool WlmDataSource::ContainsOnlyValidCharacters( const char *s, const char *charset )
 // Date         : December 10, 2001
 // Author       : Thomas Wilkens
index 0fa71c3b3048405d0d1470c0cb3b7cbe9a153589..31fb184994c4ed2b7a80ddf25f959fe1135110af 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2017, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -285,7 +285,7 @@ WlmDataSourceStatusType WlmDataSourceFileSystem::StartFindRequest( const DcmData
 
   // This member variable indicates if we encountered an unsupported
   // optional key attribute in the search mask; initialize it with false.
-  // It might be updated whithin CheckSearchMask().
+  // It might be updated within CheckSearchMask().
   foundUnsupportedOptionalKey = OFFalse;
 
   // Scrutinize the search mask.
@@ -380,7 +380,7 @@ WlmDataSourceStatusType WlmDataSourceFileSystem::StartFindRequest( const DcmData
         {
           cond = resultRecord->putAndInsertString( DCM_SpecificCharacterSet, "ISO_IR 100" );
         }
-        // third option: use charactet set from worklist file
+        // third option: use character set from worklist file
         else if( returnedCharacterSet == RETURN_CHARACTER_SET_FROM_FILE )
         {
           char *value = NULL;
@@ -423,10 +423,10 @@ DcmDataset *WlmDataSourceFileSystem::NextFindResponse( WlmDataSourceStatusType &
 // Date         : July 11, 2002
 // Author       : Thomas Wilkens
 // Task         : This function will return the next dataset that matches the given search mask, if
-//                there is one more resulting dataset to return. In such a case, rstatus will be set
+//                there is one more resulting dataset to return. In such a case, rStatus will be set
 //                to WLM_PENDING or WLM_PENDING_WARNING, depending on if an unsupported key attribute
 //                was encountered in the search mask or not. If there are no more datasets that match
-//                the search mask, this function will return an empty dataset and WLM_SUCCESS in rstatus.
+//                the search mask, this function will return an empty dataset and WLM_SUCCESS in rStatus.
 // Parameters   : rStatus - [out] A value of type WlmDataSourceStatusType that can be used to
 //                          decide if there are still elements that have to be returned.
 // Return Value : The next dataset that matches the given search mask, or an empty dataset if
@@ -667,7 +667,7 @@ OFBool WlmDataSourceFileSystem::SetReadlock()
     lockname += PATH_SEPARATOR;
 
   // append calledApplicationEntityTitle, another PATH_SEPERATOR,
-  // and LOCKFILENAME to the given path (and seperator)
+  // and LOCKFILENAME to the given path (and separator)
   lockname += calledApplicationEntityTitle;
   lockname += PATH_SEPARATOR;
   lockname += LOCKFILENAME;
index 540c15403c091ec64af9341d2a75d37f525991f6..5ce8f9c8da502625e4287c7f46a3dd4d5f60116a 100644 (file)
@@ -13,7 +13,7 @@
  *
  *  Module:  dcmwlm
  *
- *  Author:  Thomas Wilkens
+ *  Author:  Thomas Wilkens, Jan Schlamelcher
  *
  *  Purpose: Class for managing file system interaction.
  *
 
 #include "dcmtk/config/osconfig.h"
 
-#define INCLUDE_CLIMITS
-#include "dcmtk/ofstd/ofstdinc.h"
-
-BEGIN_EXTERN_C
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_FILE_H
-#include <sys/file.h>  // for struct DIR, opendir()
-#endif
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>    // for struct DIR, opendir()
-#endif
-END_EXTERN_C
-
 #include "dcmtk/dcmnet/diutil.h"
 #include "dcmtk/ofstd/ofconsol.h"
 #include "dcmtk/ofstd/ofstd.h"
 #include "dcmtk/ofstd/ofdate.h"
 #include "dcmtk/ofstd/oftime.h"
 #include "dcmtk/ofstd/oftypes.h"
+#include "dcmtk/ofstd/offilsys.h"
 #include "dcmtk/dcmnet/dicom.h"
 #include "dcmtk/dcmdata/dcdatset.h"
 #include "dcmtk/dcmdata/dcitem.h"
@@ -98,15 +84,12 @@ const WlmFileSystemInteractionManager::MatchingKeys WlmFileSystemInteractionMana
 // ----------------------------------------------------------------------------
 
 WlmFileSystemInteractionManager::WlmFileSystemInteractionManager()
-// Date         : July 11, 2002
-// Author       : Thomas Wilkens
-// Task         : Constructor.
-// Parameters   : none.
-// Return Value : none.
-  : dfPath( "" ),
-    enableRejectionOfIncompleteWlFiles( OFTrue ), calledApplicationEntityTitle( "" ),
-    matchingRecords( NULL ), numOfMatchingRecords( 0 )
+: dfPath()
+, enableRejectionOfIncompleteWlFiles( OFTrue )
+, calledApplicationEntityTitle()
+, matchingRecords()
 {
+
 }
 
 // ----------------------------------------------------------------------------
@@ -201,92 +184,62 @@ OFBool WlmFileSystemInteractionManager::IsCalledApplicationEntityTitleSupported(
 
 // ----------------------------------------------------------------------------
 
-unsigned long WlmFileSystemInteractionManager::DetermineMatchingRecords( DcmDataset *searchMask )
-// Date         : July 11, 2002
-// Author       : Thomas Wilkens
-// Task         : This function determines the records from the worklist files which match
-//                the given search mask and returns the number of matching records. Also,
-//                this function will store the matching records in memory in the array
-//                member variable matchingRecords.
-// Parameters   : searchMask - [in] The search mask.
-// Return Value : Number of matching records.
+size_t WlmFileSystemInteractionManager::DetermineMatchingRecords( DcmDataset* searchMask )
 {
-  OFVector<OFString> worklistFiles;
-
-  // initialize member variables
-  matchingRecords = NULL;
-  numOfMatchingRecords = 0;
+    assert( searchMask );
+    matchingRecords.clear();
+    OFdirectory_iterator it( dfPath / calledApplicationEntityTitle );
+    if( FindNextWorklistFile( it ) != OFdirectory_iterator() )
+    {
+        MatchWorklistFile( *searchMask, *it );
+        while( FindNextWorklistFile( ++it ) != OFdirectory_iterator() )
+            MatchWorklistFile( *searchMask, *it );
+    }
+    else DCMWLM_INFO( "<no files found>" );
+    return matchingRecords.size();
+}
 
-  // determine all worklist files
-  DetermineWorklistFiles( worklistFiles );
+// ----------------------------------------------------------------------------
 
-  // go through all worklist files
-  for( unsigned int i=0 ; i<worklistFiles.size() ; i++ )
-  {
+void WlmFileSystemInteractionManager::MatchWorklistFile( DcmDataset& searchMask,
+                                                         const OFpath& worklistFile )
+{
     // read information from worklist file
-    DcmFileFormat fileform;
-    if (fileform.loadFile(worklistFiles[i].c_str()).bad())
+    DcmFileFormat file;
+    OFCondition status = file.loadFile( worklistFile );
+    if( status.bad() )
     {
-      DCMWLM_WARN("Could not read worklist file " << worklistFiles[i] << " properly, file will be ignored");
+      DCMWLM_WARN("Could not read worklist file " << worklistFile << ", file will be ignored: " << status.text());
+      return;
     }
-    else
+    // extract the data set from worklist file, if any
+    // storing it into an OFshared_ptr ensures it will be freed in the end not matter what
+    if( OFshared_ptr<DcmDataset> pDataset = OFshared_ptr<DcmDataset>( file.getAndRemoveDataset() ) )
     {
-      // determine the data set which is contained in the worklist file
-      DcmDataset *dataset = fileform.getDataset();
-      if( dataset == NULL )
-      {
-        DCMWLM_WARN("Worklist file " << worklistFiles[i] << " is empty, file will be ignored");
-      }
-      else
-      {
         if( enableRejectionOfIncompleteWlFiles )
-          DCMWLM_INFO("Checking whether worklist file " << worklistFiles[i] << " is complete");
-        // in case option --enable-file-reject is set, we have to check if the current
-        // .wl-file meets certain conditions; in detail, the file's dataset has to be
-        // checked whether it contains all necessary return type 1 attributes and contains
-        // information in all these attributes; if this is condition is not met, the
-        // .wl-file shall be rejected
-        if( enableRejectionOfIncompleteWlFiles && !DatasetIsComplete( dataset ) )
-        {
-          DCMWLM_WARN("Worklist file " << worklistFiles[i] << " is incomplete, file will be ignored");
-        }
-        else
         {
-          // check if the current dataset matches the matching key attribute values
-          if( !DatasetMatchesSearchMask( dataset, searchMask, MatchingKeys::root ) )
-          {
-            DCMWLM_INFO("Information from worklist file " << worklistFiles[i] << " does not match query");
-          }
-          else
-          {
-            DCMWLM_INFO("Information from worklist file " << worklistFiles[i] << " matches query");
-
-            // since the dataset matches the matching key attribute values
-            // we need to insert it into the matchingRecords array
-            if( numOfMatchingRecords == 0 )
-            {
-              matchingRecords = new DcmDataset*[1];
-              matchingRecords[0] = new DcmDataset( *dataset );
-            }
-            else
+            DCMWLM_INFO("Checking whether worklist file " << worklistFile << " is complete");
+            // in case option --enable-file-reject is set, we have to check if the current
+            // .wl-file meets certain conditions; in detail, the file's dataset has to be
+            // checked whether it contains all necessary return type 1 attributes and contains
+            // information in all these attributes; if this is condition is not met, the
+            // .wl-file shall be rejected
+            if( !DatasetIsComplete( pDataset.get() ) )
             {
-              DcmDataset **tmp = new DcmDataset*[numOfMatchingRecords + 1];
-              for( unsigned long j=0 ; j<numOfMatchingRecords ; j++ )
-                tmp[j] = matchingRecords[j];
-              tmp[numOfMatchingRecords] = new DcmDataset( *dataset );
-              delete[] matchingRecords;
-              matchingRecords = tmp;
+                DCMWLM_WARN("Worklist file " << worklistFile << " is incomplete, file will be ignored");
+                return;
             }
-
-            numOfMatchingRecords++;
-          }
         }
-      }
+        // check if the current dataset matches the matching key attribute values
+        if( DatasetMatchesSearchMask( *pDataset, searchMask, MatchingKeys::root ) )
+        {
+            DCMWLM_INFO("Information from worklist file " << worklistFile << " matches query");
+            // insert the matching dataset into matchingRecords
+            matchingRecords.push_back( pDataset );
+        }
+        else DCMWLM_INFO("Information from worklist file " << worklistFile << " does not match query");
     }
-  }
-
-  // return result
-  return( numOfMatchingRecords );
+    else DCMWLM_WARN("Worklist file " << worklistFile << " is empty, file will be ignored");
 }
 
 // ----------------------------------------------------------------------------
@@ -370,6 +323,7 @@ void WlmFileSystemInteractionManager::GetAttributeValueForMatchingRecord( DcmTag
   unsigned long i;
   const char *val = NULL;
   Uint16 v;
+  size_t len = 0;
 
   // if the element in question is not contained in another sequence
   if( numOfSuperiorSequences == 0 )
@@ -384,13 +338,15 @@ void WlmFileSystemInteractionManager::GetAttributeValueForMatchingRecord( DcmTag
       cond = matchingRecords[idx]->findAndGetUint16( tag, v, 0, OFFalse );
       if( cond.good() )
       {
-        value = new char[20];
+        len = 20;
+        value = new char[len];
         sprintf( value, "%u", v );
       }
       else
       {
-        value = new char[ 2 ];
-        strcpy( value, "4" );           // a value of "4" in attribute PregnancyStatus means "unknown" in DICOM
+        len = 2;
+        value = new char[len];
+        OFStandard::strlcpy( value, "4", len );           // a value of "4" in attribute PregnancyStatus means "unknown" in DICOM
       }
     }
     else
@@ -398,13 +354,15 @@ void WlmFileSystemInteractionManager::GetAttributeValueForMatchingRecord( DcmTag
       cond = matchingRecords[idx]->findAndGetString( tag, val, OFFalse );
       if( cond.good() && val != NULL )
       {
-        value = new char[ strlen( val ) + 1 ];
-        strcpy( value, val );
+        len = strlen( val ) + 1;
+        value = new char[len];
+        OFStandard::strlcpy( value, val, len );
       }
       else
       {
-        value = new char[ 1 ];
-        strcpy( value, "" );
+        len = 1;
+        value = new char[len];
+        OFStandard::strlcpy( value, "", len );
       }
     }
   }
@@ -427,19 +385,22 @@ void WlmFileSystemInteractionManager::GetAttributeValueForMatchingRecord( DcmTag
       cond = sequenceElement->getItem( superiorSequenceArray[ numOfSuperiorSequences - 1 ].currentItem )->findAndGetString( tag, val, OFFalse );
       if( cond.good() && val != NULL )
       {
-        value = new char[ strlen( val ) + 1 ];
-        strcpy( value, val );
+        len = strlen( val ) + 1;
+        value = new char[len];
+        OFStandard::strlcpy( value, val, len );
       }
       else
       {
-        value = new char[ 1 ];
-        strcpy( value, "" );
+        len = 1;
+        value = new char[len];
+        OFStandard::strlcpy( value, "", len );
       }
     }
     else
     {
-      value = new char[ 1 ];
-      strcpy( value, "" );
+      len = 1;
+      value = new char[len];
+      OFStandard::strlcpy( value, "", len );
     }
   }
 }
@@ -447,151 +408,16 @@ void WlmFileSystemInteractionManager::GetAttributeValueForMatchingRecord( DcmTag
 // ----------------------------------------------------------------------------
 
 void WlmFileSystemInteractionManager::ClearMatchingRecords()
-// Date         : July 11, 2002
-// Author       : Thomas Wilkens
-// Task         : This function frees the memory which was occupied by matchingRecords.
-//                It shall be called when the matching records are no longer needed.
-// Parameters   : none.
-// Return Value : none.
-{
-  for( unsigned int i=0 ; i<numOfMatchingRecords ; i++ )
-    delete matchingRecords[i];
-  delete[] matchingRecords;
-  matchingRecords = NULL;
-  numOfMatchingRecords = 0;
-}
-
-// ----------------------------------------------------------------------------
-
-void WlmFileSystemInteractionManager::DetermineWorklistFiles( OFVector<OFString> &worklistFiles )
-// Date         : July 11, 2002
-// Author       : Thomas Wilkens
-// Task         : This function determines all worklist files in the directory specified by
-//                dfPath and calledApplicationEntityTitle, and returns the complete path and
-//                filename information in an array of strings.
-// Parameters   : worklistFiles - [out] Set of strings, each specifying path and filename
-//                                      to one worklist file.
-// Return Value : none.
 {
-  // initialize out parameters
-  worklistFiles.clear();
-
-  // determine complete path to data source files
-  // (dfPath + PATH_SEPARATOR + calledApplicationEntityTitle)
-  OFString path( dfPath );
-  if( !path.empty() && path[path.length()-1] != PATH_SEPARATOR )
-    path += PATH_SEPARATOR;
-  path += calledApplicationEntityTitle;
-
-  // determine worklist files in this folder
-#ifdef HAVE__FINDFIRST
-  OFString searchname = path + PATH_SEPARATOR + '*';
-  struct _finddata_t fileData;
-  int ret = 0;
-
-  // start a loop; in each iteration another directory entry is determined
-  intptr_t hFile = _findfirst( (char*)searchname.c_str(), &fileData );
-  while( hFile != -1L && ret == 0 )
-  {
-    // if the current entry refers to a worklist file, do something
-    if( strcmp( fileData.name, "." )  !=0 && strcmp( fileData.name, ".." ) !=0 && IsWorklistFile( fileData.name ) )
-    {
-      // Create a string that contains path and filename of the current worklist file.
-      OFString subname( path );
-      subname += PATH_SEPARATOR;
-      subname += fileData.name;
-
-      // Add string to the set of strings
-      worklistFiles.push_back( subname );
-    }
-    ret = _findnext( hFile, &fileData );
-  }
-  _findclose( hFile );
-#else
-  struct dirent *dp = NULL;
-
-  // open directory
-  DIR *dirp = opendir( path.c_str() );
-  if( dirp != NULL )
-  {
-    // start a loop; in each iteration another directory entry is determined.
-#ifdef HAVE_READDIR_R
-    unsigned char entryBuffer[sizeof(struct dirent) + _POSIX_PATH_MAX + 1];
-#ifdef HAVE_OLD_READDIR_R
-    for( dp = readdir_r( dirp, (struct dirent *)entryBuffer ) ; dp != NULL ; dp = readdir_r( dirp, (struct dirent *)entryBuffer ) )
-#else
-    for( int readResult = readdir_r( dirp, (struct dirent *)entryBuffer, &dp ) ; readResult == 0 && dp ; readResult = readdir_r( dirp, (struct dirent *)entryBuffer, &dp ) )
-#endif
-#else // HAVE_READDIR_R
-    for( dp = readdir( dirp ) ; dp != NULL ; dp = readdir( dirp ) )
-#endif
-    {
-      // if the current entry refers to a worklist file
-      if( IsWorklistFile( dp->d_name ) )
-      {
-        // create a string that contains path and filename of the current worklist file.
-        OFString subname( path );
-        subname += PATH_SEPARATOR;
-        subname += dp->d_name;
-
-        // add string to the set of strings
-        worklistFiles.push_back( subname );
-      }
-    }
-
-    // close directory
-    closedir( dirp );
-  }
-#endif
-
-  // in case we are running in verbose mode, dump all worklist file information
-  if (DCM_dcmwlmLogger.isEnabledFor(OFLogger::INFO_LOG_LEVEL))
-  {
-    DCMWLM_INFO("=============================");
-    DCMWLM_INFO("Worklist Database Files:");
-    if( worklistFiles.empty() )
-      DCMWLM_INFO("<no files found>");
-    else
-    {
-      OFVector<OFString>::const_iterator iter = worklistFiles.begin();
-      while( iter != worklistFiles.end() )
-      {
-        DCMWLM_INFO(*iter);
-        ++iter;
-      }
-    }
-    DCMWLM_INFO("=============================");
-  }
+    matchingRecords.clear();
 }
 
 // ----------------------------------------------------------------------------
 
-OFBool WlmFileSystemInteractionManager::IsWorklistFile( const char *fname )
-// Date         : July 11, 2002
-// Author       : Thomas Wilkens
-// Task         : This function returns OFTrue if the given filename refers to a worklist file,
-//                i.e. has an extension of ".wl".
-// Parameters   : fname - [in] The name of the file.
-// Return Value : OFTrue  - The given filename refers to a worklist file.
-//                OFFalse - The given filename does not refer to a worklist file.
+OFdirectory_iterator& WlmFileSystemInteractionManager::FindNextWorklistFile( OFdirectory_iterator& it )
 {
-  // If no filename is specified, return OFFalse
-  if( fname == NULL )
-    return( OFFalse );
-
-  // look for an '.' in the filename
-  char *s = (char *)strrchr( fname, '.' );
-
-  // if there was no '.' return OFFalse
-  if( s == NULL )
-    return( OFFalse );
-
-  // if the extension is ".wl" return OFTrue
-  if( strcmp( s, ".wl" ) == 0 )
-    return( OFTrue );
-
-  // return OFFalse in all other cases
-  return( OFFalse );
+    for( ; it != OFdirectory_iterator() && ".wl" != it->path().extension(); ++it );
+    return it;
 }
 
 // ----------------------------------------------------------------------------
@@ -829,10 +655,10 @@ OFBool WlmFileSystemInteractionManager::AttributeIsAbsentOrEmpty( DcmTagKey elem
 }
 
 
-OFBool WlmFileSystemInteractionManager::isUniversalMatchingSequences( DcmSequenceOfItems& query,
-                                                                      const MatchingKeys& matchingKeys,
-                                                                      const OFBool normalize,
-                                                                      const OFBool enableWildcardMatching )
+OFBool WlmFileSystemInteractionManager::IsUniversalMatch( DcmSequenceOfItems& query,
+                                                          const MatchingKeys& matchingKeys,
+                                                          const OFBool normalize,
+                                                          const OFBool normalizeWildCards )
 {
   DcmItem* pQueryItem = OFstatic_cast( DcmItem*, query.nextInContainer( OFnullptr ) );
   if( pQueryItem ) {
@@ -846,7 +672,7 @@ OFBool WlmFileSystemInteractionManager::isUniversalMatchingSequences( DcmSequenc
         const OFPair<DcmTagKey,OFBool>& key = *it;
 #endif
         DcmElement* query = OFnullptr;
-        if( pQueryItem->findAndGetElement( key.first, query, OFFalse ).good() && query && !query->isUniversalMatch( normalize, enableWildcardMatching ) )
+        if( pQueryItem->findAndGetElement( key.first, query, OFFalse ).good() && query && !query->isUniversalMatch( normalize, normalizeWildCards && key.second ) )
           return OFFalse;
       }
 
@@ -860,9 +686,9 @@ OFBool WlmFileSystemInteractionManager::isUniversalMatchingSequences( DcmSequenc
         const OFPair<DcmTagKey,DcmTagKey>& combinedKey = *it;
 #endif
         DcmElement* query = OFnullptr;
-        if( pQueryItem->findAndGetElement( combinedKey.first, query, OFFalse ).good() && query && !query->isUniversalMatch( normalize, enableWildcardMatching ) )
+        if( pQueryItem->findAndGetElement( combinedKey.first, query, OFFalse ).good() && query && !query->isUniversalMatch( normalize, normalizeWildCards ) )
           return OFFalse;
-        else if( pQueryItem->findAndGetElement( combinedKey.second, query, OFFalse ).good() && query && !query->isUniversalMatch( normalize, enableWildcardMatching ) )
+        else if( pQueryItem->findAndGetElement( combinedKey.second, query, OFFalse ).good() && query && !query->isUniversalMatch( normalize, normalizeWildCards ) )
           return OFFalse;
       }
 
@@ -877,7 +703,7 @@ OFBool WlmFileSystemInteractionManager::isUniversalMatchingSequences( DcmSequenc
         const OFPair<DcmTagKey,MatchingKeys>& sequenceKey = *it;
 #endif
         DcmElement* query = OFnullptr;
-        if( pQueryItem->findAndGetElement( sequenceKey.first, query, OFFalse ).good() && query && query->ident() == EVR_SQ && !isUniversalMatchingSequences( OFstatic_cast( DcmSequenceOfItems&, *query ), sequenceKey.second, normalize, enableWildcardMatching ) )
+        if( pQueryItem->findAndGetElement( sequenceKey.first, query, OFFalse ).good() && query && query->ident() == EVR_SQ && !IsUniversalMatch( OFstatic_cast( DcmSequenceOfItems&, *query ), sequenceKey.second, normalize, normalizeWildCards ) )
           return OFFalse;
       }
   }
@@ -890,27 +716,16 @@ OFBool WlmFileSystemInteractionManager::MatchSequences( DcmSequenceOfItems& cand
 {
   for( DcmObject* pQueryItem = query.nextInContainer( OFnullptr); pQueryItem; pQueryItem = query.nextInContainer( pQueryItem ) )
     for( DcmObject* pCandidateItem = candidate.nextInContainer( OFnullptr); pCandidateItem; pCandidateItem = candidate.nextInContainer( pCandidateItem ) )
-      if( DatasetMatchesSearchMask( OFstatic_cast( DcmItem*, pCandidateItem ), OFstatic_cast( DcmItem*, pQueryItem ), matchingKeys ) )
+      if( DatasetMatchesSearchMask( *OFstatic_cast( DcmItem*, pCandidateItem ), *OFstatic_cast( DcmItem*, pQueryItem ), matchingKeys ) )
         return OFTrue;
   return OFFalse;
 }
 
 // ----------------------------------------------------------------------------
 
-OFBool WlmFileSystemInteractionManager::DatasetMatchesSearchMask( DcmItem *dataset, DcmItem *searchMask,
+OFBool WlmFileSystemInteractionManager::DatasetMatchesSearchMask( DcmItem& dataset, DcmItem& searchMask,
                                                                   const MatchingKeys& matchingKeys )
-// Date         : July 11, 2002
-// Author       : Thomas Wilkens
-// Task         : This function returns OFTrue, if the matching key attribute values in the
-//                dataset match the matching key attribute values in the search mask.
-// Parameters   : dataset    - [in] The dataset which shall be checked.
-//                searchMask - [in] The search mask.
-// Return Value : OFTrue  - The dataset matches the search mask in the matching key attribute values.
-//                OFFalse - The dataset does not match the search mask in the matching key attribute values.
 {
-  assert( dataset );
-  assert( searchMask );
-
 #ifdef HAVE_CXX11
   for( auto& key : matchingKeys.keys )
   {
@@ -921,10 +736,10 @@ OFBool WlmFileSystemInteractionManager::DatasetMatchesSearchMask( DcmItem *datas
     const OFPair<DcmTagKey,OFBool>& key = *it;
 #endif
     DcmElement* query = OFnullptr;
-    if( searchMask->findAndGetElement( key.first, query, OFFalse ).good() && query && !query->isUniversalMatch() )
+    if( searchMask.findAndGetElement( key.first, query, OFFalse ).good() && query && !query->isUniversalMatch() )
     {
       DcmElement* candidate = OFnullptr;
-      if( dataset->findAndGetElement( key.first, candidate, OFFalse ).bad() || !candidate || !query->matches( *candidate, key.second ) )
+      if( dataset.findAndGetElement( key.first, candidate, OFFalse ).bad() || !candidate || !query->matches( *candidate, key.second ) )
         return OFFalse;
     }
   }
@@ -939,16 +754,16 @@ OFBool WlmFileSystemInteractionManager::DatasetMatchesSearchMask( DcmItem *datas
     const OFPair<DcmTagKey,DcmTagKey>& combinedKey = *it;
 #endif
     DcmElement* query = OFnullptr;
-    if( searchMask->findAndGetElement( combinedKey.first, query, OFFalse ).good() && query && !query->isUniversalMatch() )
+    if( searchMask.findAndGetElement( combinedKey.first, query, OFFalse ).good() && query && !query->isUniversalMatch() )
     {
       DcmElement* candidate = OFnullptr;
-      if( dataset->findAndGetElement( combinedKey.first, candidate, OFFalse ).bad() || !candidate )
+      if( dataset.findAndGetElement( combinedKey.first, candidate, OFFalse ).bad() || !candidate )
         return OFFalse;
       DcmElement* secondQuery = OFnullptr;
-      if( searchMask->findAndGetElement( combinedKey.second, secondQuery, OFFalse ).good() && secondQuery )
+      if( searchMask.findAndGetElement( combinedKey.second, secondQuery, OFFalse ).good() && secondQuery && !secondQuery->isUniversalMatch() )
       {
         DcmElement* secondCandidate = OFnullptr;
-        if( dataset->findAndGetElement( combinedKey.second, secondCandidate, OFFalse ).bad() || !secondCandidate || !query->combinationMatches( *secondQuery, *candidate, *secondCandidate ) )
+        if( dataset.findAndGetElement( combinedKey.second, secondCandidate, OFFalse ).bad() || !secondCandidate || !query->combinationMatches( *secondQuery, *candidate, *secondCandidate ) )
             return OFFalse;
       }
       else if( !query->matches( *candidate ) )
@@ -956,10 +771,10 @@ OFBool WlmFileSystemInteractionManager::DatasetMatchesSearchMask( DcmItem *datas
         return OFFalse;
       }
     }
-    else if( searchMask->findAndGetElement( combinedKey.second, query, OFFalse ).good() && query && !query->isUniversalMatch() )
+    else if( searchMask.findAndGetElement( combinedKey.second, query, OFFalse ).good() && query && !query->isUniversalMatch() )
     {
       DcmElement* candidate = OFnullptr;
-      if( dataset->findAndGetElement( combinedKey.second, candidate, OFFalse ).bad() || !candidate || !query->matches( *candidate ) )
+      if( dataset.findAndGetElement( combinedKey.second, candidate, OFFalse ).bad() || !candidate || !query->matches( *candidate ) )
         return OFFalse;
     }
   }
@@ -976,10 +791,10 @@ OFBool WlmFileSystemInteractionManager::DatasetMatchesSearchMask( DcmItem *datas
     const OFPair<DcmTagKey,MatchingKeys>& sequenceKey = *it;
 #endif
     DcmElement* query = OFnullptr;
-    if( searchMask->findAndGetElement( sequenceKey.first, query, OFFalse ).good() && query && query->ident() == EVR_SQ && !isUniversalMatchingSequences( OFstatic_cast( DcmSequenceOfItems&, *query ), sequenceKey.second ) )
+    if( searchMask.findAndGetElement( sequenceKey.first, query, OFFalse ).good() && query && query->ident() == EVR_SQ && !IsUniversalMatch( OFstatic_cast( DcmSequenceOfItems&, *query ), sequenceKey.second ) )
     {
       DcmElement* candidate = OFnullptr;
-      if( dataset->findAndGetElement( sequenceKey.first, candidate, OFFalse ).bad() || !candidate || candidate->ident() != EVR_SQ || !MatchSequences( OFstatic_cast( DcmSequenceOfItems&, *candidate ), OFstatic_cast( DcmSequenceOfItems&, *query ), sequenceKey.second ) )
+      if( dataset.findAndGetElement( sequenceKey.first, candidate, OFFalse ).bad() || !candidate || candidate->ident() != EVR_SQ || !MatchSequences( OFstatic_cast( DcmSequenceOfItems&, *candidate ), OFstatic_cast( DcmSequenceOfItems&, *query ), sequenceKey.second ) )
         return OFFalse;
     }
   }
index 7e90a3f8fb7c7d4701d1f1732a4f4fc6cf9d9514..05aa1acffa14e59d2fc013e1b5244035d859c68b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1996-2017, OFFIS e.V.
+ *  Copyright (C) 1996-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -130,10 +130,12 @@ WlmActivityManager::WlmActivityManager(
 {
   // initialize supported abstract transfer syntaxes.
   supportedAbstractSyntaxes = new char*[2];
-  supportedAbstractSyntaxes[0] = new char[ strlen( UID_VerificationSOPClass ) + 1 ];
-  strcpy( supportedAbstractSyntaxes[0], UID_VerificationSOPClass );
-  supportedAbstractSyntaxes[1] = new char[ strlen( UID_FINDModalityWorklistInformationModel ) + 1 ];
-  strcpy( supportedAbstractSyntaxes[1], UID_FINDModalityWorklistInformationModel );
+  size_t buflen = strlen( UID_VerificationSOPClass ) + 1;
+  supportedAbstractSyntaxes[0] = new char[buflen];
+  OFStandard::strlcpy( supportedAbstractSyntaxes[0], UID_VerificationSOPClass, buflen );
+  buflen = strlen( UID_FINDModalityWorklistInformationModel ) + 1;
+  supportedAbstractSyntaxes[1] = new char[buflen];
+  OFStandard::strlcpy( supportedAbstractSyntaxes[1], UID_FINDModalityWorklistInformationModel, buflen );
   numberOfSupportedAbstractSyntaxes = 2;
 
   // make sure not to let dcmdata remove trailing blank padding or perform other
@@ -228,7 +230,7 @@ OFCondition WlmActivityManager::StartProvidingService()
     cond = WaitForAssociation( net );
 
     // Clean up any child processes if the execution is not limited to a single process.
-    // (On windows platform, childs are not handled via the process table,
+    // (On windows platform, children are not handled via the process table,
     // so there's no need to clean up children)
 #ifdef HAVE_FORK
     if( !opt_singleProcess )
@@ -385,7 +387,7 @@ OFCondition WlmActivityManager::WaitForAssociation( T_ASC_Network * net )
 
   // Condition 2: determine the application context name. If an error occurred or if the
   // application context name is not supported we want to refuse the association request.
-  cond = ASC_getApplicationContextName( assoc->params, buf );
+  cond = ASC_getApplicationContextName( assoc->params, buf, sizeof(buf) );
   if( cond.bad() || strcmp( buf, DICOM_STDAPPLICATIONCONTEXT ) != 0 )
   {
     RefuseAssociation( &assoc, WLM_BAD_APP_CONTEXT );
@@ -760,7 +762,7 @@ OFCondition WlmActivityManager::HandleFindSCP( T_ASC_Association *assoc, T_DIMSE
   WlmFindContextType context;
   context.dataSource = dataSource;
   context.priorStatus = WLM_PENDING;
-  ASC_getAPTitles( assoc->params, NULL, context.ourAETitle, NULL );
+  ASC_getAPTitles( assoc->params, NULL, 0, context.ourAETitle, sizeof(context.ourAETitle), NULL, 0);
   context.opt_sleepDuringFind = opt_sleepDuringFind;
 
   // Dump some information if required.
@@ -803,8 +805,8 @@ void WlmActivityManager::AddProcessToTable( int pid, T_ASC_Association *assoc )
   ps = new WlmProcessSlotType ();
 
   // Remember process information in the new item.
-  ASC_getPresentationAddresses( assoc->params, ps->peerName, NULL );
-  ASC_getAPTitles( assoc->params, ps->callingAETitle, ps->calledAETitle, NULL );
+  ASC_getPresentationAddresses( assoc->params, ps->peerName, sizeof(ps->peerName), NULL, 0 );
+  ASC_getAPTitles( assoc->params, ps->callingAETitle, sizeof(ps->callingAETitle), ps->calledAETitle, sizeof(ps->calledAETitle), NULL, 0);
   ps->processId = pid;
   ps->startTime = time(NULL);
   ps->hasStorageAbility = OFFalse;
@@ -890,7 +892,7 @@ void WlmActivityManager::CleanChildren()
     }
   }
 
-#elif HAVE_WAIT3                                              // PLATFORMS THAT HAVE wait3()
+#elif defined(HAVE_WAIT3)                                     // PLATFORMS THAT HAVE wait3()
 #if defined(__NeXT__)
   // some systems need a union wait as argument to wait3
   union wait status;
index 3adbdab149ec37cca53fd369aec832cf6e005c60..9edca162141ee54a0eb44cf7cdfd365976cbd1be 100644 (file)
@@ -44,12 +44,14 @@ wltest.o: wltest.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../oflog/include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/oflist.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
  ../../ofstd/include/dcmtk/ofstd/ofstd.h \
  ../../ofstd/include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../../ofstd/include/dcmtk/ofstd/oferror.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../../dcmdata/include/dcmtk/dcmdata/dcuid.h \
  ../../dcmnet/include/dcmtk/dcmnet/dul.h \
  ../../ofstd/include/dcmtk/ofstd/ofglobal.h \
diff --git a/docs/ANNOUNCE.363 b/docs/ANNOUNCE.363
new file mode 100644 (file)
index 0000000..3c38b34
--- /dev/null
@@ -0,0 +1,118 @@
+ANNOUNCEMENT
+
+Version 3.6.3 of the OFFIS DCMTK (DICOM ToolKit) software is now available for
+public release.  This is a minor release that includes the following changes
+over the previous version 3.6.2:
+
+- DCMTK 3.6.3 builds correctly on older and up-to-date versions of GNU gcc
+  (4.2.1 to 7.1.1) Clang (3.4.1 to 4.0.1),  Microsoft Visual Studio (2005 to
+  2017) and SunPro CC (5.14 and 5.15).
+
+- Tested with the following operating systems/environments:
+
+  - Android on arm64
+  - Cygwin on x86_64
+  - FreeBSD on x86_64
+  - Linux on x86_64 and x86
+  - MacOS X on x86_64
+  - NetBSD on x86_64
+  - OpenBSD on x86_64
+  - OpenIndiana on x86
+  - Solaris on x86
+  - Windows (and MinGW) on x86_64 and x86
+
+  For a complete list of tested systems and compilers, see the INSTALL file.
+
+- GNU Autoconf has been deprecated, running 'configure' will now emit a
+  warning by default.
+
+- Updated data dictionary, SOP Class and Transfer Syntax UIDs for the recently
+  approved changes to the DICOM standard (i.e. Supplements and CPs), up to DICOM
+  standard release DICOM 2017e.
+
+- Updated automatically generated classes in module "dcmrt" (Radiotherapy) and
+  "dcmsr" (Structured Reporting) based on DICOM 2017e.  Also updated the Code
+  definitions from the supported coding schemes such as DICOM, NCIt and UMLS.
+
+- Further enhanced DICOM Structured Reporting (SR) module "dcmsr":
+
+  - Added support for the Patient Radiation Dose SR IOD (Supplement 191).
+
+  - Added support for further sub-templates to the existing class for TID 1500
+    (Measurement Report), e.g. TID 300 (Measurement).
+
+  - Enhanced support for image entry descriptors in TID 1600 (Image Library),
+    e.g. by adding a new method that allows for moving common image entry
+    descriptors automatically to their respective image group.
+
+  - Added new method that allows for adding extra content items to extensible
+    SR templates.
+
+  - Further enhanced iterating an SR document tree, e.g. by providing a new
+    filter mechanism that allows for matching document tree nodes based on a
+    variety of properties like value type and concept name.
+
+  - Added another gotoNode() method to tree and cursor class, which searches for
+    a particular tree node by its value.
+
+  - Added "equal" and "not equal" comparison operators to all document tree node
+    and underlying value classes as well as to the wrapper class for "SR content
+    items".
+
+  - Updated mapping of the Defined Terms for Body Part Examined in the class
+    that implements CID 4031 (Common Anatomic Regions) based on DICOM 2017e.
+
+  - Many further improvements in order to stay up-to-date with development of
+    the DICOM standard and to make it easier to use this module and its classes.
+
+- Added options to findscu that extract the C-FIND response datasets to XML
+  files (either a single file with all responses or separate files for each
+  response, similar to the existing --extract option).
+
+- Added option --socket-timeout to echoscu (same as for e.g. storescu).
+
+- Consistently use the default value "MEDIUM" for Priority in all DIMSE request
+  messages, i.e. for C-STORE, C-FIND, C-GET and C-MOVE.
+
+- Fixed various issues that occurred after the official 3.6.2 release.
+
+
+Many people have contributed to this new release of DCMTK, appearing here in
+alphabetical order.  Thank you very much for your support!
+
+  Domen Soklic <domen.soklic@cosylab.com>
+  GwanYeong Kim <gy741.kim@gmail.com>
+  Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
+  Joerg Koenig <joerg.koenig@zeiss.com>
+  Michael Craggs <Michael.Craggs@ith-icoserve.com>
+  Peter Klotz <Peter.Klotz@ith-icoserve.com>
+
+  Helmut Steiner
+  Max Smolens
+  Martin Strunz
+  Sergei Khlutchin
+
+  Forum user "Hafiz Rafeeq"
+  Forum user "sfzhang"
+
+Members of the DCMTK Team who have worked on this release are
+(in alphabetical order):
+
+  Marco Eichelberg <eichelberg@offis.de>
+  Michael Onken <onken@open-connections.de>
+  Joerg Riesmeier <dicom@jriesmeier.com>
+  Jan Schlamelcher <schlamelcher@offis.de>
+
+Student associates:
+
+  Nikolas Goldhammer <nikolasgoldhammer@gmail.com>
+  Sebastian Grallert <Grallert.Sebastian@web.de>
+
+Also see CREDITS file for projects and companies who have been generously
+supporting DCMTK.
+
+The DCMTK software can be downloaded via:
+
+  http://dicom.offis.de/dcmtk or http://www.dcmtk.org/
+
+OFFIS e.V., Oldenburg, Germany, 2018-02-05
diff --git a/docs/CHANGES.364 b/docs/CHANGES.364
new file mode 100644 (file)
index 0000000..150f649
--- /dev/null
@@ -0,0 +1,3228 @@
+
+Release 3.6.4 (Public Minor Release - 2018-11-29)
+
+**** Changes from 2018.11.29 (schlamelcher)
+
+- Created CHANGES.364 for DCMTK release 3.6.4:
+  CHANGES.364 contains the Git commit history since DCMTK release 3.6.3.
+  Added:   docs/CHANGES.364
+
+- Updated man pages for DCMTK release 3.6.4.
+  Affects: doxygen/manpages/man1/cda2dcm.1
+           doxygen/manpages/man1/dcm2json.1
+           doxygen/manpages/man1/dcm2pdf.1
+           doxygen/manpages/man1/dcm2pnm.1
+           doxygen/manpages/man1/dcm2xml.1
+           doxygen/manpages/man1/dcmcjpeg.1
+           doxygen/manpages/man1/dcmcjpls.1
+           doxygen/manpages/man1/dcmconv.1
+           doxygen/manpages/man1/dcmcrle.1
+           doxygen/manpages/man1/dcmdjpeg.1
+           doxygen/manpages/man1/dcmdjpls.1
+           doxygen/manpages/man1/dcmdrle.1
+           doxygen/manpages/man1/dcmdspfn.1
+           doxygen/manpages/man1/dcmdump.1
+           doxygen/manpages/man1/dcmftest.1
+           doxygen/manpages/man1/dcmgpdir.1
+           doxygen/manpages/man1/dcmicmp.1
+           doxygen/manpages/man1/dcmj2pnm.1
+           doxygen/manpages/man1/dcml2pnm.1
+           doxygen/manpages/man1/dcmmkcrv.1
+           doxygen/manpages/man1/dcmmkdir.1
+           doxygen/manpages/man1/dcmmklut.1
+           doxygen/manpages/man1/dcmodify.1
+           doxygen/manpages/man1/dcmp2pgm.1
+           doxygen/manpages/man1/dcmprscp.1
+           doxygen/manpages/man1/dcmprscu.1
+           doxygen/manpages/man1/dcmpschk.1
+           doxygen/manpages/man1/dcmpsmk.1
+           doxygen/manpages/man1/dcmpsprt.1
+           doxygen/manpages/man1/dcmpsrcv.1
+           doxygen/manpages/man1/dcmpssnd.1
+           doxygen/manpages/man1/dcmqridx.1
+           doxygen/manpages/man1/dcmqrscp.1
+           doxygen/manpages/man1/dcmqrti.1
+           doxygen/manpages/man1/dcmquant.1
+           doxygen/manpages/man1/dcmrecv.1
+           doxygen/manpages/man1/dcmscale.1
+           doxygen/manpages/man1/dcmsend.1
+           doxygen/manpages/man1/dcmsign.1
+           doxygen/manpages/man1/dcod2lum.1
+           doxygen/manpages/man1/dconvlum.1
+           doxygen/manpages/man1/drtdump.1
+           doxygen/manpages/man1/dsr2html.1
+           doxygen/manpages/man1/dsr2xml.1
+           doxygen/manpages/man1/dsrdump.1
+           doxygen/manpages/man1/dump2dcm.1
+           doxygen/manpages/man1/echoscu.1
+           doxygen/manpages/man1/findscu.1
+           doxygen/manpages/man1/getscu.1
+           doxygen/manpages/man1/img2dcm.1
+           doxygen/manpages/man1/movescu.1
+           doxygen/manpages/man1/pdf2dcm.1
+           doxygen/manpages/man1/stl2dcm.1
+           doxygen/manpages/man1/storescp.1
+           doxygen/manpages/man1/storescu.1
+           doxygen/manpages/man1/termscu.1
+           doxygen/manpages/man1/wlmscpfs.1
+           doxygen/manpages/man1/xml2dcm.1
+           doxygen/manpages/man1/xml2dsr.1
+
+- Updated version information for DCMTK release 3.6.4.
+  Affects: CMake/dcmtkPrepare.cmake
+           VERSION
+
+- Updated ANNOUNCE and INSTALL for DCMTK release 3.6.4.
+  Affects: ANNOUNCE
+           INSTALL
+
+- Updated Autoconf config for upcoming release 3.6.4:
+  Updated version information.
+  Updated Makefile dependencies.
+  Affects: config/configure
+           config/configure.in
+           dcmwlm/libsrc/Makefile.dep
+
+**** Changes from 2018.11.28 (eichelberg)
+
+- Fixed buffer overflow in DcmRLEDecoder::decompress():
+  Fixed buffer overflow in DcmRLEDecoder::decompress() that can cause an
+  application crash (segmentation fault) when an RLE compressed image
+  with an invalid RLE offset table is decoded.
+  Thanks to Omar Ganiev <beched@deteact.com>, DeteAct Team,
+  Open Medical Infrastructure Security Project, for the bug report.
+  This closes DCMTK bug #858.
+  Affects: dcmdata/libsrc/dcrleccd.cc
+
+**** Changes from 2018.11.27 (schlamelcher)
+
+- Updated DIMSE compatibility flag:
+  Updated DIMSE compatibility flag to reflect recent changes in the networking
+  code. Windows now uses socklen_t as it originally should, due to the
+  respective configuration test having being fixed recently. This normally
+  should not affect the behavior of the network code (as socklen_t should
+  typically be defined to the type that was used before anyway), but better safe
+  than sorry.
+  Affects: dcmnet/include/dcmtk/dcmnet/dul.h
+
+**** Changes from 2018.11.23 (riesmeier)
+
+- Fixed various issues with syntax usage:
+  Fixed various issues with syntax usage of command line tools cda2dcm, pdf2dcm
+  and stl2dcm: typos, formatting, grouping, description, etc. Now, the --help
+  output and the manpages should be more consistent with all other DCMTK tools.
+  Affects: dcmdata/docs/cda2dcm.man
+           dcmdata/docs/pdf2dcm.man
+           dcmdata/docs/stl2dcm.man
+           dcmdata/libsrc/dcencdoc.cc
+
+**** Changes from 2018.11.23 (arizpegomez)
+
+- Removed stl2dcm support for ASCII STL files:
+  According to the DICOM standard, only binary stl files should be accepted,
+  therefore this commit removes support for ASCII stl files.
+  Affects: dcmdata/libsrc/dcencdoc.cc
+
+- Fixed formatting inconsistencies in stl2dcm --help.
+  Affects: dcmdata/docs/stl2dcm.man
+           dcmdata/libsrc/dcencdoc.cc
+
+- Fixed manpage formatting inconsistencies in encapsulation apps.
+  Affects: dcmdata/docs/cda2dcm.man
+           dcmdata/docs/pdf2dcm.man
+           dcmdata/docs/stl2dcm.man
+
+**** Changes from 2018.11.23 (schlamelcher)
+
+- Added a missing include:
+  Yesterdays commit (unknowingly) fixed the configuration test for socklen_t
+  on Windows which has been faulty since its original introduction in 2010.
+  This unveiled the sloppy work in various network related source files that
+  failed to include "ws2tcpip.h" required for using socklen_t on Windows.
+  Affects: dcmnet/libsrc/dul.cc
+           dcmnet/libsrc/dulfsm.cc
+           dcmpstat/tests/msgserv.cc
+
+**** Changes from 2018.11.22 (schlamelcher)
+
+- Added another iconv configuration test:
+  Added another configuration test determining whether a standard library iconv
+  implementation understands empty strings as arguments to iconv_open().
+  This should fix the failing unit test on NetBSD by no longer testing features
+  that are not supported there.
+  Added:   config/tests/lciconv.cc
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+           CMake/osconfig.h.in
+           config/configure
+           config/configure.in
+           config/include/dcmtk/config/osconfig.h.in
+           config/tests/iconv.cc
+           ofstd/include/dcmtk/ofstd/ofchrenc.h
+           ofstd/libsrc/ofchrenc.cc
+           ofstd/tests/tchrenc.cc
+
+- Added missing includes for configuration tests:
+  Added <winsock2.h> and <ws2tcpip.h> during configuration testing under
+  Windows, since otherwise getaddrinfo() won't be detected.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+
+**** Changes from 2018.11.21 (schlamelcher)
+
+- Fixed wrong documentation of calcElementLength():
+  The documentation of DcmObject::calcElementLength() stated that the function
+  never returned an undefined length. This is no longer true since a previous
+  commit introduced overflow handling that maps an overflow during length
+  calculation to the maximum possible value (clamping), which, coincidentally,
+  equals the constant defined as DCM_UndefinedLength.
+  This commit adjusts the documentation of calcElementLength() in DcmObject and
+  derived classes accordingly.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcdatset.h
+           dcmdata/include/dcmtk/dcmdata/dcelem.h
+           dcmdata/include/dcmtk/dcmdata/dcfilefo.h
+           dcmdata/include/dcmtk/dcmdata/dcmetinf.h
+           dcmdata/include/dcmtk/dcmdata/dcobject.h
+           dcmdata/include/dcmtk/dcmdata/dcpixseq.h
+
+- Fixed not detecting some functions on 32 bit Windows:
+  The CMake primitive check_function_exists() may fail on 32 bit Windows due to
+  name mangling. Modified GenerateDCMTKConfigure to always use CheckSymbolExists
+  instead on Windows as a workaround. Adjusted the list of header files to
+  include during the tests accordingly (what a pain in the ass).
+  This closes DCMTK bug #839.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+
+- Fixed generated CMake exports install destination:
+  Since the transition to GNUInstallDirs, DCMTK_INSTALL_CMKDIR already contains
+  CMAKE_INSTALL_PREFIX. Therefore, INSTALL_DESTINATION in GeneratedCMakeExports
+  became set to an invalid, duplicated path.
+  Thanks to Florian Franzen <Florian.Franzen@caesar.de> for the report and
+  suggested patch.
+  Affects: CMake/GenerateCMakeExports.cmake
+
+**** Changes from 2018.11.21 (riesmeier)
+
+- Fixed bug introduced with last commit (0f80c07):
+  Removed unused reference parameter of callback class constructor. This also
+  fixes a bug introduced with the last commit when trying to get rid of a
+  compiler warning: Setting the reference parameter "responseCount" to 0
+  resulted in response files being overwritten when multiple C-FIND requests
+  are issued during a single association (e.g. using findscu with multiple
+  query files).
+  Affects: dcmnet/include/dcmtk/dcmnet/dfindscu.h
+           dcmnet/libsrc/dfindscu.cc
+
+**** Changes from 2018.11.20 (riesmeier)
+
+- Removed useless for-loop (since VM is always 1):
+  Removed useless for-loop in isUniversalMatch(). The VM of the VR "UR" is 1
+  by definition, so getVM() never returns a value that is greater than 1.
+  This finally closes DCMTK Bug #807.
+  Affects: dcmdata/libsrc/dcvrur.cc
+
+**** Changes from 2018.11.19 (eichelberg)
+
+- Fixed warning about unused parameter (gcc -Wextra).
+  Affects: dcmnet/libsrc/dfindscu.cc
+
+**** Changes from 2018.11.15 (riesmeier)
+
+- Added sentence on compression of icon images:
+  Added sentence explaining that all Pixel Data (7fe0,0010) elements are
+  compressed, which also includes an icon image (if present).
+  Thanks to Mathieu Malaterre <mathieu.malaterre@gmail.com> for the
+  suggestion.
+  Affects: dcmdata/docs/dcmcrle.man
+           dcmjpeg/docs/dcmcjpeg.man
+           dcmjpls/docs/dcmcjpls.man
+
+- Updated data dictionary for approved changes:
+  Updated data dictionary for recently approved changes to the DICOM standard,
+  i.e. Supplement 188 (Multi-energy CT Images) as well as CP-1803 and CP-1809.
+  Affects: dcmdata/data/dicom.dic
+           dcmdata/include/dcmtk/dcmdata/dcdeftag.h
+           dcmdata/libsrc/dcdictbi.cc
+
+**** Changes from 2018.11.13 (eichelberg)
+
+- Implemented DICOM CP 1653 in the JPEG codec:
+  Implemented DICOM CP 1653, which forbids the use of the YBR_FULL
+  photometric interpretation in lossy JPEG transfer syntaxes, which was
+  the default in DCMTK. Only YBR_FULL_422 (with 4:2:2 subsampling) is
+  permitted now. Changed the default behaviour of the JPEG encoder
+  accordingly and renamed dcmcjpeg's --sample-422 command line option to
+  --nonstd-444. Furthermore, subsampling is now suppressed in all lossless
+  JPEG encoding processes.
+  This closes DCMTK issues #716, #717 and #811.
+  Affects: dcmjpeg/apps/dcmcjpeg.cc
+           dcmjpeg/docs/dcmcjpeg.man
+           dcmjpeg/include/dcmtk/dcmjpeg/djencode.h
+           dcmjpeg/libsrc/djeijg12.cc
+           dcmjpeg/libsrc/djeijg16.cc
+           dcmjpeg/libsrc/djeijg8.cc
+
+**** Changes from 2018.11.12 (eichelberg)
+
+- Fixed a warning reported by gcc 8:
+  Fixed a warning reported by gcc 8 with -Wformat-overflow and increased
+  DIC_NODENAME_LEN to 270 to ensure that DIC_NODENAME is large enough
+  for any valid DNS name and port number.
+  Thanks to Mathieu Malaterre <malat@debian.org> for the report.
+  Affects: dcmnet/include/dcmtk/dcmnet/dicom.h
+           dcmqrdb/libsrc/dcmqrcbm.cc
+
+**** Changes from 2018.11.09 (onken)
+
+- Fix index checking if no measurem. are available.
+  Affects: dcmtract/libsrc/trcmeasurement.cc
+
+- Make checkValuesComplete() public:
+  Thanks to Isaiah Norton <inorton@bwh.harvard.edu> for the report and
+  fix.
+  Affects: dcmtract/include/dcmtk/dcmtract/trcmeasurement.h
+
+**** Changes from 2018.11.08 (riesmeier)
+
+- Fixed wrong initialization order of members:
+  Fixed wrong initialization order of member variables (reported by gcc with
+  option -Wreorder, which is enabled by default since -Wall is typically set).
+  Also fixed some typos in comments (API documentation).
+  Affects: dcmdata/include/dcmtk/dcmdata/dcencdoc.h
+           dcmdata/libsrc/dcencdoc.cc
+
+**** Changes from 2018.11.08 (schlamelcher)
+
+- Added configure test to workaround an Android issue.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+
+**** Changes from 2018.11.07 (riesmeier)
+
+- Added configure test for HAVE_STREAMBUF_H:
+  Added missing configure test for HAVE_STREAMBUF_H.
+  This closes DCMTK Bug #761.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+           CMake/osconfig.h.in
+           config/configure
+           config/configure.in
+           config/include/dcmtk/config/osconfig.h.in
+
+**** Changes from 2018.11.07 (schlamelcher)
+
+- More fixes for iconv configure test:
+  Fixed passing LINK_LIBRARIES to DCMTK_TRY_RUN, which resulted in link library
+  flags (e.g. debug) being misunderstood as library names.
+  Fixed not considering result of other configure test
+  (LIBICONV_SECOND_ARGUMENT_CONST) for calling iconv() during this test.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+           CMake/dcmtkTryRun.cmake
+           config/tests/iconv.cc
+
+**** Changes from 2018.11.07 (onken)
+
+- Fixed indexing bugs and parameter constness:
+  Thanks to Isaiah Norton <inorton@bwh.harvard.edu> for the report and
+  fix.
+  Affects: dcmtract/include/dcmtk/dcmtract/trctrackset.h
+           dcmtract/libsrc/trcmeasurement.cc
+           dcmtract/libsrc/trctrackset.cc
+
+**** Changes from 2018.11.06 (riesmeier)
+
+- Increased precision of floating point output:
+  Increased precision of floating point values (VR = FL and FD) in print()
+  method, which is also used for XML output. The output should now be
+  consistent with the corresponding VR classes in module "dcmdata".
+  Thanks to Mathieu Malaterre <mathieu.malaterre@gmail.com> for the report.
+  Affects: dcmsr/libsrc/dsrsc3gr.cc
+           dcmsr/libsrc/dsrscogr.cc
+           dcmsr/libsrc/dsrtcoto.cc
+
+**** Changes from 2018.11.06 (schlamelcher)
+
+- Fixed Worklist SCP not accepting some time queries:
+  The Worklist SCP (dcmwlm) did not accept time / time range queries that only
+  contained hours (e.g. 12-14) since the hard coded VR checking routines were to
+  strict.
+  Rewrote the code to use DcmAttributeMatching for separating range queries into
+  the individual components and applying the existing VR checker from DcmElement
+  on each of them instead.
+  Affects: dcmwlm/include/dcmtk/dcmwlm/wlds.h
+           dcmwlm/libsrc/wlds.cc
+
+- Added handy overload for OFStandard::trimString():
+  The new overload takes a const char* and a size_t reference instead of two
+  const char* references, since this is a way to passed strings that is used
+  similarly often.
+  Affects: ofstd/include/dcmtk/ofstd/ofstd.h
+           ofstd/libsrc/ofstd.cc
+
+- Enhanced recently introduced iconv configure test:
+  Ensured conversion mode DiscardIllegalSequences is detected even if no
+  terminating null character is written to the output buffer, performing the
+  test based on the size values and not based on the resulting string.
+  Affects: config/tests/iconv.cc
+
+- Fixed argument order for iconv_open() in config test:
+  The recently introduced configure test for iconv conversion flags used
+  icon_open() in a wrong way, leading to wrong results (always
+  AbortTranscodingOnIllegalSequence, which is correct in most cases but not
+  always).
+  Affects: config/tests/iconv.cc
+
+- More fixes for iconv stuff:
+  The configuration test for detecting fixed iconv conversion behavior now
+  respects required include directories and libraries in case iconv is not part
+  of the C standard library.
+  Fixed getConversionFlags() implementation based on libiconv > 1.08 returning 0
+  (unknown) when no flags were set, instead of the actual behavior in that case,
+  AbortTranscodingOnIllegalSequence.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+           config/configure
+           config/configure.in
+           ofstd/libsrc/ofchrenc.cc
+           ofstd/tests/tchrenc.cc
+
+**** Changes from 2018.11.05 (schlamelcher)
+
+- Fixed another iconv related issue:
+  Old versions of the iconv library also don't provide the iconvctl function,
+  similar to an iconv implementation that is part of the C standard library.
+  The recently introduced configure test is now also applied in that case to
+  detect such an implementations fixed behavior.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+           CMake/osconfig.h.in
+           config/configure
+           config/configure.in
+           config/include/dcmtk/config/osconfig.h.in
+           ofstd/libsrc/ofchrenc.cc
+
+- Fixed a missing return statement by refactoring:
+  Fixed an issue in a previous commit and refactored some #if #else spaghetti
+  code to make it more readable and prevent issues like that in the future.
+  Affects: ofstd/libsrc/ofchrenc.cc
+
+- Added forgotten configure test source file.
+  Added:   config/tests/iconv.cc
+
+**** Changes from 2018.11.04 (riesmeier)
+
+- Option --output-directory requires --port:
+  Option --output-directory only makes sense if option --port is used.
+  Therefore, we check this dependency when evaluating the command line.
+  In addition, --no-port now really disables any previously specified
+  --port option. This is needed since the command line options are
+  evaluated from right to left.
+  Affects: dcmnet/apps/movescu.cc
+
+**** Changes from 2018.11.02 (schlamelcher)
+
+- Added a configure test for stdlibc iconv behavior:
+  Different iconv implementations inside the C standard library handle invalid
+  sequences quite differently. The new configuration test tries its best to
+  determine the given implementation's behavior and map it to one of the defined
+  conversion flags.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+           CMake/osconfig.h.in
+           config/configure
+           config/configure.in
+           config/include/dcmtk/config/osconfig.h.in
+           ofstd/libsrc/ofchrenc.cc
+
+- Fixed a bug in yesterday's commit:
+  Yesterday's commit did not handle the case where OFString_npos was passed to
+  denote the maximum number of available characters in a string and instead
+  forwarded it to OFString::append() unchanged.
+  OFString silently corrects this error while an actual STL string throws an
+  exception.
+  Affects: dcmdata/libsrc/dcelem.cc
+
+**** Changes from 2018.11.01 (schlamelcher)
+
+- Fixed initially bad naming sense in previous commit.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcmatch.h
+           dcmdata/libsrc/dcmatch.cc
+           dcmdata/tests/tmatch.cc
+
+- Added functions to validate range queries:
+  Added functions for validating DA, TM and DT (range) queries to
+  DcmAttributeMatching. Extended DcmAttributeMatching's unit test accordingly.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcmatch.h
+           dcmdata/include/dcmtk/dcmdata/dcvrda.h
+           dcmdata/include/dcmtk/dcmdata/dcvrtm.h
+           dcmdata/libsrc/dcmatch.cc
+           dcmdata/libsrc/dcvrda.cc
+           dcmdata/libsrc/dcvrtm.cc
+           dcmdata/tests/tmatch.cc
+
+- Added additional DA, DT and TM check functions:
+  Added additional check() functions to the respective VR classes for VRs DA, DT
+  and TM. The new functions operate on single values (VR=1) and (sub-) string
+  views instead of whole strings, preventing unnecessary string copies.
+  The old checkStringValue() functions are now based one these newly introduced
+  functions.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcvrda.h
+           dcmdata/include/dcmtk/dcmdata/dcvrdt.h
+           dcmdata/include/dcmtk/dcmdata/dcvrtm.h
+           dcmdata/libsrc/dcvrda.cc
+           dcmdata/libsrc/dcvrdt.cc
+           dcmdata/libsrc/dcvrtm.cc
+
+- Various enhancements for VR checking code:
+  Introduced additional API for operating on substring views instead of copies,
+  preventing various unnecessary string copy operations.
+  Replaced legacy input buffer code with OFString - this was a memory leak
+  waiting to happen.
+  Refactored code to match RAII paradigm.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcelem.h
+           dcmdata/include/dcmtk/dcmdata/vrscan.h
+           dcmdata/libsrc/dcelem.cc
+           dcmdata/libsrc/vrscan.cc
+
+**** Changes from 2018.10.30 (schlamelcher)
+
+- Updated copyright date in files from previous commit.
+  Affects: dcmdata/libsrc/dcmatch.cc
+           dcmdata/tests/tmatch.cc
+
+- Made DcmAttributeMatchings's range separator public:
+  Made some private nested class of DcmAttributeMatching public, refactored it
+  for readability and added / enhanced the documentation. The class is now named
+  DcmAttributeMatching::Range.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcmatch.h
+           dcmdata/libsrc/dcmatch.cc
+
+- Fixes and enhancements for OFpath:
+  Fixed borked multi root name (Windows) implementation of the append operator
+  (operator/=) and added various tests to the unit test as appropriate.
+  Fixed self append doing nothing instead of "duplicating" relative paths as it
+  should and added various tests to the unit test as appropriate.
+  Added findRootName() and based several functions on it to de-clutter code.
+  Added descriptions from en.cppreference.com as comments to the complex multi
+  root name append code.
+  Refactored most boolean expressions to use Yoda notation.
+  Affects: ofstd/include/dcmtk/ofstd/offilsys.h
+           ofstd/libsrc/offilsys.cc
+           ofstd/tests/tfilsys.cc
+
+**** Changes from 2018.10.26 (arizpegomez)
+
+- Updated manpages of encapsulation apps:
+  Improved readability of the encapsulation apps manpages.
+  Affects: dcmdata/docs/cda2dcm.man
+           dcmdata/docs/pdf2dcm.man
+           dcmdata/docs/stl2dcm.man
+
+**** Changes from 2018.10.26 (schlamelcher)
+
+- Re-fixed the clang conversion issue from yesterday.
+  Affects: ofstd/include/dcmtk/ofstd/variadic/helpers.h
+
+**** Changes from 2018.10.26 (arizpegomez)
+
+- Updated stl2dcm manpage with required module options:
+  Included required module options to stl2dcm manpage and also made minor
+  improvements for code readability and consistency in encapuslation apps.
+  Affects: dcmdata/docs/stl2dcm.man
+           dcmdata/include/dcmtk/dcmdata/dcencdoc.h
+           dcmdata/libsrc/dcencdoc.cc
+
+**** Changes from 2018.10.25 (arizpegomez)
+
+- Fixed missing modules for STL encapsulation:
+  Included missing required modules for stl2dcm. Also made minor improvements
+  for code readability.
+  Affects: dcmdata/apps/cda2dcm.cc
+           dcmdata/apps/pdf2dcm.cc
+           dcmdata/apps/stl2dcm.cc
+           dcmdata/include/dcmtk/dcmdata/dcencdoc.h
+           dcmdata/libsrc/dcencdoc.cc
+
+**** Changes from 2018.10.25 (schlamelcher)
+
+- Fixed a compile time type conversion issue on clang.
+  Affects: ofstd/include/dcmtk/ofstd/variadic/helpers.h
+
+**** Changes from 2018.10.24 (arizpegomez)
+
+- Fixed unused parameters and options in dcencdoc:
+  Removed opt_hl7InstanceId and opt_mediaTypes variables from dcencdoc, since
+  they were not used, and replaced them with the right variables. Also changed
+  the filetype to a global variable to fix warnings of unused options. Some
+  other changes for formatting consistency were also necessary.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcencdoc.h
+           dcmdata/libsrc/dcencdoc.cc
+
+- Improved log output for encapsulation apps.
+  Affects: dcmdata/apps/cda2dcm.cc
+           dcmdata/apps/pdf2dcm.cc
+           dcmdata/apps/stl2dcm.cc
+
+**** Changes from 2018.10.23 (arizpegomez)
+
+- Improved STL validation with casting:
+  Included a reinterpret cast in dcencdoc to interpret the 32-bytes unsigned
+  integer indicating the number of triangles included in the STL binary file.
+  Also improved debug and trace output of this class.
+  Affects: dcmdata/libsrc/dcencdoc.cc
+
+**** Changes from 2018.10.12 (arizpegomez)
+
+- Fixed undeclared identifier error in STL verification.
+  Affects: dcmdata/libsrc/dcencdoc.cc
+
+**** Changes from 2018.10.08 (arizpegomez)
+
+- Fixed wrong method call on pdf2dcm.
+  Affects: dcmdata/apps/pdf2dcm.cc
+
+**** Changes from 2018.10.07 (arizpegomez)
+
+- Fixed missing attribute on CDA encapsulation:
+  Included 1C attribute hl7 instance identifier into cda2dcm. Also improved
+  formatting consistency and abbreviated most common Code System Definitions.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcencdoc.h
+           dcmdata/libsrc/dcencdoc.cc
+
+- Improved STL file verification:
+  Included verification for binary and ASCII STL files. Also improved format
+  consistency for the class managing document encapsulation.
+  Affects: dcmdata/libsrc/dcencdoc.cc
+
+- Improved dcencdoc doxygen documentation.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcencdoc.h
+
+**** Changes from 2018.10.05 (onken)
+
+- Fixed index check:
+  Thanks to Isaiah Norton<inorton@bwh.harvard.edu> for the report.
+  Affects: dcmiod/libsrc/iodmacro.cc
+
+**** Changes from 2018.10.04 (onken)
+
+- Fixed dictionary test under Windows:
+  Use _putenv_s instead of SetEnvironmentVariable to unset
+  DCMDICTPATH in test dcmdata_usingDataDictionary.
+  Affects: dcmdata/tests/tdict.cc
+
+**** Changes from 2018.10.04 (riesmeier)
+
+- Updated latest tested CMake version:
+  Updated information on latest CMake version that has been tested to "3.12.3".
+  Affects: CMake/dcmtkPrepare.cmake
+
+**** Changes from 2018.09.27 (riesmeier)
+
+- Updated Context Group classes for DICOM 2018d:
+  Updated automatically generated Context Group classes for the 2018d edition
+  of the DICOM standard. All supported classes were updated, even though there
+  were only changes to CID 7469.
+  Affects: dcmsr/include/dcmtk/dcmsr/cmr/cid100.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid10013.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid10033.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid11.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid244.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid29.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid4020.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid4021.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid4031.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid42.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid6147.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7021.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7181.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7445.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7452.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7453.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7464.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7469.h
+           dcmsr/libcmr/cid100.cc
+           dcmsr/libcmr/cid10013.cc
+           dcmsr/libcmr/cid10033.cc
+           dcmsr/libcmr/cid11.cc
+           dcmsr/libcmr/cid244.cc
+           dcmsr/libcmr/cid29.cc
+           dcmsr/libcmr/cid4020.cc
+           dcmsr/libcmr/cid4021.cc
+           dcmsr/libcmr/cid4031.cc
+           dcmsr/libcmr/cid42.cc
+           dcmsr/libcmr/cid6147.cc
+           dcmsr/libcmr/cid7021.cc
+           dcmsr/libcmr/cid7181.cc
+           dcmsr/libcmr/cid7445.cc
+           dcmsr/libcmr/cid7452.cc
+           dcmsr/libcmr/cid7453.cc
+           dcmsr/libcmr/cid7464.cc
+           dcmsr/libcmr/cid7469.cc
+
+- Updated code definitions for DICOM 2018d:
+  Updated automatically generated code definitions for coding scheme "DCM",
+  "NCIt" and "UMLS". For the latter two, there were no changes (compared to
+  the previous edition).
+  Affects: dcmsr/include/dcmtk/dcmsr/codes/dcm.h
+           dcmsr/include/dcmtk/dcmsr/codes/ncit.h
+           dcmsr/include/dcmtk/dcmsr/codes/umls.h
+
+- Updated data dictionary for DICOM 2018d:
+  Updated data dictionary for the latest edition of the DICOM standard, which
+  has been released today.
+  Affects: dcmdata/data/dicom.dic
+           dcmdata/include/dcmtk/dcmdata/dcdeftag.h
+           dcmdata/libsrc/dcdictbi.cc
+
+**** Changes from 2018.09.26 (onken)
+
+- Adapt dictionary test for commit 52b3b7:
+  Make sure external dictionary is not loaded from DCMDICTPATH for tdict.cc
+  test which relies on an empty default dictionary.
+  Affects: dcmdata/tests/tdict.cc
+
+**** Changes from 2018.09.21 (riesmeier)
+
+- Added new dcmimage tool "dcmicmp".
+  Affects: .gitignore
+
+- Include missing files in Doxygen's HTML output:
+  Made sure that missing header files are processed when generating the HTML
+  documentation with Doxygen. This includes type definitions, constants,
+  global variables and functions in all DCMTK modules.
+  This closes DCMTK Bug #532.
+  Affects: dcmfg/include/dcmtk/dcmfg/fgtypes.h
+           dcmimage/include/dcmtk/dcmimage/diqttype.h
+           dcmimgle/include/dcmtk/dcmimgle/diutils.h
+           dcmiod/include/dcmtk/dcmiod/cielabutil.h
+           dcmjpeg/include/dcmtk/dcmjpeg/djutils.h
+           dcmjpls/include/dcmtk/dcmjpls/djlsutil.h
+           dcmnet/include/dcmtk/dcmnet/dcmlayer.h
+           dcmnet/include/dcmtk/dcmnet/dcmtrans.h
+           dcmnet/include/dcmtk/dcmnet/dcuserid.h
+           dcmnet/include/dcmtk/dcmnet/dimse.h
+           dcmnet/include/dcmtk/dcmnet/dul.h
+           dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h
+           dcmseg/include/dcmtk/dcmseg/segtypes.h
+           dcmsign/include/dcmtk/dcmsign/sitypes.h
+           dcmtls/include/dcmtk/dcmtls/tlsciphr.h
+           dcmtls/include/dcmtk/dcmtls/tlslayer.h
+           dcmtract/include/dcmtk/dcmtract/trctypes.h
+           dcmwlm/include/dcmtk/dcmwlm/wltypdef.h
+
+- Fixed typo in comment.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcjson.h
+           dcmdata/libsrc/dcpixel.cc
+           ofstd/include/dcmtk/ofstd/offname.h
+           ofstd/include/dcmtk/ofstd/ofgrp.h
+           ofstd/include/dcmtk/ofstd/ofoset.h
+           ofstd/include/dcmtk/ofstd/ofpwd.h
+           ofstd/include/dcmtk/ofstd/ofrand.h
+           ofstd/include/dcmtk/ofstd/ofsetit.h
+           ofstd/include/dcmtk/ofstd/ofuoset.h
+           ofstd/include/dcmtk/ofstd/ofutil.h
+           ofstd/include/dcmtk/ofstd/ofvector.h
+
+**** Changes from 2018.09.18 (onken)
+
+- Load dicitionaries from DCMDICTPATH in any case:
+  Load dictionaries defined by DCMDICTPATH environment variable in any
+  case, i.e. even if the external default dictionary is turned off.
+  This closes DCMTK issue #846.
+  Affects: dcmdata/libsrc/dcdict.cc
+
+**** Changes from 2018.09.13 (eichelberg)
+
+- Changed version numbering of shared objects:
+  The version numbering of shared objects on Posix operating systems now
+  follows these guidelines: https://autotools.io/libtool/version.html.
+  Thanks to Gert Wollny <gw.fossdev@gmail.com> for the suggestion and
+  patch.
+  Affects: CMake/dcmtkPrepare.cmake
+
+**** Changes from 2018.09.12 (eichelberg)
+
+- Fixed warnings about out of bounds array access.
+  Affects: dcmjpeg/libijg16/jdlhuff.c
+
+**** Changes from 2018.09.10 (arizpegomez)
+
+- Fixed a problem introduced by last commits:
+  The new variable ftype is now set properly on dcencdoc. Also corrected the
+  evaluation code for the override option. Also did some reformatting.
+  Affects: dcmdata/libsrc/dcencdoc.cc
+
+**** Changes from 2018.09.09 (arizpegomez)
+
+- Fixed document encapsulation modality and MIME-type settings:
+  dcencdoc now sets MIME-Types and Modality correctly when encapsulating files.
+  Affects: dcmdata/libsrc/dcencdoc.cc
+
+- Fixed encapsulation apps log output discrepancies.
+  Affects: dcmdata/apps/cda2dcm.cc
+           dcmdata/apps/pdf2dcm.cc
+           dcmdata/apps/stl2dcm.cc
+
+- Fixed option issues of dcencdoc:
+  The structure and order of the options in the help pages of dcencdoc now
+  match the man pages. Besides, annotation and override options are now
+  configurated correctly.
+  Affects: dcmdata/libsrc/dcencdoc.cc
+
+**** Changes from 2018.09.07 (eichelberg)
+
+- Various improvements for dcmicmp:
+  dcmicmp now uses a completely new routine for comparing monochrome
+  images without VOI LUT transformation that better copes with differing
+  bit depths. Furthermore, several options for computing min/max VOI
+  windows have been added.
+  Affects: dcmimage/apps/dcmicmp.cc
+           dcmimage/docs/dcmicmp.man
+           dcmimage/include/dcmtk/dcmimage/dcmicmph.h
+           dcmimage/libsrc/dcmicmph.cc
+           doxygen/manpages/man1/dcmicmp.1
+
+**** Changes from 2018.09.06 (riesmeier)
+
+- Avoid type mismatch warnings (sprintf and sscanf):
+  Avoid type mismatch warnings on some platforms when using sprintf() and
+  sscanf() with integer variables of a specific size (number of bits).
+  This is done by using the format macro constants defined in "inttypes.h".
+  For reasons of supporting older compilers than C99 and systems that do not
+  provide this header file (with the macros defined), the old code is still
+  retained.
+  This closes DCMTK Bug #764.
+  Affects: dcmdata/libsrc/dcpath.cc
+           dcmdata/libsrc/dcvris.cc
+           dcmdata/libsrc/dcvrsl.cc
+           dcmdata/libsrc/dcvrul.cc
+           dcmimage/libsrc/dicoimg.cc
+           dcmimgle/libsrc/dimoimg.cc
+           dcmsr/libsrc/dsrimgfr.cc
+           dcmsr/libsrc/dsrtcosp.cc
+           ofstd/include/dcmtk/ofstd/ofstdinc.h
+
+**** Changes from 2018.09.05 (riesmeier)
+
+- Updated Makefile dependencies.
+  Affects: dcmdata/apps/Makefile.dep
+           dcmdata/libi2d/Makefile.dep
+           dcmdata/libsrc/Makefile.dep
+           dcmdata/tests/Makefile.dep
+           dcmfg/libsrc/Makefile.dep
+           dcmimage/apps/Makefile.dep
+           dcmimage/libsrc/Makefile.dep
+           dcmimgle/apps/Makefile.dep
+           dcmimgle/libsrc/Makefile.dep
+           dcmiod/libsrc/Makefile.dep
+           dcmiod/tests/Makefile.dep
+           dcmjpeg/apps/Makefile.dep
+           dcmjpeg/libijg16/Makefile.dep
+           dcmjpeg/libsrc/Makefile.dep
+           dcmjpls/apps/Makefile.dep
+           dcmjpls/libsrc/Makefile.dep
+           dcmnet/apps/Makefile.dep
+           dcmnet/libsrc/Makefile.dep
+           dcmnet/tests/Makefile.dep
+           dcmpmap/libsrc/Makefile.dep
+           dcmpstat/apps/Makefile.dep
+           dcmpstat/libsrc/Makefile.dep
+           dcmpstat/tests/Makefile.dep
+           dcmqrdb/apps/Makefile.dep
+           dcmqrdb/libsrc/Makefile.dep
+           dcmrt/apps/Makefile.dep
+           dcmrt/libsrc/Makefile.dep
+           dcmrt/tests/Makefile.dep
+           dcmseg/libsrc/Makefile.dep
+           dcmseg/tests/Makefile.dep
+           dcmsign/apps/Makefile.dep
+           dcmsign/libsrc/Makefile.dep
+           dcmsr/apps/Makefile.dep
+           dcmsr/libcmr/Makefile.dep
+           dcmsr/libsrc/Makefile.dep
+           dcmsr/tests/Makefile.dep
+           dcmtls/libsrc/Makefile.dep
+           dcmtract/libsrc/Makefile.dep
+           dcmwlm/apps/Makefile.dep
+           dcmwlm/libsrc/Makefile.dep
+           dcmwlm/tests/Makefile.dep
+           oflog/libsrc/Makefile.dep
+           ofstd/libsrc/Makefile.dep
+           ofstd/tests/Makefile.dep
+
+- Made use of OFExplicitBool for OFBool parameters:
+  Replaced some parameters of type OFBool by OFExplicitBool in order to avoid
+  calling the wrong method (because of ambiguities caused by implicit type
+  conversions, e.g. a numeric integer constant to bool).
+  Affects: ofstd/include/dcmtk/ofstd/ofcmdln.h
+           ofstd/libsrc/ofcmdln.cc
+
+**** Changes from 2018.09.04 (onken)
+
+- Load external dictionaries on Windows per default:
+  An earlier commit (49b2a6) refactored evaluation of dictionary
+  configuration leading to the current situation where an external
+  dictionary specified by DCMTK's DCMDICTPATH environment variable
+  is not read on DCMTK startup on Windows systems.
+  This commit reverts that change, i.e. it ensures that external
+  dictionaries specified via DCMDICTPATH are loaded per default on
+  Windows.
+  Affects: CMake/dcmtkPrepare.cmake
+           dcmdata/docs/datadict.txt
+
+**** Changes from 2018.09.04 (eichelberg)
+
+- Fixed minor gcc warning.
+  Affects: dcmsr/libsrc/dsrxmld.cc
+
+- Fixed minor gcc warning.
+  Affects: ofstd/libsrc/offilsys.cc
+
+- Added workaround for decoding incomplete RLE stripes:
+  Added workaround that enables decoding of RLE compressed images where
+  a stripe contains insufficient data but is the last stripe for a given
+  color component. This workaround extends the earlier workaround from
+  commit #374fa95c8 (May 2010). It enables successful decoding of some RLE
+  compressed images produced by older ACUSON Ultrasound devices.
+  Thanks to Daniel Grieger <Daniel.Grieger@ith-icoserve.com> for the
+  patch.
+  Affects: dcmdata/libsrc/dcrleccd.cc
+
+**** Changes from 2018.09.03 (eichelberg)
+
+- Various fixes for dcmicmp.
+  Affects: dcmimage/apps/dcmicmp.cc
+           dcmimage/include/dcmtk/dcmimage/dcmicmph.h
+           dcmimage/libsrc/dcmicmph.cc
+
+**** Changes from 2018.09.02 (arizpegomez)
+
+- Fixed bug on responseCounter of findSCU:
+  The responseCounter of findSCU did not increment properly and therefore the
+  file rsp001.dcm was overwritten every time. By passing the counter as a
+  reference, the files are now named correctly an not overwritten. The findUser
+  function was also adapted in dcmqrtis and dimse and properly documented.
+  This fixes bug 809.
+  Affects: dcmnet/include/dcmtk/dcmnet/dfindscu.h
+           dcmnet/include/dcmtk/dcmnet/dimse.h
+           dcmnet/libsrc/dfindscu.cc
+           dcmnet/libsrc/dimfind.cc
+           dcmqrdb/libsrc/dcmqrtis.cc
+
+**** Changes from 2018.09.02 (riesmeier)
+
+- Added default manpage for new tool "dcmicmp".
+  Added:   doxygen/manpages/man1/dcmicmp.1
+
+- Fixed various typos and formatting issues.
+  Affects: dcmimage/apps/dcmicmp.cc
+           dcmimage/docs/dcmicmp.man
+           dcmimage/include/dcmtk/dcmimage/dcmicmph.h
+
+**** Changes from 2018.09.02 (eichelberg)
+
+- Initial release of dcmicmp, an image comparison tool:
+  Initial release of dcmicmp, a tool that reads two DICOM images, an
+  original "reference image" and a post-processed "test image" to which
+  some kind of processing such as a lossy image compression has been
+  applied. dcmicmp compares both images and computes several metrics that
+  describe how similar or different both images are.
+  Added:   dcmimage/apps/dcmicmp.cc
+           dcmimage/docs/dcmicmp.man
+           dcmimage/include/dcmtk/dcmimage/dcmicmph.h
+           dcmimage/libsrc/dcmicmph.cc
+  Affects: dcmimage/apps/CMakeLists.txt
+           dcmimage/apps/Makefile.in
+           dcmimage/libsrc/CMakeLists.txt
+           dcmimage/libsrc/Makefile.in
+
+**** Changes from 2018.09.01 (eichelberg)
+
+- Added enum EW_WindowType.
+  Affects: dcmimgle/include/dcmtk/dcmimgle/diutils.h
+
+- Fixed incorrect Doxygen comments.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcpixel.h
+
+**** Changes from 2018.08.30 (eichelberg)
+
+- Fixed buffer overflows during assoc negotiation:
+  Fixed buffer overflows while parsing a malformed A-ASSOCIATE packet,
+  which may be caused by unchecked integer underflows.
+  Thanks to Peter Klotz <Peter.Klotz@ith-icoserve.com> for the
+  bug report and patch.
+  This closes DCMTK issue #847.
+  Affects: dcmnet/libsrc/dulparse.cc
+
+**** Changes from 2018.08.21 (eichelberg)
+
+- Enabled JPEG decoder workaround options:
+  Enabled the JPEG decoder workaround options for certain faulty images,
+  which were so far only available in dcmdjpeg, also in dcmcjpeg and
+  dcmj2pnm.
+  Affects: dcmimage/apps/dcm2pnm.cc
+           dcmjpeg/apps/dcmcjpeg.cc
+           dcmjpeg/docs/dcmcjpeg.man
+           dcmjpeg/docs/dcmdjpeg.man
+           dcmjpeg/docs/dcmj2pnm.man
+
+- Added workaround for Cornell bug to JPEG decoder:
+  Added a workaround to the lossless JPEG decoder that permits images
+  compressed with the Cornell codec, which creates invalid Huffman
+  tables for images with 16 bits/sample, to be correctly decoded.
+  This closes DCMTK patch #467.
+  Affects: dcmjpeg/apps/dcmdjpeg.cc
+           dcmjpeg/docs/dcmdjpeg.man
+           dcmjpeg/include/dcmtk/dcmjpeg/djcparam.h
+           dcmjpeg/include/dcmtk/dcmjpeg/djdecode.h
+           dcmjpeg/libijg16/jdhuff.c
+           dcmjpeg/libijg16/jdhuff16.h
+           dcmjpeg/libijg16/jdlhuff.c
+           dcmjpeg/libijg16/jdphuff.c
+           dcmjpeg/libijg16/jdshuff.c
+           dcmjpeg/libijg16/jpeglib16.h
+           dcmjpeg/libsrc/djcparam.cc
+           dcmjpeg/libsrc/djdecode.cc
+           dcmjpeg/libsrc/djdijg16.cc
+           dcmjpeg/libsrc/djencode.cc
+
+**** Changes from 2018.08.18 (riesmeier)
+
+- Further fixes for cda2dcm syntax usage / manpage.
+  Affects: dcmdata/docs/cda2dcm.man
+           dcmdata/libsrc/dcencdoc.cc
+
+**** Changes from 2018.08.17 (arizpegomez)
+
+- Improved tabulation in encapsulation applications:
+  Fixed inconsistent tabulation in pdf2dcm, cda2dcm and stl2dcm and improved
+  the consistency of the documentation.
+  Affects: dcmdata/docs/cda2dcm.man
+           dcmdata/docs/pdf2dcm.man
+           dcmdata/docs/stl2dcm.man
+           dcmdata/libsrc/dcencdoc.cc
+
+**** Changes from 2018.08.16 (arizpegomez)
+
+- Fixed new inconsistencies in recent commits:
+  Fixed various inconsistencies between help and man pages of cda2dcm, pdf2dcm
+  and stl2dcm introduced with recent commits. Also removed some trailing space.
+  Affects: dcmdata/docs/cda2dcm.man
+           dcmdata/docs/pdf2dcm.man
+           dcmdata/docs/stl2dcm.man
+           dcmdata/libsrc/dcencdoc.cc
+           doxygen/manpages/man1/cda2dcm.1
+           doxygen/manpages/man1/pdf2dcm.1
+           doxygen/manpages/man1/stl2dcm.1
+
+**** Changes from 2018.08.16 (riesmeier)
+
+- Added missing "." to API documentation (Doxygen).
+  Affects: dcmdata/include/dcmtk/dcmdata/dcpixel.h
+
+**** Changes from 2018.08.15 (eichelberg)
+
+- Check minimum bit depth in lossless encoders:
+  The lossless compression codecs for JPEG, JPEG-LS and JPEG-2000 now
+  check
+  whether an image is really continuous-tone (i.e. at least 2 bits/sample)
+  and refuse compression of images with BitsStored=1, because all three
+  compression algorithms are only defined for images with 2-16
+  bits/sample.
+  Thanks to Peter Klotz <Peter.Klotz@ith-icoserve.com> for the bug report.
+  Affects: dcmjpeg/include/dcmtk/dcmjpeg/djutils.h
+           dcmjpeg/libsrc/djcodece.cc
+           dcmjpeg/libsrc/djutils.cc
+           dcmjpls/libsrc/djcodece.cc
+
+**** Changes from 2018.08.13 (riesmeier)
+
+- Fixed manpage title of new tool "stl2dcm".
+  Affects: dcmdata/docs/stl2dcm.man
+           doxygen/manpages/man1/stl2dcm.1
+
+**** Changes from 2018.08.10 (riesmeier)
+
+- Fixed inconsistencies in recent commits:
+  Fixed various inconsistencies in syntax usage, documentation, etc.
+  of cda2dcm, pdf2dcm and stl2dcm introduced with recent commits.
+  Affects: dcmdata/docs/cda2dcm.man
+           dcmdata/docs/pdf2dcm.man
+           dcmdata/docs/stl2dcm.man
+           dcmdata/libsrc/dcencdoc.cc
+           doxygen/manpages/man1/cda2dcm.1
+           doxygen/manpages/man1/pdf2dcm.1
+           doxygen/manpages/man1/stl2dcm.1
+
+- Added private undefined copy constructor.
+  Affects: ofstd/include/dcmtk/ofstd/ofcmdln.h
+
+**** Changes from 2018.08.10 (arizpegomez)
+
+- Included stl2dcm and cda2dcm in CMAKE and man1:
+  The main CMAKE was missing the new command line applications cda and stl2dcm.
+  Also the generated manpages were included.
+  Added:   doxygen/manpages/man1/cda2dcm.1
+           doxygen/manpages/man1/stl2dcm.1
+  Affects: dcmdata/apps/CMakeLists.txt
+
+- Improved dcencdoc with the typical output options:
+  Document encapsulation now has the typical output options (e.g. Xfer Syntax).
+  These options have been present since feature 419 was closed. This commit just
+  documented them in the man pages.
+  This closes Feature #813.
+  Added:   dcmdata/docs/cda2dcm.man
+           dcmdata/docs/stl2dcm.man
+  Affects: dcmdata/docs/dcmdata.dox
+           dcmdata/docs/pdf2dcm.man
+
+- Added --key option to pdf2dcm:
+  Included option to override any data entry in the dcm output file to pdf2dcm.
+  (This functionality was implemented in dcencdoc while closing feature 419.
+  This commit just restructured pdf2dcm completely to make use of that class.)
+  This closes feature #311.
+  Affects: dcmdata/apps/pdf2dcm.cc
+
+- Added new tool stl2dcm:
+  Created command line program stl2dcm and inserted it, together with cda2dcm
+  into CMake and (deprecated) autoconf.
+  This closes feature #826.
+  Added:   dcmdata/apps/stl2dcm.cc
+  Affects: dcmdata/apps/Makefile.dep
+           dcmdata/apps/Makefile.in
+           dcmdata/libsrc/CMakeLists.txt
+           dcmdata/libsrc/Makefile.in
+
+- Added new tool cda2dcm:
+  Created new command line program cda2dcm. Included isAttributeSet() in xml
+  parser test txml.cc, since it is used by cda2dcm.
+  This closes feature #418.
+  Added:   dcmdata/apps/cda2dcm.cc
+  Affects: .gitignore
+           ofstd/tests/txml.cc
+
+- Added new class dcencdoc (DCM encapsulated Document):
+  Created class for document encapsulation to dcm format. This class outsources
+  the overlapping methods of all encapsulation command line applications.
+  This closes feature #419.
+  Added:   dcmdata/include/dcmtk/dcmdata/dcencdoc.h
+           dcmdata/libsrc/dcencdoc.cc
+
+**** Changes from 2018.08.03 (riesmeier)
+
+- Added warning on Modality LUT transformation:
+  Added a warning message when processing certain types of DICOM images (e.g.
+  MR or PET) where the application of a stored Modality LUT transformation
+  may create unexpected results.
+  This closes DCMTK Bug #457.
+  Affects: dcmimgle/libsrc/dimomod.cc
+
+**** Changes from 2018.07.30 (eichelberg)
+
+- Changes that permit inclusion from private modules:
+  Minor changes that permit an inclusion of GenerateCMakeExports.cmake
+  from the private modules, so that the generated DCMTKTargets.cmake
+  contains all public and private libraries and applications.
+  Affects: CMake/GenerateCMakeExports.cmake
+
+**** Changes from 2018.07.23 (riesmeier)
+
+- Fixed wrong MAC size returned for SHA384:
+  Fixed wrong size returned by SiSHA384::getSize().
+  Thanks to forum user "deepakt" for the detailed analysis and fix.
+  Affects: dcmsign/libsrc/sisha384.cc
+
+**** Changes from 2018.07.16 (riesmeier)
+
+- Updated Context Group classes for DICOM 2018c:
+  Updated automatically generated Context Group classes for the 2018c edition
+  of the DICOM standard. All supported classes were updated, even though there
+  were only changes to CID 29 and 7181.
+  Affects: dcmsr/include/dcmtk/dcmsr/cmr/cid100.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid10013.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid10033.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid11.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid244.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid29.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid4020.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid4021.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid4031.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid42.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid6147.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7021.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7181.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7445.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7452.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7453.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7464.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7469.h
+           dcmsr/libcmr/cid100.cc
+           dcmsr/libcmr/cid10013.cc
+           dcmsr/libcmr/cid10033.cc
+           dcmsr/libcmr/cid11.cc
+           dcmsr/libcmr/cid244.cc
+           dcmsr/libcmr/cid29.cc
+           dcmsr/libcmr/cid4020.cc
+           dcmsr/libcmr/cid4021.cc
+           dcmsr/libcmr/cid4031.cc
+           dcmsr/libcmr/cid42.cc
+           dcmsr/libcmr/cid6147.cc
+           dcmsr/libcmr/cid7021.cc
+           dcmsr/libcmr/cid7181.cc
+           dcmsr/libcmr/cid7445.cc
+           dcmsr/libcmr/cid7452.cc
+           dcmsr/libcmr/cid7453.cc
+           dcmsr/libcmr/cid7464.cc
+           dcmsr/libcmr/cid7469.cc
+
+- Updated code definitions for DICOM 2018c:
+  Updated automatically generated code definitions for coding scheme "DCM",
+  "NCIt" and "UMLS". For the latter two, there were no changes (compared to
+  the previous edition).
+  Affects: dcmsr/include/dcmtk/dcmsr/codes/dcm.h
+           dcmsr/include/dcmtk/dcmsr/codes/ncit.h
+           dcmsr/include/dcmtk/dcmsr/codes/umls.h
+
+- Updated data dictionary for DICOM 2018c:
+  Updated data dictionary for the latest edition of the DICOM standard, which
+  has been released only recently.
+  Affects: dcmdata/data/dicom.dic
+           dcmdata/include/dcmtk/dcmdata/dcdeftag.h
+           dcmdata/libsrc/dcdictbi.cc
+
+- Fixes for recent API change:
+  Fixes for API change introduced with commit 1e6aefd.
+  Affects: dcmdata/libsrc/mkdeftag.cc
+           dcmdata/libsrc/mkdictbi.cc
+
+**** Changes from 2018.07.09 (goldhammer)
+
+- Fixed FindIconv problems on OpenBSD:
+  As it turned out, OpenBSD has its own FindIconv module in CMake with its own
+  test for a const second argument. This is now also properly supported and the
+  library and include paths are being handled correctly.
+  Affects: CMake/3rdparty.cmake
+
+**** Changes from 2018.07.06 (onken)
+
+- Set error_flag when returning from method.
+  Affects: dcmdata/libsrc/dcvrpobw.cc
+
+**** Changes from 2018.07.05 (eichelberg)
+
+- Fixed segmentation fault caused by invalid datasets:
+  Fixed a segmentation fault that could be caused by generating a
+  presentation state from an invalid dataset containing a Modality LUT
+  attribute with a VR other than SQ.
+  Thanks to GwanYeong Kim <gy741.kim@gmail.com> for the bug report.
+  This closes DCMTK bug #836.
+  Affects: dcmpstat/libsrc/dcmpstat.cc
+
+**** Changes from 2018.07.04 (eichelberg)
+
+- Check special cases before compressing/decompressing:
+  DcmDataset::chooseRepresentation() now checks a few special cases before
+  converting a dataset between encapsulated and unencapsulated
+  representation. Conversion to encapsulated representation is now refused
+  for datasets containing floating point pixel data. Datasets containing
+  a pixel data provider URL can only be converted to transfer syntaxes
+  using this type of representation for pixel data. Finally, converting a
+  dataset without pixel data to encapsulated representation causes a
+  warning to be issued.
+  This closes DCMTK issue #800.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcxfer.h
+           dcmdata/libsrc/dcdatset.cc
+           dcmdata/libsrc/dcxfer.cc
+
+- Check chooseRepresentation() return code:
+  Fixed code where the condition returned by DcmDataset::chooseRepresentation()
+  was not properly evaluated.
+  Affects: dcmdata/apps/dcmconv.cc
+           dcmdata/apps/dcmcrle.cc
+           dcmdata/apps/pdf2dcm.cc
+           dcmimage/apps/dcmquant.cc
+           dcmimage/apps/dcmscale.cc
+           dcmjpeg/apps/dcmcjpeg.cc
+           dcmjpeg/docs/dcmjpeg.dox
+           dcmnet/apps/storescu.cc
+           dcmnet/libsrc/scu.cc
+           dcmpstat/apps/dcmpsmk.cc
+           dcmsign/apps/dcmsign.cc
+
+**** Changes from 2018.07.03 (goldhammer)
+
+- Fixed incompatibility between FindIconv versions:
+  In version 3.11 CMake introduced its own FindIconv.cmake, which sets
+  ICONV_FOUND instead of LIBICONV_FOUND, as it is done by the DCMTK version
+  FindICONV.cmake. The other variable names also omitted the "LIB" part.
+  Furthermore, the CMake version handles detection of extern versions of
+  LibIconv and the built-in version in the C standard library differently. This
+  should now also be adjusted.
+  Additionally the CMake command "find_package" threats found modules as
+  case-sensitive, so the DCMTK version had to be renamed to match the new
+  built-in version.
+  This closes DCMTK Bug #837.
+  Affects: CMake/3rdparty.cmake
+
+**** Changes from 2018.07.03 (eichelberg)
+
+- Removed extra semicolon.
+  Affects: dcmnet/libsrc/dcompat.cc
+
+- Fixed typo and changed SRW detection (again):
+  Fixed a typo and changed the function that is looked up to detect the
+  presence of the SRW (slim read/write lock) functionality on Windows,
+  as apparently Visual Studio 2008 defines InitializeSRWLock() but not
+  TryAcquireSRWLockShared().
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+           CMake/osconfig.h.in
+           ofstd/libsrc/ofthread.cc
+
+**** Changes from 2018.07.02 (eichelberg)
+
+- Fixed detection of SRW locks on MinGW:
+  Replaced CMake test HAVE_INITIALIZESRWLOCK (which looks for the presence
+  of SRW locks in the system libraries) by HAVE_PROTOTYPE_INITIALIZESRWLOCK
+  (which looks for a declaration of SRW locks in <windows.h> to avoid problems
+  on MinGW where in some versions the function prototypes are missing.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+           CMake/osconfig.h.in
+           ofstd/libsrc/ofthread.cc
+
+**** Changes from 2018.06.27 (onken)
+
+- Set error_flag when returning from method, again.
+  Affects: dcmdata/libsrc/dcvrpobw.cc
+
+**** Changes from 2018.06.26 (onken)
+
+- Fixed compiler warning.
+  Affects: dcmpmap/libsrc/dpmparametricmapiod.cc
+
+- Set error_flag when returning from method.
+  Affects: dcmdata/libsrc/dcvrpobw.cc
+
+**** Changes from 2018.06.25 (onken)
+
+- Make Number of Frames 32 bit:
+  This amends earlier commits transforming Number of Frames internally from
+  16 bit into a 32 bit value.
+  Affects: dcmiod/include/dcmtk/dcmiod/modmultiframefg.h
+           dcmiod/libsrc/modmultiframefg.cc
+           dcmseg/include/dcmtk/dcmseg/segdoc.h
+           dcmseg/libsrc/segdoc.cc
+
+**** Changes from 2018.06.24 (eichelberg)
+
+- Added UL modifier to constants to avoid warnings.
+  Affects: dcmdata/libsrc/dcvrpobw.cc
+           dcmseg/libsrc/segdoc.cc
+
+- Added CMake test for availability of SRW functions:
+  Added CMake test that checks the availability of the slim read/write lock
+  functions, which are available on modern Windows versions, but are not available
+  in the platform SDKs installed by default with MSVC 2005 and 2008.
+  No corresponding autoconf test is added because these functions do not
+  exist on any platform supported by the autoconf toolchain, including MinGW.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+           CMake/osconfig.h.in
+           ofstd/libsrc/ofthread.cc
+
+**** Changes from 2018.06.23 (eichelberg)
+
+- Class OFReadWriteLock now uses SRW locks on Windows:
+  The Win32 implementation of class OFReadWriteLock class now uses
+  Slim Reader/Writer (SRW) Locks, which are available since Windows Vista,
+  instead of the older implementation based on a Mutex, a Semaphore and
+  a counter, because SRW locks are much faster. Unfortunately SRW locks
+  require different functions for unlocking read and write locks, which
+  causes an API change in class OFReadWriteLock and in class
+  GlobalDcmDataDictionary (which internally uses a read/write lock to
+  protect access to the DICOM dictionary.)
+  Thanks to Christian Fremgen <Christian.Fremgen@ith-icoserve.com>
+  for the patch that has inspired this implementation.
+  This closes DCMTK Patch #810.
+  Affects: config/docs/macros.txt
+           dcmdata/apps/dcmconv.cc
+           dcmdata/apps/dcmdump.cc
+           dcmdata/apps/mdfdsman.cc
+           dcmdata/include/dcmtk/dcmdata/dcdict.h
+           dcmdata/libsrc/dcdict.cc
+           dcmdata/libsrc/dctag.cc
+           dcmdata/tests/tnewdcme.cc
+           dcmiod/libsrc/iodutil.cc
+           dcmnet/apps/movescu.cc
+           dcmpstat/apps/dcmpschk.cc
+           dcmsign/apps/dcmsign.cc
+           ofstd/include/dcmtk/ofstd/ofthread.h
+           ofstd/libsrc/ofthread.cc
+           ofstd/tests/tthread.cc
+
+**** Changes from 2018.06.22 (onken)
+
+- Fixed algorithm identification substructure:
+  Fixed algorithm identification structures within Tracksets.
+  Thanks to Isaiah Norton <inorton@bwh.harvard.edu> for the report.
+  Affects: dcmtract/include/dcmtk/dcmtract/trctrackset.h
+           dcmtract/include/dcmtk/dcmtract/trctractographyresults.h
+           dcmtract/libsrc/trctrackset.cc
+           dcmtract/libsrc/trctractographyresults.cc
+
+**** Changes from 2018.06.20 (onken)
+
+- Set maximum number of frames to 2147483647:
+  Set the maximum number of frames to 2147483647 which is the maximum
+  value the Number of Frames attribute can hold (VR IS).
+  This also fixes one of the last commits (18a505).
+  Affects: dcmiod/include/dcmtk/dcmiod/iodutil.h
+           dcmiod/libsrc/iodutil.cc
+           dcmpmap/include/dcmtk/dcmpmap/dpmparametricmapiod.h
+           dcmpmap/libsrc/dpmparametricmapiod.cc
+           dcmseg/libsrc/segdoc.cc
+
+**** Changes from 2018.06.19 (riesmeier)
+
+- Use correct data type for type casts:
+  Use correct data type for explicit type conversions ("unsigned int" instead
+  of "Uint16") in order to avoid unwanted truncation. Also use OFswap() instead
+  of a local variable when swapping the value of two member variables.
+  Affects: dcmimgle/libsrc/diovpln.cc
+
+**** Changes from 2018.06.18 (onken)
+
+- Allow 32 bit value for Number of Frames.
+  Affects: dcmiod/include/dcmtk/dcmiod/iodutil.h
+
+**** Changes from 2018.06.15 (onken)
+
+- Fixed doxygen warnings.
+  Affects: dcmseg/include/dcmtk/dcmseg/segment.h
+           dcmseg/include/dcmtk/dcmseg/segtypes.h
+
+- Fix possible pixel data size int overflows:
+  Fix possible overflows that can happen when computing number of bytes
+  required for pixel data by making sure data types are large in enough
+  for computations and by checking whether related multiplications are
+  safe. Also make sure that the dcmdata API is not accepting values that
+  are larger than 4 GB.
+  Thanks to Sahab Zanjanizadeh <Sahab.Zanjanizadeh@ge.com> and Thomas Dement
+  <Thomas.Dement@ge.com> for the report.
+  Affects: dcmdata/libsrc/dcvrpobw.cc
+           dcmseg/include/dcmtk/dcmseg/segdoc.h
+           dcmseg/libsrc/segdoc.cc
+           dcmseg/libsrc/segutils.cc
+           ofstd/include/dcmtk/ofstd/ofstd.h
+           ofstd/tests/tests.cc
+           ofstd/tests/tofstd.cc
+
+**** Changes from 2018.06.15 (riesmeier)
+
+- Fixed issue with incorrect rendering of overlays:
+  Fixed issue with incorrect rendering of overlay planes embedded in the pixel
+  data when performing rotation and scaling on the same DicomImage instance,
+  e.g. when calling dcm2pnm with options "+Sxf 0.5 +Rl" or "+Sxf 1.5 +Rtd".
+  Also enhanced output to trace logger in order to discover the reason for this
+  issue (and possibly similar issues in the future).
+  This closes DCMTK Bug #828.
+  Affects: dcmimgle/include/dcmtk/dcmimgle/dimoopxt.h
+           dcmimgle/include/dcmtk/dcmimgle/diovpln.h
+           dcmimgle/libsrc/diovpln.cc
+
+**** Changes from 2018.06.12 (eichelberg)
+
+- Improved poll() code in module dcmnet:
+  Enabled poll() code in module to check multiple sockets in parallel.
+  Thanks to github user sercxjo for the report and patch.
+  Affects: dcmnet/include/dcmtk/dcmnet/dcmtrans.h
+           dcmnet/libsrc/dcmtrans.cc
+
+**** Changes from 2018.06.11 (onken)
+
+- Enabled doxygen docs potentially hidden by macros:
+  Some class, method, enum or other doxygen documentation has only been
+  processed if specific features have been enabled for, or detected by
+  DCMTK (e.g. 3rd party libraries like OpenSSL). Now all such potentially
+  "hidden" documentation is visible to doxygen and therefore part of the
+  resulting output, no matter if the related macros are set on that system
+  or not. In order to make clear that the documented features are not
+  available on certain systems a corresponding commment has been added.
+  Affects: dcmdata/include/dcmtk/dcmdata/cmdlnarg.h
+           dcmdata/include/dcmtk/dcmdata/dccodec.h
+           dcmdata/include/dcmtk/dcmdata/dcdict.h
+           dcmdata/include/dcmtk/dcmdata/dcistrmf.h
+           dcmdata/include/dcmtk/dcmdata/dcistrmz.h
+           dcmdata/include/dcmtk/dcmdata/dcostrmz.h
+           dcmdata/include/dcmtk/dcmdata/dcxfer.h
+           dcmimage/include/dcmtk/dcmimage/dipipng.h
+           dcmimage/include/dcmtk/dcmimage/dipitiff.h
+           dcmimgle/include/dcmtk/dcmimgle/diobjcou.h
+           dcmnet/include/dcmtk/dcmnet/dfindscu.h
+           dcmnet/include/dcmtk/dcmnet/scp.h
+           dcmnet/include/dcmtk/dcmnet/scppool.h
+           dcmpstat/include/dcmtk/dcmpstat/dviface.h
+           dcmpstat/include/dcmtk/dcmpstat/dvsighdl.h
+           dcmsign/include/dcmtk/dcmsign/dcsignat.h
+           dcmsign/include/dcmtk/dcmsign/sialgo.h
+           dcmsign/include/dcmtk/dcmsign/siautopr.h
+           dcmsign/include/dcmtk/dcmsign/sibrsapr.h
+           dcmsign/include/dcmtk/dcmsign/sicert.h
+           dcmsign/include/dcmtk/dcmsign/sicertvf.h
+           dcmsign/include/dcmtk/dcmsign/sicreapr.h
+           dcmsign/include/dcmtk/dcmsign/sidsa.h
+           dcmsign/include/dcmtk/dcmsign/simac.h
+           dcmsign/include/dcmtk/dcmsign/simaccon.h
+           dcmsign/include/dcmtk/dcmsign/simd5.h
+           dcmsign/include/dcmtk/dcmsign/sinullpr.h
+           dcmsign/include/dcmtk/dcmsign/siprivat.h
+           dcmsign/include/dcmtk/dcmsign/siripemd.h
+           dcmsign/include/dcmtk/dcmsign/sirsa.h
+           dcmsign/include/dcmtk/dcmsign/sisha1.h
+           dcmsign/include/dcmtk/dcmsign/sisha256.h
+           dcmsign/include/dcmtk/dcmsign/sisha384.h
+           dcmsign/include/dcmtk/dcmsign/sisha512.h
+           dcmsign/include/dcmtk/dcmsign/sisprof.h
+           dcmsign/include/dcmtk/dcmsign/sitstamp.h
+           dcmsign/include/dcmtk/dcmsign/sitypes.h
+           dcmtls/include/dcmtk/dcmtls/tlsciphr.h
+           dcmtls/include/dcmtk/dcmtls/tlslayer.h
+           dcmtls/include/dcmtk/dcmtls/tlsopt.h
+           dcmtls/include/dcmtk/dcmtls/tlsscu.h
+           dcmtls/include/dcmtk/dcmtls/tlstrans.h
+           doxygen/htmldocs.cfg
+           oflog/include/dcmtk/oflog/winconap.h
+           ofstd/include/dcmtk/ofstd/ofchrenc.h
+           ofstd/include/dcmtk/ofstd/ofcmdln.h
+           ofstd/include/dcmtk/ofstd/ofconapp.h
+           ofstd/include/dcmtk/ofstd/ofcond.h
+           ofstd/include/dcmtk/ofstd/ofconsol.h
+           ofstd/include/dcmtk/ofstd/offile.h
+           ofstd/include/dcmtk/ofstd/ofgrp.h
+           ofstd/include/dcmtk/ofstd/ofpwd.h
+
+**** Changes from 2018.06.08 (onken)
+
+- Fix dcmseg test for all compilers.
+  Affects: dcmseg/tests/tutils.cc
+
+**** Changes from 2018.06.07 (riesmeier)
+
+- CP-1765 retired DICOMDIR reference to CDA/XML:
+  Labeled Directory Record Type "HL7 STRUC DOC" and two transfer syntaxes as
+  retired. These were used to reference from a DICOMDIR to unencapsulated HL7
+  CDA (Clinical Document Architecture) files on media, i.e. to files in XML
+  format. Referencing Encapsulated CDA documents is still possible, of course.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcdirrec.h
+           dcmdata/include/dcmtk/dcmdata/dcuid.h
+           dcmdata/libsrc/dcdirrec.cc
+
+- Added support for recently approved CPs:
+  Added support for CP-1760 and CP-1762 to the data dictionary.
+  These CPs were approved during this week's DICOM WG-06 meeting.
+  Affects: dcmdata/data/dicom.dic
+           dcmdata/include/dcmtk/dcmdata/dcdeftag.h
+           dcmdata/libsrc/dcdictbi.cc
+
+**** Changes from 2018.06.07 (onken)
+
+- Fixed binary segmentations with rows*cols%8 != 0:
+  Fixed binary segmentations having multiple frames where a single frame
+  has dimensions so that rows*columns is not dividable by 8.
+  Thanks to Andrey Fedorov <andrey.fedorov@gmail.com> for the report and
+  suggestion of a patch.
+  Affects: dcmseg/include/dcmtk/dcmseg/segutils.h
+           dcmseg/libsrc/segdoc.cc
+           dcmseg/libsrc/segutils.cc
+           dcmseg/tests/tutils.cc
+
+**** Changes from 2018.06.04 (eichelberg)
+
+- Introduced upper size limit for A-ASSOCIATE PDUs:
+  Introduced upper size limit for incoming A-ASSOCIATE-RQ and -AC PDUs
+  to avoid denial of service through malformed PDUs causing the network
+  layer to allocate up to 4 GByte of memory. The default limit is 1 MByte.
+  This limit can be modified or disabled through the variable
+  dcmAssociatePDUSizeLimit.
+  Thanks to Klaus Eisentraut <klaus.eisentraut@siemens-healthineers.com>
+  for the bug report.
+  This closes bug #825.
+  Affects: dcmnet/include/dcmtk/dcmnet/cond.h
+           dcmnet/include/dcmtk/dcmnet/dul.h
+           dcmnet/libsrc/cond.cc
+           dcmnet/libsrc/dul.cc
+           dcmnet/libsrc/dulfsm.cc
+
+- Fixed typo in comment.
+  Affects: dcmpstat/apps/dcmpsrcv.cc
+
+- Fixed gcc 8 warning.
+  Affects: dcmnet/libsrc/dulconst.cc
+
+**** Changes from 2018.06.01 (riesmeier)
+
+- Fixed typos in comments.
+  Affects: dcmwlm/libsrc/wldsfs.cc
+
+**** Changes from 2018.06.01 (schlamelcher)
+
+- Fixed C++11 incompatibility in yesterday's commit.
+  Affects: dcmwlm/libsrc/wlfsim.cc
+
+**** Changes from 2018.05.31 (riesmeier)
+
+- Fixed typos in API documentation of new classes.
+  Affects: ofstd/include/dcmtk/ofstd/offilsys.h
+
+- Fixed issue with undefined CMAKE_SYSTEM_VERSION:
+  Fixed issue when CMAKE_SYSTEM_VERSION is empty / undefined, e.g. when
+  cross-compiling on Debian Linux with debhelper.
+  Thanks to Helmut Grohne <helmut@subdivi.de> for the original report and
+  suggested patch.
+  Affects: CMake/dcmtkPrepare.cmake
+
+**** Changes from 2018.05.31 (schlamelcher)
+
+- Simplified and enhanced dcmwlm's code:
+  Replaced lots of hand written code by now existing classes from ofstd, e.g.
+  the custom growable array implementation with manual deletion of the contained
+  pointers with an OFVector containing OFshared_ptrs.
+  Replaced the hand written search for Worklist files with features from the
+  recently introduced ofstd filesystem functionalities (directory entry
+  iteration and path decomposition).
+  Affects: dcmwlm/include/dcmtk/dcmwlm/wlfsim.h
+           dcmwlm/libsrc/wlfsim.cc
+
+- Enhanced ofstd filesystem's unit test:
+  Added a check ensuring all created files are found using OFdirectory_iterator.
+  Added compile time checks for the typedefs using the recently introduced
+  OFstatic_assert.
+  Affects: ofstd/tests/tfilsys.cc
+
+- Introduced support for compile time assertions:
+  Introduced ofassert.h providing OFstatic_assert, which is either a define
+  for static_assert (if available) or a fallback implementation using template
+  specialization.
+  Added:   ofstd/include/dcmtk/ofstd/ofassert.h
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+           CMake/osconfig.h.in
+           config/aclocal.m4
+           config/configure
+           config/configure.in
+           config/include/dcmtk/config/osconfig.h.in
+           ofstd/docs/ofstd.dox
+
+**** Changes from 2018.05.31 (eichelberg)
+
+- Changes to permit compilation with LibreSSL:
+  Changes to permit compilation of DCMTK with LibreSSL, which defines a
+  OPENSSL_VERSION_NUMBER of 2.0 but implements an API that is essentially
+  OpenSSL 1.0.1. Required for compilation on OpenBSD 6.
+  Affects: dcmtls/libsrc/tlsciphr.cc
+           dcmtls/libsrc/tlslayer.cc
+
+**** Changes from 2018.05.31 (f. arizpe-gomez)
+
+- CMake-language style improvements:
+  Changed CMake command names to lower case and removed arguments from block
+  termination commands.
+  Thanks to Hans Johnson (@hjmjohnson) for the contribution.
+  Affects: CMake/3rdparty.cmake
+           CMake/CTest/CTestCustomAndroid.cmake.in
+           CMake/CTest/CTestCustomWine.cmake.in
+           CMake/CTest/dcmtkCTestMacros.cmake
+           CMake/CTest/dcmtkCTestRun.cmake.in
+           CMake/CTest/dcmtkCTestRunAndroid.cmake.in
+           CMake/CTest/dcmtkCTestRunExhaustive.cmake
+           CMake/CTest/dcmtkCTestRunWine.cmake.in
+           CMake/CheckCMakeCommandExists.cmake
+           CMake/CheckFunctionWithHeaderExists.cmake
+           CMake/DCMTKConfig.cmake.in
+           CMake/FindCharset.cmake
+           CMake/FindICONV.cmake
+           CMake/FindICU.cmake
+           CMake/FindSndfile.cmake
+           CMake/FindWrap.cmake
+           CMake/GenerateCMakeExports.cmake
+           CMake/GenerateDCMTKConfigure.cmake
+           CMake/dcmtkAfterModules.cmake
+           CMake/dcmtkMacros.cmake
+           CMake/dcmtkPrepare.cmake
+           CMake/dcmtkTryCompile.cmake
+           CMake/dcmtkTryRun.cmake
+           CMake/dcmtkUseAndroidSDK.cmake
+           CMake/dcmtkUseWine.cmake
+           CMakeLists.txt
+           config/CMakeLists.txt
+           config/docs/CMakeLists.txt
+           dcmdata/CMakeLists.txt
+           dcmdata/apps/CMakeLists.txt
+           dcmdata/data/CMakeLists.txt
+           dcmdata/docs/CMakeLists.txt
+           dcmdata/include/CMakeLists.txt
+           dcmdata/libsrc/CMakeLists.txt
+           dcmfg/CMakeLists.txt
+           dcmfg/include/CMakeLists.txt
+           dcmimage/CMakeLists.txt
+           dcmimage/apps/CMakeLists.txt
+           dcmimage/include/CMakeLists.txt
+           dcmimgle/CMakeLists.txt
+           dcmimgle/apps/CMakeLists.txt
+           dcmimgle/data/CMakeLists.txt
+           dcmimgle/include/CMakeLists.txt
+           dcmiod/CMakeLists.txt
+           dcmiod/include/CMakeLists.txt
+           dcmjpeg/CMakeLists.txt
+           dcmjpeg/apps/CMakeLists.txt
+           dcmjpeg/include/CMakeLists.txt
+           dcmjpeg/libsrc/CMakeLists.txt
+           dcmjpls/CMakeLists.txt
+           dcmjpls/apps/CMakeLists.txt
+           dcmjpls/include/CMakeLists.txt
+           dcmjpls/libcharls/CMakeLists.txt
+           dcmjpls/libsrc/CMakeLists.txt
+           dcmnet/CMakeLists.txt
+           dcmnet/apps/CMakeLists.txt
+           dcmnet/docs/CMakeLists.txt
+           dcmnet/etc/CMakeLists.txt
+           dcmnet/include/CMakeLists.txt
+           dcmpmap/CMakeLists.txt
+           dcmpmap/include/CMakeLists.txt
+           dcmpstat/CMakeLists.txt
+           dcmpstat/apps/CMakeLists.txt
+           dcmpstat/data/CMakeLists.txt
+           dcmpstat/etc/CMakeLists.txt
+           dcmpstat/include/CMakeLists.txt
+           dcmqrdb/CMakeLists.txt
+           dcmqrdb/apps/CMakeLists.txt
+           dcmqrdb/docs/CMakeLists.txt
+           dcmqrdb/etc/CMakeLists.txt
+           dcmqrdb/include/CMakeLists.txt
+           dcmrt/CMakeLists.txt
+           dcmrt/include/CMakeLists.txt
+           dcmseg/CMakeLists.txt
+           dcmseg/include/CMakeLists.txt
+           dcmsign/CMakeLists.txt
+           dcmsign/include/CMakeLists.txt
+           dcmsr/CMakeLists.txt
+           dcmsr/apps/CMakeLists.txt
+           dcmsr/data/CMakeLists.txt
+           dcmsr/include/CMakeLists.txt
+           dcmtls/CMakeLists.txt
+           dcmtls/docs/CMakeLists.txt
+           dcmtls/include/CMakeLists.txt
+           dcmtract/CMakeLists.txt
+           dcmtract/include/CMakeLists.txt
+           dcmwlm/CMakeLists.txt
+           dcmwlm/apps/CMakeLists.txt
+           dcmwlm/data/CMakeLists.txt
+           dcmwlm/include/CMakeLists.txt
+           doxygen/CMakeLists.txt
+           oflog/CMakeLists.txt
+           oflog/etc/CMakeLists.txt
+           oflog/include/CMakeLists.txt
+           oflog/libsrc/CMakeLists.txt
+           ofstd/CMakeLists.txt
+           ofstd/include/CMakeLists.txt
+           ofstd/tests/CMakeLists.txt
+
+- Made const pointers for interface of core:
+  Introduced const modifier to several classes to prevent unintentional
+  modification of data, to enable additional warnings and to make it easier to
+  see possible side effects.
+  Thanks to Hans Johnson (@hjmjohnson) for the contribution.
+  Affects: dcmimgle/include/dcmtk/dcmimgle/diovpln.h
+           dcmimgle/libsrc/diovpln.cc
+           dcmjpeg/libijg12/jcpred.c
+           dcmjpeg/libijg12/jcscale.c
+           dcmjpeg/libijg12/jcshuff.c
+           dcmjpeg/libijg12/jdct12.h
+           dcmjpeg/libijg12/jdmarker.c
+           dcmjpeg/libijg12/jdpred.c
+           dcmjpeg/libijg12/jdscale.c
+           dcmjpeg/libijg12/jidctred.c
+           dcmjpeg/libijg12/jquant2.c
+           dcmjpeg/libijg16/jcpred.c
+           dcmjpeg/libijg16/jcscale.c
+           dcmjpeg/libijg16/jcshuff.c
+           dcmjpeg/libijg16/jdct16.h
+           dcmjpeg/libijg16/jdmarker.c
+           dcmjpeg/libijg16/jdpred.c
+           dcmjpeg/libijg16/jdscale.c
+           dcmjpeg/libijg16/jidctred.c
+           dcmjpeg/libijg16/jquant2.c
+           dcmjpeg/libijg8/jcpred.c
+           dcmjpeg/libijg8/jcscale.c
+           dcmjpeg/libijg8/jcshuff.c
+           dcmjpeg/libijg8/jdct8.h
+           dcmjpeg/libijg8/jdmarker.c
+           dcmjpeg/libijg8/jdpred.c
+           dcmjpeg/libijg8/jdscale.c
+           dcmjpeg/libijg8/jidctred.c
+           dcmjpeg/libijg8/jquant2.c
+           dcmseg/include/dcmtk/dcmseg/segutils.h
+           dcmseg/libsrc/segutils.cc
+           ofstd/include/dcmtk/ofstd/ofxml.h
+           ofstd/libsrc/ofxml.cc
+
+**** Changes from 2018.05.30 (eichelberg)
+
+- Added OFStandard::snprintf() and vsnprintf():
+  Added implementations of snprintf() and vsnprintf() in class OFStandard
+  and a unit test that checks the correct truncation and return value.
+  Affects: config/docs/macros.txt
+           ofstd/include/dcmtk/ofstd/ofstd.h
+           ofstd/libsrc/ofstd.cc
+           ofstd/tests/tests.cc
+           ofstd/tests/tofstd.cc
+
+**** Changes from 2018.05.28 (schlamelcher)
+
+- Enhanced Doxygen documentation:
+  Corrected some typos and added missing Doxygen commands in/to the
+  documentation for ofstd filesystem.
+  Hid some implementation details from Doxygen that made Doxygen clutter the
+  generated pages with useless information.
+  Added several missing classes to the ofstd module documentation Doxygen page.
+  Affects: ofstd/docs/ofstd.dox
+           ofstd/include/dcmtk/ofstd/offilsys.h
+
+- More fixes for ofstd filesystem:
+  Fixed incompatible member initialization (older Visual Studio versions).
+  Workaround for implicit OFpath constructor not being selected (MinGW).
+  Affects: ofstd/libsrc/offilsys.cc
+
+**** Changes from 2018.05.28 (eichelberg)
+
+- Fixed incorrect strlcpy buffer size:
+  Fixed incorrect strlcpy buffer size introduced with commit d92d5d1f.
+  Affects: dcmwlm/libsrc/wlfsim.cc
+
+**** Changes from 2018.05.26 (eichelberg)
+
+- Fixed missing end of comment.
+  Affects: ofstd/include/dcmtk/ofstd/offilsys.h
+
+**** Changes from 2018.05.26 (schlamelcher)
+
+- Minor fixes for previous commit:
+  Added missing include for assert().
+  Changed an array initialization to a syntax even old clang accepts.
+  Affects: ofstd/libsrc/offilsys.cc
+
+**** Changes from 2018.05.25 (schlamelcher)
+
+- Introduced a subset of std::filesystem for ofstd:
+  Introduced the new header file ofstd/offilsys.h currently providing the
+  classes OFpath, OFdirectory_entry and OFdirectory_iterator as portable
+  implementations for the respective C++17 STL classes.
+  The implementations are still incomplete, only a subset of the functionality
+  was implemented that will be used in a follow-up commit.
+  Added:   ofstd/include/dcmtk/ofstd/offilsys.h
+           ofstd/libsrc/offilsys.cc
+           ofstd/tests/tfilsys.cc
+  Affects: ofstd/include/dcmtk/ofstd/offile.h
+           ofstd/libsrc/CMakeLists.txt
+           ofstd/libsrc/Makefile.in
+           ofstd/libsrc/offile.cc
+           ofstd/tests/CMakeLists.txt
+           ofstd/tests/Makefile.in
+           ofstd/tests/tests.cc
+
+**** Changes from 2018.05.25 (eichelberg)
+
+- Added missing include statement.
+  Affects: dcmtls/libsrc/tlsscu.cc
+
+**** Changes from 2018.05.24 (eichelberg)
+
+- Fixed minor warnings.
+  Affects: dcmjpeg/libijg16/jccolor.c
+           dcmpstat/libsrc/dvpsmsg.cc
+           dcmtls/libsrc/tlsscu.cc
+
+**** Changes from 2018.05.17 (eichelberg)
+
+- Undefine isinf() macro if defined:
+  On some platforms, such as OpenIndiana, isinf() is defined as a macro,
+  and that inteferes with the OFMath function of the same name.
+  Undefine macro if defined to prevent a compiler error.
+  Affects: ofstd/tests/tlimits.cc
+
+- Changed DVPSIPCMessage::resizePayload parameter type:
+  Changed DVPSIPCMessage::resizePayload parameter type to size_t,
+  which fixes a warning on Visual Studio x64.
+  Affects: dcmpstat/include/dcmtk/dcmpstat/dvpsmsg.h
+           dcmpstat/libsrc/dvpsmsg.cc
+
+- Added logger to module dcmsign:
+  Added logger to module dcmsign. Create a warning message on the logger when
+  dumping the byte stream for the MAC algorithm to file (which is a function
+  intended for debugging) fails.
+  Affects: dcmsign/include/dcmtk/dcmsign/sitypes.h
+           dcmsign/libsrc/simaccon.cc
+           dcmsign/libsrc/sitypes.cc
+
+**** Changes from 2018.05.16 (eichelberg)
+
+- Moved declaration of global variables for libwrap:
+  Moved the declaration of the two global variables expected by libwrap,
+  "deny_severity" and "allow_severity", to an implementation file that does
+  NOT include <tcpd.h> to avoid compiler errors due to inconsistencies
+  in linker scoping when building shared libraries. Needed when building
+  shared libraries with Sun-C++ 5.15 on Solaris.
+  Affects: dcmnet/libsrc/dcmlayer.cc
+           dcmnet/libsrc/dwrap.c
+
+**** Changes from 2018.05.13 (riesmeier)
+
+- Adapted code for recent API change (DEBUG mode):
+  Adapted code for recent API change introduced with commit e4f7026. As a
+  result of this change the tool "dcmqridx" did not compile when the macro
+  DEBUG was defined.
+  Affects: dcmqrdb/apps/dcmqridx.cc
+
+**** Changes from 2018.05.12 (eichelberg)
+
+- Fixed minor bug introduced with last commit.
+  Affects: dcmqrdb/libsrc/dcmqrtis.cc
+
+**** Changes from 2018.05.11 (eichelberg)
+
+- Replaced strcpy by OFStandard::strlcpy:
+  Replaced strcpy by OFStandard::strlcpy and adapted APIs where necessary,
+  i.e. where char * output parameters were passed to a function without
+  size information, and a string was copied to that parameter.
+  Affects: dcmnet/apps/movescu.cc
+           dcmnet/apps/storescp.cc
+           dcmnet/apps/storescu.cc
+           dcmnet/include/dcmtk/dcmnet/assoc.h
+           dcmnet/include/dcmtk/dcmnet/diutil.h
+           dcmnet/libsrc/assoc.cc
+           dcmnet/libsrc/dfindscu.cc
+           dcmnet/libsrc/dimecho.cc
+           dcmnet/libsrc/dimfind.cc
+           dcmnet/libsrc/dimget.cc
+           dcmnet/libsrc/dimmove.cc
+           dcmnet/libsrc/dimstore.cc
+           dcmnet/libsrc/diutil.cc
+           dcmnet/libsrc/dulconst.cc
+           dcmnet/libsrc/dulfsm.cc
+           dcmnet/libsrc/dulpres.cc
+           dcmnet/libsrc/scp.cc
+           dcmpstat/apps/dcmpsrcv.cc
+           dcmpstat/apps/dcmpssnd.cc
+           dcmpstat/libsrc/dviface.cc
+           dcmpstat/libsrc/dvpsprt.cc
+           dcmqrdb/apps/dcmqridx.cc
+           dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdba.h
+           dcmqrdb/include/dcmtk/dcmqrdb/dcmqrdbi.h
+           dcmqrdb/libsrc/dcmqrcbg.cc
+           dcmqrdb/libsrc/dcmqrcbm.cc
+           dcmqrdb/libsrc/dcmqrcbs.cc
+           dcmqrdb/libsrc/dcmqrdbi.cc
+           dcmqrdb/libsrc/dcmqrptb.cc
+           dcmqrdb/libsrc/dcmqrsrv.cc
+           dcmqrdb/libsrc/dcmqrtis.cc
+           dcmwlm/libsrc/wlmactmg.cc
+
+**** Changes from 2018.05.10 (eichelberg)
+
+- Replaced strcpy by OFStandard::strlcpy.
+  Affects: dcmdata/apps/dcmdump.cc
+           dcmnet/apps/movescu.cc
+           dcmnet/apps/storescp.cc
+           dcmnet/apps/storescu.cc
+           dcmnet/libsrc/assoc.cc
+           dcmnet/libsrc/dul.cc
+           dcmpstat/apps/dcmpsrcv.cc
+           dcmpstat/apps/dcmpssnd.cc
+           dcmpstat/libsrc/dvpsmsg.cc
+           dcmpstat/libsrc/dvpspr.cc
+           dcmqrdb/libsrc/dcmqrtis.cc
+           dcmwlm/libsrc/wlfsim.cc
+
+- Changes for OpenSSL without ECDH support:
+  Implemented changes to the dcmtls code that permit DCMTK to be compiled
+  with OpenSSL versions where ECDH (Elliptic Curve Diffie Hellman) has been
+  disabled at compile time (OPENSSL_NO_ECDH), such as the version delivered
+  with Solaris 11.
+  Affects: dcmtls/libsrc/tlslayer.cc
+
+- Added export declaration for deny_/allow_severity:
+  Added export declaration for deny_severity / allow_severity, which is needed
+  when building shared libraries with libwrap enabled.
+  Affects: dcmnet/libsrc/dwrap.c
+
+**** Changes from 2018.05.07 (riesmeier)
+
+- Fixed bug introduced with last commit:
+  Fixed wrong buffer size introduced with last commit when the call of strcat()
+  was replaced by OFStandard::strlcat().
+  Now, all tests in "ofstd" and "dcmdata" should pass again.
+  Affects: ofstd/libsrc/oftime.cc
+
+- Fixed "unused result warning" on fwrite() calls:
+  Fixed "unused result warning" on some fwrite() calls by checking the return
+  value. This warning used to appear with gcc on some Debian/GNU Linux systems
+  (where the flag -Wunused-result is set by default).
+  Thanks to Mathieu Malaterre <mathieu.malaterre@gmail.com> for the report and
+  suggested fix.
+  This closes DCMTK Patch #582.
+  Affects: dcmdata/libsrc/dcvrobow.cc
+           dcmimage/libsrc/dicoimg.cc
+           dcmimgle/libsrc/diimage.cc
+           dcmimgle/libsrc/dimoimg.cc
+           dcmpstat/apps/dcmp2pgm.cc
+           dcmsign/libsrc/dcsignat.cc
+           dcmsign/libsrc/simaccon.cc
+
+**** Changes from 2018.05.06 (eichelberg)
+
+- Replaced strcat by OFStandard::strlcat.
+  Affects: dcmimgle/libsrc/diimage.cc
+           dcmnet/libsrc/dimcmd.cc
+           dcmpstat/apps/dcmmklut.cc
+           dcmpstat/libsrc/dvpsda.cc
+           dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbm.h
+           dcmqrdb/libsrc/dcmqrcbg.cc
+           dcmqrdb/libsrc/dcmqrcbm.cc
+           dcmqrdb/libsrc/dcmqrdbi.cc
+           ofstd/libsrc/oftime.cc
+
+- Added DLL export symbols.
+  Affects: ofstd/include/dcmtk/ofstd/ofrand.h
+           ofstd/libsrc/ofrand.cc
+
+**** Changes from 2018.05.05 (eichelberg)
+
+- Replaced strcpy by OFStandard::strlcpy.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcdirrec.h
+           dcmdata/libsrc/cmdlnarg.cc
+           dcmdata/libsrc/dcdicent.cc
+           dcmdata/libsrc/dcdict.cc
+           dcmdata/libsrc/dcdirrec.cc
+           dcmdata/libsrc/dctag.cc
+           dcmdata/libsrc/dctagkey.cc
+           dcmdata/libsrc/mkdeftag.cc
+           ofstd/libsrc/offname.cc
+           ofstd/libsrc/ofstd.cc
+           ofstd/libsrc/ofstring.cc
+
+- Completed conversion to OFRandom.
+  Affects: dcmdata/tests/tpread.cc
+           ofstd/tests/toffile.cc
+
+- Modified code to use OFRandom instead of srand/rand:
+  Modified all code in DCMTK to use OFRandom instead of srand()/rand(),
+  which is known to produce low-quality pseudo number randoms on some platforms.
+  Affects: dcmdata/tests/tpread.cc
+           dcmiod/tests/tcielabutil.cc
+           dcmpstat/apps/dcmmklut.cc
+           ofstd/include/dcmtk/ofstd/ofuuid.h
+           ofstd/libsrc/ofuuid.cc
+           ofstd/tests/toffile.cc
+
+- Implemented cryptographically secure ISAAC PRNG:
+  Implemented class OFRandom, a cryptographically secure pseudo random number
+  generator based on the ISAAC algorithm (Indirection, Shift, Accumulate,
+  Add, and Count) and its public domain reference implementation by Bob Jenkins.
+  Added:   ofstd/include/dcmtk/ofstd/ofrand.h
+           ofstd/libsrc/ofrand.cc
+  Affects: ofstd/libsrc/CMakeLists.txt
+           ofstd/libsrc/Makefile.in
+
+**** Changes from 2018.05.04 (riesmeier)
+
+- Fixed wrong reference to "dcmsend" tool:
+  Replaced all occurrences of "dcmsend" with "echoscu" (copy and paste error
+  introduced by the last commit).
+  Affects: dcmnet/docs/echoscu.man
+
+**** Changes from 2018.05.04 (f. arizpe-gomez)
+
+- Documented exit codes in echoscu manpage:
+  This closes bug #832.
+  Affects: dcmnet/docs/echoscu.man
+           doxygen/manpages/man1/echoscu.1
+
+- Fixed wrong return status and exit codes for echoscu:
+  The echoscu application falsely indicated success after logging a fatal error
+  when the peer requested the release. Proper exit codes are now defined and
+  included.
+  This closes bug #832.
+  Affects: dcmnet/apps/echoscu.cc
+
+**** Changes from 2018.05.04 (eichelberg)
+
+- Minor cleanup in echoscu.
+  Affects: dcmnet/apps/echoscu.cc
+
+**** Changes from 2018.05.03 (riesmeier)
+
+- Introduced header file for common exit codes:
+  Introduced header file with definitions of common exit codes. Further codes
+  can be defined for the respective DCMTK modules or tools. Please note that
+  there are predefined ranges that should be observed, e.g. 60-79 for network
+  errors.
+  Added:   ofstd/include/dcmtk/ofstd/ofexit.h
+  Affects: dcmnet/apps/dcmrecv.cc
+           dcmnet/apps/dcmsend.cc
+           dcmnet/apps/movescu.cc
+           ofstd/include/dcmtk/ofstd/ofconapp.h
+           ofstd/libsrc/ofconapp.cc
+
+**** Changes from 2018.05.02 (riesmeier)
+
+- Fixed possible issue with scaled overlays:
+  Fixed possible issue when scaling down small overlays such that their width
+  and/or height becomes 0 (and, therefore, the calculated buffer size is also
+  0). This could result in an abnormal program termination on some systems.
+  Thanks to Christian Wetzel <wetzel@phoenix-pacs.de> for the report and
+  suggested fix.
+  Affects: dcmimgle/libsrc/diovlay.cc
+
+- Removed addOption() flag AF_NoWarning:
+  Removed flag OFCommandLine::AF_NoWarning from addOption() call since it is
+  no longer needed (options --add-cert-file and --add-cert-dir are checked
+  anyway).
+  Affects: dcmtls/libsrc/tlsopt.cc
+
+- Fixed typos, tab characters, trailing spaces, etc:
+  Fixed various typos, replaced tab characters by spaces, removed trailing
+  spaces and other minor issues.
+  Affects: INSTALL
+           dcmnet/apps/echoscu.cc
+           dcmnet/apps/findscu.cc
+           dcmnet/docs/echoscu.man
+           dcmnet/docs/findscu.man
+           dcmnet/docs/storescp.man
+           dcmnet/docs/storescu.man
+           dcmpstat/apps/dcmprscp.cc
+           dcmpstat/apps/dcmprscu.cc
+           dcmpstat/apps/dcmpsrcv.cc
+           dcmpstat/apps/dcmpssnd.cc
+           dcmpstat/etc/dcmpstat.cfg
+           dcmpstat/libsrc/dvpsfs.cc
+           dcmtls/docs/ciphers.txt
+           dcmtls/docs/randseed.txt
+           dcmtls/include/dcmtk/dcmtls/tlsciphr.h
+           dcmtls/include/dcmtk/dcmtls/tlslayer.h
+           dcmtls/include/dcmtk/dcmtls/tlsopt.h
+           dcmtls/include/dcmtk/dcmtls/tlsscu.h
+           dcmtls/include/dcmtk/dcmtls/tlstrans.h
+           dcmtls/libsrc/tlsciphr.cc
+           dcmtls/libsrc/tlslayer.cc
+           dcmtls/libsrc/tlsopt.cc
+           dcmtls/libsrc/tlsscu.cc
+           dcmtls/libsrc/tlstrans.cc
+
+**** Changes from 2018.05.02 (eichelberg)
+
+- Added Perl script with dcmtls test suite:
+  Added Perl script that provides a temporary functional
+  (integration) test suite for module dcmtls.
+  Added:   dcmtls/tests/dcmtls_testsuite_run.pl
+
+- Added Perl script that generates test files:
+  Added Perl script that generates a set of test files for the functional
+  (integration) test suite for module dcmtls.
+  Added:   dcmtls/tests/dcmtls_testsuite_generate.pl
+
+- Fixed read mode for certificate files to binary:
+  Fixed read mode for loading certificates from file to binary.
+  Needed for certificates in DER format on Windows.
+  Affects: dcmtls/libsrc/tlslayer.cc
+
+**** Changes from 2018.05.01 (eichelberg)
+
+- Fixed description regarding OpenSSL 1.1.0 and newer:
+  Fixed description on how to enable weak ciphers in OpenSSL 1.1.0 and newer.
+  Affects: dcmtls/docs/ciphers.txt
+
+- Enabled NULL ciphers on OpenSSL 1.1.0 and newer:
+  On OpenSSL 1.1.0 and newer, an explicit call to SSL_CTX_set_security_level()
+  is needed to enable the unencrypted "NULL" ciphers.
+  Affects: dcmtls/libsrc/tlslayer.cc
+
+**** Changes from 2018.04.29 (eichelberg)
+
+- Major revision of TLS code implementing Suppl. 204:
+  Major revision of the TLS code in DCMTK (module dcmtls and related command
+  line tools) implementing DICOM Supplement 204 "TLS Security Profiles".
+  Selection of TLS ciphersuites is now based on security profiles, and
+  DCMTK now implements the recommendations of BCP 195 / RFC 7525.
+  Added:   dcmtls/include/dcmtk/dcmtls/tlsciphr.h
+           dcmtls/libsrc/tlsciphr.cc
+  Affects: INSTALL
+           dcmnet/apps/echoscu.cc
+           dcmnet/apps/findscu.cc
+           dcmnet/apps/storescp.cc
+           dcmnet/apps/storescu.cc
+           dcmnet/docs/echoscu.man
+           dcmnet/docs/findscu.man
+           dcmnet/docs/storescp.man
+           dcmnet/docs/storescu.man
+           dcmnet/include/dcmtk/dcmnet/dcmlayer.h
+           dcmnet/libsrc/dul.cc
+           dcmpstat/apps/dcmprscp.cc
+           dcmpstat/apps/dcmprscu.cc
+           dcmpstat/apps/dcmpsrcv.cc
+           dcmpstat/apps/dcmpssnd.cc
+           dcmpstat/etc/dcmpstat.cfg
+           dcmpstat/etc/printers.cfg
+           dcmpstat/include/dcmtk/dcmpstat/dvpscf.h
+           dcmpstat/libsrc/dviface.cc
+           dcmpstat/libsrc/dvpscf.cc
+           dcmtls/docs/ciphers.txt
+           dcmtls/docs/dcmtls.dox
+           dcmtls/include/dcmtk/dcmtls/tlslayer.h
+           dcmtls/include/dcmtk/dcmtls/tlsopt.h
+           dcmtls/include/dcmtk/dcmtls/tlsscu.h
+           dcmtls/include/dcmtk/dcmtls/tlstrans.h
+           dcmtls/libsrc/CMakeLists.txt
+           dcmtls/libsrc/Makefile.in
+           dcmtls/libsrc/tlscond.cc
+           dcmtls/libsrc/tlslayer.cc
+           dcmtls/libsrc/tlsopt.cc
+           dcmtls/libsrc/tlsscu.cc
+           dcmtls/libsrc/tlstrans.cc
+
+**** Changes from 2018.04.27 (schlamelcher)
+
+- Fixed an issue in dcmwlm / universal matching:
+  Fixed dcmwlm's IsUniversalMatch() function for sequences was ignoring when
+  wild card matching was forbidden for a certain attribute by the definition in
+  the standard (not honoring the respective argument already passed to the
+  function).
+  Affects: dcmwlm/include/dcmtk/dcmwlm/wlfsim.h
+           dcmwlm/libsrc/wlfsim.cc
+
+- Minor language and coding style fixes in dcmwlm.
+  Affects: dcmwlm/include/dcmtk/dcmwlm/wlfsim.h
+           dcmwlm/libsrc/wlfsim.cc
+
+- Added a missing test for universal matching:
+  Added a missing test for universal matching before performing combined
+  matching. The missing test was so far not a bug since the only existing
+  combination is for combined date time matching, in which case the only
+  possible universal match is an empty date or time.
+  This was already accounted for in the actual matching implementation, so this
+  commit is only for preventing bad surprises in the future where other types of
+  matching combinations might be defined.
+  Affects: dcmwlm/libsrc/wlfsim.cc
+
+- Enhanced combined date time range matching:
+  Combined date time range matching now falls back to individually matching the
+  date and time components instead of failing the match in case the date range
+  is structurally different than the time range (e.g. matching against a certain
+  day and a range of two points in time).
+  Thanks to Savvas Metallidis <savvas.metallidis@infomedcs.com> for reporting
+  the issue.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcmatch.h
+           dcmdata/libsrc/dcmatch.cc
+
+**** Changes from 2018.04.27 (eichelberg)
+
+- Another fix for the OpenSSL version test on Windows.
+  Affects: CMake/3rdparty.cmake
+
+- Fixed OpenSSL version test on Windows:
+  Fixed OpenSSL version test on Windows, where the manually defined
+  include directory was not used during execution of the test.
+  Affects: CMake/3rdparty.cmake
+
+**** Changes from 2018.04.18 (riesmeier)
+
+- Fixed possible "use after scope" issue:
+  Fixed possible "use after scope" issue in transfer syntax map, which is used
+  for the association negotiation profiles. That means, a local variable might
+  be used after its scope by referring to it by means of a pointer. This issue
+  has been found by the tool AddressSanitizer.
+  Thanks to Klaus Eisentraut <klaus.eisentraut@siemens-healthineers.com>
+  for the bug report.
+  Affects: dcmnet/libsrc/dccftsmp.cc
+
+**** Changes from 2018.04.18 (onken)
+
+- Fixed RGB to DICOM Lab color conversion.
+  Affects: dcmiod/libsrc/cielabutil.cc
+
+**** Changes from 2018.04.13 (riesmeier)
+
+- Added support for Encapsulated STL Storage SOP:
+  Added minimal support for the Encapsulated STL Storage SOP Class, which was
+  introduced with Supplement 205. That means, the UID definition is now
+  available to both users of the various network tools and programmers (using
+  DCMTK's API). Also the DICOMDIR generation class has been updated accordingly.
+  This closes DCMTK Conformance #822.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcuid.h
+           dcmdata/libsrc/dcddirif.cc
+           dcmdata/libsrc/dcuid.cc
+           dcmnet/docs/movescu.man
+           dcmnet/etc/storescp.cfg
+           dcmnet/etc/storescu.cfg
+           dcmqrdb/docs/dcmqrscp.man
+           dcmqrdb/etc/dcmqrprf.cfg
+
+**** Changes from 2018.04.12 (riesmeier)
+
+- Updated Context Group classes for DICOM 2018b:
+  Updated automatically generated Context Group classes for the 2018b edition
+  of the DICOM standard. There were only changes to CID 4021 and 7453.
+  Affects: dcmsr/include/dcmtk/dcmsr/cmr/cid4021.h
+           dcmsr/include/dcmtk/dcmsr/cmr/cid7453.h
+           dcmsr/libcmr/cid4021.cc
+           dcmsr/libcmr/cid7453.cc
+
+- Updated code definitions for DICOM 2018b:
+  Updated automatically generated code definitions for coding scheme "DCM" and
+  "NCIt". For "UMLS", there were no changes (compared to the previous edition).
+  Affects: dcmsr/include/dcmtk/dcmsr/codes/dcm.h
+           dcmsr/include/dcmtk/dcmsr/codes/ncit.h
+
+- Updated data dictionary for DICOM 2018b:
+  Updated data dictionary for the latest edition of the DICOM standard, which
+  has been released yesterday.
+  Affects: dcmdata/data/dicom.dic
+           dcmdata/include/dcmtk/dcmdata/dcdeftag.h
+           dcmdata/libsrc/dcdictbi.cc
+
+**** Changes from 2018.04.10 (onken)
+
+- Make some parameters const in ASC_ methods:
+  Thanks to Peter Klotz <Peter.Klotz@ith-icoserve.com> for report and
+  patch.
+  Affects: dcmnet/include/dcmtk/dcmnet/assoc.h
+           dcmnet/libsrc/assoc.cc
+
+**** Changes from 2018.04.09 (eichelberg)
+
+- Link OpenSSL against libdl if available:
+  Link OpenSSL against libdl if available as some OpenSSL versions require this.
+  Affects: CMake/3rdparty.cmake
+
+**** Changes from 2018.04.06 (eichelberg)
+
+- Reverted to OpenSSL version test to 1.0.1 as minimum:
+  Reverted to OpenSSL version test to 1.0.1 as minimum because apparently
+  several Linux distributions still use this version and maintain their
+  own security fixes for this version independent of the OpenSSL project.
+  Affects: CMake/3rdparty.cmake
+           config/configure
+           config/configure.in
+
+**** Changes from 2018.04.03 (eichelberg)
+
+- Updated OpenSSL version test to 1.0.2 as minimum:
+  Updated the OpenSSL version test to require version 1.0.2 or newer,
+  since the OpenSSL team recommends that versions older than 1.0.2
+  should not be used anymore. Also fixed an include path problem
+  in CMake version of the test.
+  Affects: CMake/3rdparty.cmake
+           config/configure
+           config/configure.in
+
+**** Changes from 2018.04.02 (onken)
+
+- Use POLLOUT if connect() returns EINPROGRESS:
+  Since lately DCMTK networking uses poll() if available to handle network
+  connections. When starting a connection() using connect, it may return
+  EINPROGRESS indicating to try again later using poll() to write data to
+  the socket. Writing though requires the POLLOUT flag in poll(), not
+  POLLIN as it has been used so far.
+  Thanks to github user sercxjo for the report and patch.
+  Affects: dcmnet/libsrc/dulfsm.cc
+
+**** Changes from 2018.03.31 (eichelberg)
+
+- Added OpenSSL version check to configure/CMake:
+  Added OpenSSL version check to configure/CMake. OpenSSL support will be
+  disabled if an outdated version of OpenSSL prior to version 1.0.1 is detected.
+  Affects: CMake/3rdparty.cmake
+           config/configure
+           config/configure.in
+
+**** Changes from 2018.03.30 (onken)
+
+- Updated copyright for last commits.
+  Affects: dcmnet/libsrc/dimcmd.cc
+           dcmnet/libsrc/dulparse.cc
+
+- Fix possible bypass of length check:
+  For huge elements, it is possible that (int)elem->getLength() overflows.
+  For example, an element with length 2164260863 is interpreted as
+  -2130706433. This allows to wrongly pass the length check.
+  Fix this by moving the check to the other size and casting maxlen
+  instead. This is safe since the maxlen value is an integer constant in
+  all callers.
+  Thanks to Uli Schlachter<psychon@znc.in> for the report and patch.
+  Affects: dcmnet/libsrc/dimcmd.cc
+
+- Fix underflow in networking code:
+  The amount of data in a PDV is the PDV's length field minus two, since
+  there are two bytes of other data. However, the code did not check that
+  the calculation pdvLength-2 did not underflow. This results in passing
+  incorrect huge buffer sizes to other functions later on which thus read
+  beyond the end of the buffer.
+  Thanks to Uli Schlachter<psychon@znc.inc> for the report and patch.
+  Affects: dcmnet/libsrc/dulfsm.cc
+
+- Fix possible crash if network data is malformed:
+  This fixes possible crashes that would exploit the same issue (missing
+  check of return value) fixed with the last commit.
+  Thanks to Uli Schlachter<psychon@znc.in> for the report and patch.
+  Affects: dcmnet/libsrc/dulparse.cc
+
+- Fix posible crash if network data is malformed:
+  If an unknown's item length field was larger than the available amount
+  of data, parseDummy() would detect this error and report it, but the
+  caller would ignore this and continue anyway.
+  The following OFStandard::safeSubtract() would not catch the error with
+  carefully chosen values: parseDummy() adds 4 to the two-byte length
+  field that is read from the package. This allows to construct a value
+  that does not fit into unsigned short. Thus, the pointer buf gets
+  incremented by 65538 while userLength would only get the value three
+  subtracted.
+  This commit fixes both of the above, but either one would be enough to
+  fix the issue.
+  Thanks to Uli Schlachter <psychon@znc.in> for the report and patch.
+  Affects: dcmnet/libsrc/dulparse.cc
+
+- Added support for CP-1650 (support JWT User ID):
+  Added support for CP-1650 which introduces support for JSON Web Tokens
+  (JWT) in DICOM User Identity Negotiation.
+  This closes DCMTK Conformance #820.
+  Affects: dcmnet/apps/storescu.cc
+           dcmnet/docs/storescu.man
+           dcmnet/include/dcmtk/dcmnet/assoc.h
+           dcmnet/include/dcmtk/dcmnet/dcuserid.h
+           dcmnet/libsrc/assoc.cc
+           dcmnet/libsrc/dcuserid.cc
+
+**** Changes from 2018.03.28 (riesmeier)
+
+- Added support for recently approved CPs:
+  Added support for CP-1224, CP-1713 and CP-1740 to the data dictionary.
+  These CPs were approved during last week's DICOM WG-06 meeting.
+  Affects: dcmdata/data/dicom.dic
+           dcmdata/include/dcmtk/dcmdata/dcdeftag.h
+           dcmdata/libsrc/dcdictbi.cc
+
+**** Changes from 2018.03.26 (eichelberg)
+
+- Permit external access to byte offsets in DICOM file:
+  Added methods that provide external access to the byte offset in file
+  information stored when reading a DICOM dataset from file for elements
+  where reading of the value field is postponed due to element size.
+  Based on a patch by Holger Kunze <holger.hk.kunze@siemens-healthineers.com>
+  Affects: dcmdata/include/dcmtk/dcmdata/dcelem.h
+           dcmdata/include/dcmtk/dcmdata/dcistrma.h
+           dcmdata/include/dcmtk/dcmdata/dcistrmf.h
+
+**** Changes from 2018.03.22 (riesmeier)
+
+- Added missing comparison operators "==" and "!=":
+  Added comparison operator==() and operator!=() to the following classes:
+  DSRSCoord3DTreeNode, DSRSpatialCoordinates3DValue, DSRByReferenceTreeNode,
+  DSRIncludedTemplateTreeNode. Also added tests for the latter two.
+  Affects: dcmsr/include/dcmtk/dcmsr/dsrreftn.h
+           dcmsr/include/dcmtk/dcmsr/dsrsc3tn.h
+           dcmsr/include/dcmtk/dcmsr/dsrsc3vl.h
+           dcmsr/include/dcmtk/dcmsr/dsrtpltn.h
+           dcmsr/libsrc/dsrreftn.cc
+           dcmsr/libsrc/dsrsc3tn.cc
+           dcmsr/libsrc/dsrsc3vl.cc
+           dcmsr/libsrc/dsrtpltn.cc
+           dcmsr/tests/Makefile.dep
+           dcmsr/tests/tsrdoctr.cc
+
+- Avoided "double typecast" in comparison operators.
+  Affects: dcmsr/libsrc/dsrcodtn.cc
+           dcmsr/libsrc/dsrcomtn.cc
+           dcmsr/libsrc/dsrcontn.cc
+           dcmsr/libsrc/dsrdattn.cc
+           dcmsr/libsrc/dsrdtitn.cc
+           dcmsr/libsrc/dsrimgtn.cc
+           dcmsr/libsrc/dsrnumtn.cc
+           dcmsr/libsrc/dsrpnmtn.cc
+           dcmsr/libsrc/dsrscotn.cc
+           dcmsr/libsrc/dsrtcotn.cc
+           dcmsr/libsrc/dsrtextn.cc
+           dcmsr/libsrc/dsrtimtn.cc
+           dcmsr/libsrc/dsruidtn.cc
+           dcmsr/libsrc/dsrwavtn.cc
+
+**** Changes from 2018.03.22 (onken)
+
+- Simplified cast.
+  Affects: dcmiod/libsrc/iodmacro.cc
+
+**** Changes from 2018.03.22 (riesmeier)
+
+- Added quotation marks around "isinf/isnan(0.)":
+  Added quotation marks around CMake "function exists with header" check
+  for symbols "isinf(0.)" and "isnan(0.)". This will hopefully solve an
+  issue with MinGW and gcc 7.3.0.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+
+**** Changes from 2018.03.22 (onken)
+
+- Make sure compare() works on valid objects:
+  Make sure that compare() is called with an object of the same type as
+  parameter, i.e. that a static (down cast) of the right hand side object
+  works as expected.
+  Affects: dcmfg/libsrc/fgbase.cc
+           dcmfg/libsrc/fgderimg.cc
+           dcmfg/libsrc/fgfracon.cc
+           dcmfg/libsrc/fgframeanatomy.cc
+           dcmfg/libsrc/fgframevoilut.cc
+           dcmfg/libsrc/fgimagedatatype.cc
+           dcmfg/libsrc/fgparametricmapframetype.cc
+           dcmfg/libsrc/fgpixmsr.cc
+           dcmfg/libsrc/fgplanor.cc
+           dcmfg/libsrc/fgplanorvol.cc
+           dcmfg/libsrc/fgplanpo.cc
+           dcmfg/libsrc/fgplanposvol.cc
+           dcmfg/libsrc/fgseg.cc
+           dcmfg/libsrc/fgusimagedescription.cc
+
+- Fixed compare() methods:
+  Fixed / completed compare() methods.
+  Affects: dcmfg/libsrc/fgpixeltransform.cc
+           dcmfg/libsrc/fgrealworldvaluemapping.cc
+
+**** Changes from 2018.03.21 (onken)
+
+- Removed debug output.
+  Affects: dcmdata/tests/tvrcomp.cc
+
+- Added import() method for FoR and FoR checks:
+  Added import() method to import Patient, Study and FoR information from
+  a given source image but, unlike the related DcmIODCommon::import()
+  methods, do not require knowledge whether Frame of Reference should be
+  imported or not.
+  Also added FoR-related checks when segmentation objects are written,
+  i.e: 1) Check whether FG is set on segmentation if Derivation Image FG is
+  missing and 2) Check whether Pixel Meausures FG, Plane Position (Patient)
+  FG as well as Plane Orientation (Patient) FG are present if FoR is set.
+  Affects: dcmseg/include/dcmtk/dcmseg/segdoc.h
+           dcmseg/libsrc/segdoc.cc
+
+- Enhanced documentation.
+  Affects: dcmfg/include/dcmtk/dcmfg/fginterface.h
+           dcmfg/libsrc/fginterface.cc
+
+- Added member initializations and copy/assignment:
+  Added member initializations, copy constructor and assignment
+  operator for clarity where meaningful.
+  Affects: dcmfg/include/dcmtk/dcmfg/fgbase.h
+           dcmfg/libsrc/fgbase.cc
+           dcmfg/libsrc/fgrealworldvaluemapping.cc
+           dcmpmap/libsrc/dpmmodparametricmapseries.cc
+           dcmpmap/libsrc/dpmparametricmapbase.cc
+           dcmseg/include/dcmtk/dcmseg/segdoc.h
+           dcmseg/include/dcmtk/dcmseg/segment.h
+           dcmseg/libsrc/segutils.cc
+           dcmtract/libsrc/trcmodtractresults.cc
+           dcmtract/libsrc/trcstatistic.cc
+           dcmtract/libsrc/trctractographyresults.cc
+
+- Fixed usage of getVM() versus getNumberOfValues():
+  Fixed usage of getVM() where getNumberOfValues() is correct or more
+  "speaking" in terms of what actually happens. Fixed related
+  documentation.
+  Affects: dcmfg/libsrc/fgrealworldvaluemapping.cc
+           dcmiod/include/dcmtk/dcmiod/iodrules.h
+           dcmiod/include/dcmtk/dcmiod/iodutil.h
+           dcmiod/libsrc/iodmacro.cc
+           dcmiod/libsrc/iodreferences.cc
+           dcmiod/libsrc/iodutil.cc
+           dcmtract/libsrc/trctrack.cc
+
+- Fixed missing initializers and old-style casts:
+  Fixed compiler warnings about missing member initializers in
+  constructors as well as old-style casts.
+  Affects: dcmiod/include/dcmtk/dcmiod/cielabutil.h
+           dcmiod/libsrc/cielabutil.cc
+           dcmiod/libsrc/iodcontentitemmacro.cc
+           dcmiod/libsrc/iodmacro.cc
+           dcmiod/libsrc/iodreferences.cc
+           dcmiod/libsrc/modcommoninstanceref.cc
+           dcmiod/libsrc/modenhequipment.cc
+           dcmiod/libsrc/modenhusseries.cc
+           dcmiod/libsrc/modequipment.cc
+           dcmiod/libsrc/modgeneralseries.cc
+           dcmiod/libsrc/modgeneralstudy.cc
+           dcmiod/libsrc/modmultiframedimension.cc
+           dcmiod/libsrc/modmultiframefg.cc
+           dcmiod/tests/tcielabutil.cc
+
+- Fixed some compare() methods:
+  Some compare() methods are fixed in the context of DCMKT issue
+  VM=1 per DICOM standard (part 5) and have not been fixed before.
+  This has mainly been achieved by using the new method
+  getNumberOfValues() instead of getVM() where appropriate.
+  Further some formatting has been made consistent with the
+  pre-existing code in the the same source file.
+  Overall the compare() method has been implemented for the
+  different VRs in this way:
+  AE: dcvrae.h: via base class DcmByteString
+  AS: dcvras.h: via base class DcmByteString
+  AT: dcvrat.h: specific implementation
+  CS: dcvrcs.h: via base class DcmByteString
+  DA: dcvrda.h: via base class DcmByteString
+  DS: dcvrds.h: via base class DcmByteString
+  DT: dcvrdt.h: via base class DcmByteString
+  FD: dcvrfd.h: specific implementation
+  FL: dcvrfl.h: specific implementation
+  IS: dcvris.h: via base class DcmByteString
+  LO: dcvrlo.h. via base class DcmByteString
+  LT: dcvrlt.h: specific implementation
+  OB: dcvrobow.h: specific implementation
+  OW: dcvrobow.h: specific implementation
+  OD: dcvrod.h: via base class DcmFloatingPointDouble
+  OF: dcvrof.h: via base class DcmFloatingPointSingle
+  OL: dcvrol.h: via base class DcmUnsignedLong
+  PN: dcvrpn.h: via base class DcmByteString
+  SH: dcvrsh.h: via base class DcmByteString
+  SL: dcvrsl.h: specific implementation
+  SS: dcvrss.h: specific implementation
+  ST: dcvrst.h: specific implementation
+  SQ: dcsequen.h: specific implementation
+  TM: dcvrtm.h: via base class DcmByteString
+  UC: dcvruc.h: via base class DcmByteString
+  UI: dcvrui.h: via base class DcmByteString
+  UL: dcvrul.h: specific implementation
+  UN: implemented based on OB/OW (dcvrobow.h)
+  UR: dcvrur.h: specific implementation
+  US: dcvrus.h: specific implementation
+  UT: dcvrut.h: specific implementation
+  Other:
+  dcvrulup.h: via base class DcmUnsignedLong
+  dcvrpobw.h: specific implementation (polymorph OB/OW)
+  dcpixel.h: specific implementation for DCMTK pixel data representations
+  Affects: dcmdata/include/dcmtk/dcmdata/dcbytstr.h
+           dcmdata/include/dcmtk/dcmdata/dcelem.h
+           dcmdata/include/dcmtk/dcmdata/dcvrat.h
+           dcmdata/include/dcmtk/dcmdata/dcvrfd.h
+           dcmdata/include/dcmtk/dcmdata/dcvrfl.h
+           dcmdata/include/dcmtk/dcmdata/dcvrlt.h
+           dcmdata/include/dcmtk/dcmdata/dcvrobow.h
+           dcmdata/include/dcmtk/dcmdata/dcvrsl.h
+           dcmdata/include/dcmtk/dcmdata/dcvrss.h
+           dcmdata/include/dcmtk/dcmdata/dcvrst.h
+           dcmdata/include/dcmtk/dcmdata/dcvrul.h
+           dcmdata/include/dcmtk/dcmdata/dcvrur.h
+           dcmdata/include/dcmtk/dcmdata/dcvrus.h
+           dcmdata/include/dcmtk/dcmdata/dcvrut.h
+           dcmdata/libsrc/dcbytstr.cc
+           dcmdata/libsrc/dcvrat.cc
+           dcmdata/libsrc/dcvrfd.cc
+           dcmdata/libsrc/dcvrfl.cc
+           dcmdata/libsrc/dcvrlt.cc
+           dcmdata/libsrc/dcvrobow.cc
+           dcmdata/libsrc/dcvrpobw.cc
+           dcmdata/libsrc/dcvrsl.cc
+           dcmdata/libsrc/dcvrss.cc
+           dcmdata/libsrc/dcvrst.cc
+           dcmdata/libsrc/dcvrul.cc
+           dcmdata/libsrc/dcvrur.cc
+           dcmdata/libsrc/dcvrus.cc
+           dcmdata/libsrc/dcvrut.cc
+           dcmdata/tests/tvrcomp.cc
+
+**** Changes from 2018.03.20 (riesmeier)
+
+- Report warning on missing file meta information:
+  Output a warning message to the logger when reading a DICOM file and the file
+  meta information (aka meta header) is missing but a preamble is present. This
+  kind of combination is invalid and should, therefore, be reported to the user.
+  Affects: dcmdata/libsrc/dcfilefo.cc
+           dcmdata/libsrc/dcmetinf.cc
+
+**** Changes from 2018.03.19 (riesmeier)
+
+- Fixed invalid patient's birthdate in demo data:
+  Fixed invalid patient's birthdate in worklist data (probably a typo).
+  The 31 April does not exist in the Gregorian calendar. According to
+  Wikipedia, Joseph Haydn was born on 31 March or 1 April 1732.
+  Thanks to Lukas Raesenhoeft <lukas@raesenhoeft.com> for the report.
+  Affects: dcmwlm/data/wlistdb/OFFIS/wklist4.dump
+           dcmwlm/data/wlistdb/OFFIS/wklist5.dump
+           dcmwlm/data/wlistdb/OFFIS/wklist6.dump
+
+**** Changes from 2018.03.19 (onken)
+
+- Initialize members.
+  Affects: dcmiod/include/dcmtk/dcmiod/modequipment.h
+
+**** Changes from 2018.03.16 (riesmeier)
+
+- Set observation date/time for all content items:
+  Added method that sets the observation date/time for all content items of a
+  document tree, e.g. when copying a subtree to a new document.
+  Affects: dcmsr/include/dcmtk/dcmsr/dsrdocst.h
+           dcmsr/libcmr/Makefile.dep
+           dcmsr/libsrc/Makefile.dep
+           dcmsr/libsrc/dsrdocst.cc
+           dcmsr/tests/tsrdoctr.cc
+
+- Added tree node filter "has Concept Name":
+  Added a document tree node filter that checks for the presence or absence
+  of a concept name, i.e. whether it is empty or not.
+  Affects: dcmsr/include/dcmtk/dcmsr/dsrdnflt.h
+           dcmsr/libsrc/dsrdnflt.cc
+           dcmsr/tests/tsrdoctr.cc
+
+- Made clear that an empty code is not valid.
+  Affects: dcmsr/include/dcmtk/dcmsr/dsrcodvl.h
+
+**** Changes from 2018.03.16 (onken)
+
+- Added virtual destructors to potent. base classes:
+  Added virtual desctructors to potential base classes, i.e. classes
+  already providing virtual methods in their interface.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcjson.h
+           ofstd/include/dcmtk/ofstd/oferror.h
+
+**** Changes from 2018.03.14 (onken)
+
+- Fixed C++11 template specialization:
+  Make sure C+11 template specialization uses the correct template
+  parameters (the same as the non-C++11 version).
+  Affects: dcmiod/include/dcmtk/dcmiod/iodimage.h
+
+**** Changes from 2018.03.13 (riesmeier)
+
+- Updated documentation on CP-1704 (Final Text):
+  Updated documentation on CP-1704 (Relax requirement to provide default
+  Transfer Syntax if lossless compressed image is too large).
+  Affects: dcmnet/docs/dcmsend.man
+           dcmnet/include/dcmtk/dcmnet/dstorscu.h
+
+**** Changes from 2018.03.13 (eichelberg)
+
+- Removed default clause in DcmItem::newDicomElement():
+  Removed default clause in DcmItem::newDicomElement() to make
+  sure that future extensions to the DcmEVR enum are explicitly
+  handled in this method (or raise a compiler warning).
+  Affects: dcmdata/libsrc/dcitem.cc
+
+**** Changes from 2018.03.12 (riesmeier)
+
+- Made use of new method getNumberOfValues():
+  Made use of new method getNumberOfValues() where appropriate. Other
+  occurrences such as in compare() or matches() are still to be checked.
+  This partly closes DCMTK Bug #807.
+  Affects: dcmdata/libsrc/dcvrat.cc
+           dcmdata/libsrc/dcvrfd.cc
+           dcmdata/libsrc/dcvrfl.cc
+           dcmdata/libsrc/dcvrobow.cc
+           dcmdata/libsrc/dcvrod.cc
+           dcmdata/libsrc/dcvrof.cc
+           dcmdata/libsrc/dcvrol.cc
+           dcmdata/libsrc/dcvrsl.cc
+           dcmdata/libsrc/dcvrss.cc
+           dcmdata/libsrc/dcvrul.cc
+           dcmdata/libsrc/dcvrus.cc
+           dcmdata/tests/tvrol.cc
+           dcmdata/tests/tvrui.cc
+
+- Added new method getNumberOfValues():
+  Added method getNumberOfValues() to all VR and other classes that are
+  derived from DcmObject (such as DcmItem). This new method always returns
+  the number of values currently stored in the corresponding object/element,
+  in contrast to getVM(), which sometimes returns the constant 1, or card(),
+  which is not available for all classes.
+  This closes DCMTK Feature #808.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcbytstr.h
+           dcmdata/include/dcmtk/dcmdata/dcitem.h
+           dcmdata/include/dcmtk/dcmdata/dcobject.h
+           dcmdata/include/dcmtk/dcmdata/dcsequen.h
+           dcmdata/include/dcmtk/dcmdata/dcvrat.h
+           dcmdata/include/dcmtk/dcmdata/dcvrfd.h
+           dcmdata/include/dcmtk/dcmdata/dcvrfl.h
+           dcmdata/include/dcmtk/dcmdata/dcvrobow.h
+           dcmdata/include/dcmtk/dcmdata/dcvrsl.h
+           dcmdata/include/dcmtk/dcmdata/dcvrss.h
+           dcmdata/include/dcmtk/dcmdata/dcvrul.h
+           dcmdata/include/dcmtk/dcmdata/dcvrus.h
+           dcmdata/libsrc/dcbytstr.cc
+           dcmdata/libsrc/dcitem.cc
+           dcmdata/libsrc/dcsequen.cc
+           dcmdata/libsrc/dcvrat.cc
+           dcmdata/libsrc/dcvrfd.cc
+           dcmdata/libsrc/dcvrfl.cc
+           dcmdata/libsrc/dcvrobow.cc
+           dcmdata/libsrc/dcvrsl.cc
+           dcmdata/libsrc/dcvrss.cc
+           dcmdata/libsrc/dcvrul.cc
+           dcmdata/libsrc/dcvrus.cc
+
+**** Changes from 2018.03.11 (riesmeier)
+
+- Made mapping between VR name and enum more robust:
+  Enhanced documentation on the mapping between VR name and enum, and
+  excluded VRs that are labeled for internal purposes only (such as
+  "PixelData" or "OverlayData").
+  This should also avoid situations that were fixed with commit 40c9085.
+  This closes DCMTK Bug #816.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcvr.h
+           dcmdata/libsrc/dcvr.cc
+
+- Fixed typo.
+  Affects: dcmpmap/docs/dcmpmap.dox
+
+- Fixed typo in preprocessor directive:
+  Fixed typo in preprocessor directive introduced with last commit:
+  replaced "#defined" by "#define".
+  Affects: ofstd/include/dcmtk/ofstd/ofstd.h
+
+**** Changes from 2018.03.11 (eichelberg)
+
+- Use readdir() instead of readdir_r() if safe:
+  On systems using glibc 2.24 or newer, we use readdir() instead of
+  readdir_r() since on these systems readdir() is thread safe and
+  readdir_r() has been marked as deprecated.
+  Affects: dcmwlm/libsrc/wlfsim.cc
+           ofstd/include/dcmtk/ofstd/ofstd.h
+           ofstd/libsrc/ofstd.cc
+
+- Fixed compile error on current version of MinGW.
+  Affects: dcmdata/libsrc/dcuid.cc
+
+- Fixed compile error on current version of MinGW.
+  Affects: oflog/libsrc/winconap.cc
+
+- Fixed warning introduced by flex-2.6.4 on Win32.
+  Affects: dcmdata/libsrc/vrscani.h
+
+**** Changes from 2018.03.10 (eichelberg)
+
+- Regenerated vrscan code with flex-2.6.4.
+  Affects: dcmdata/libsrc/vrscanl.c
+           dcmdata/libsrc/vrscanl.h
+
+**** Changes from 2018.03.09 (eichelberg)
+
+- Fixed heap overflow issue caused by invalid datasets:
+  Fixed a heap overflow that could be caused by an invalid dataset
+  in explicit VR containing an element with an invalid "Pi" value
+  representation.
+  Thanks to GwanYeong Kim <gy741.kim@gmail.com> for the bug report.
+  Affects: dcmdata/libsrc/dcitem.cc
+
+- Fixed two bugs in DNS lookup code:
+  Fixed a memory leak in OFStandard::getAddressByHostname() caused by a
+  missing call to freeaddrinfo(). Added counter to limit the number of
+  retries in this function and in OFStandard::getHostnameByAddress()
+  in case the network subsystem returns EAI_AGAIN.
+  Thanks to Peter Klotz <Peter.Klotz@ith-icoserve.com> for the bug report
+  and patch.
+  Affects: ofstd/libsrc/ofstd.cc
+
+**** Changes from 2018.03.07 (eichelberg)
+
+- Minor changes to fix warnings on MacOS.
+  Affects: oflog/libsrc/cygwin32.cc
+           oflog/libsrc/fileap.cc
+           oflog/libsrc/ntelogap.cc
+           oflog/libsrc/strccloc.cc
+           oflog/libsrc/timehelp.cc
+
+**** Changes from 2018.03.06 (riesmeier)
+
+- Initialize struct with ={} instead of ={0}:
+  Initialize local variable of type struct with ={} instead of ={0} in order
+  to keep gcc quiet (when used with option -Wextra, which includes warning
+  flag -Wmissing-field-initializers).
+  Affects: ofstd/libsrc/ofstd.cc
+
+**** Changes from 2018.03.05 (onken)
+
+- Again, fix API for importHierarchy() (see c8fdfb).
+  Affects: dcmtract/include/dcmtk/dcmtract/trctractographyresults.h
+           dcmtract/libsrc/trctractographyresults.cc
+
+**** Changes from 2018.03.05 (riesmeier)
+
+- Fixed wrong use of preprocessor directive #elif:
+  When the preprocessor directive #elif is used, this opens the "else" block
+  of an #if statement and not of #ifdef, so "#elif defined(..)" should be used
+  where appropriate.
+  This issue has been reported by gcc -Wundef for preprocessor macros such as
+  __OpenBSD__, which are not defined on all supported platforms.
+  Affects: dcmnet/apps/storescp.cc
+           dcmpstat/apps/dcmprscp.cc
+           dcmpstat/apps/dcmpsrcv.cc
+           dcmpstat/libsrc/dvpshlp.cc
+           dcmwlm/libsrc/wlmactmg.cc
+           ofstd/tests/terror.cc
+
+**** Changes from 2018.03.05 (onken)
+
+- Updated importHierarchy() method API:
+  Updated importHierarchy() method API to reflect earlier changes in
+  DcmIODCommon, and by this also fix compiler warning about hiding a
+  virtual method from DcmIODCommon (since TrcTractographyResults's version
+  has one parameter more, now).
+  Affects: dcmtract/include/dcmtk/dcmtract/trctractographyresults.h
+           dcmtract/libsrc/trctractographyresults.cc
+
+- Fixed uninitialized variable.
+  Affects: dcmtract/libsrc/trctrack.cc
+
+**** Changes from 2018.03.04 (riesmeier)
+
+- Next try to keep SunPro Studio 12.x quiet.
+  Affects: dcmsr/libcmr/tid1600.cc
+
+**** Changes from 2018.03.03 (riesmeier)
+
+- Reverted to version before last commit:
+  It makes no sense to check the "sequence" pointer for each and every
+  iteration of the while loop (since it cannot be NULL).
+  Affects: dcmsr/libcmr/tid1600.cc
+
+**** Changes from 2018.03.03 (eichelberg)
+
+-     Fixed heap buffer overflow in dcmpstat module:
+  Fixed heap buffer overflow in dcmpstat module that could be provoked by
+      an invalid DICOM file.
+      Thanks to GwanYeong Kim <gy741.kim@gmail.com> for the bug report.
+  Affects: dcmpstat/include/dcmtk/dcmpstat/dvpsdef.h
+           dcmpstat/libsrc/dcmpstat.cc
+           dcmpstat/libsrc/dvpsab.cc
+           dcmpstat/libsrc/dvpsal.cc
+           dcmpstat/libsrc/dvpsall.cc
+           dcmpstat/libsrc/dvpsda.cc
+           dcmpstat/libsrc/dvpsfs.cc
+           dcmpstat/libsrc/dvpsga.cc
+           dcmpstat/libsrc/dvpsgl.cc
+           dcmpstat/libsrc/dvpsgr.cc
+           dcmpstat/libsrc/dvpsib.cc
+           dcmpstat/libsrc/dvpsov.cc
+           dcmpstat/libsrc/dvpspl.cc
+           dcmpstat/libsrc/dvpsri.cc
+           dcmpstat/libsrc/dvpsrs.cc
+           dcmpstat/libsrc/dvpssp.cc
+           dcmpstat/libsrc/dvpssv.cc
+           dcmpstat/libsrc/dvpssvl.cc
+           dcmpstat/libsrc/dvpstx.cc
+           dcmpstat/libsrc/dvpsvl.cc
+           dcmpstat/libsrc/dvpsvwl.cc
+
+**** Changes from 2018.03.02 (riesmeier)
+
+- Enhanced API documentation of DcmObject::getVM():
+  Added sentence to API documentation of DcmObject::getVM() explaining that
+  depending on the VR some subclasses return the currently stored number of
+  values and others the constant value 1 (according the DICOM standard).
+  Affects: dcmdata/include/dcmtk/dcmdata/dcobject.h
+           dcmdata/include/dcmtk/dcmdata/dcvrss.h
+
+- Fixed outdated log message:
+  Fixed log message by removing reference to "probably unsupported compression".
+  Affects: dcmimgle/libsrc/diimage.cc
+
+- Made log output more consistent:
+  Removed inconsistency of log output introduced with commit 76ee9d7.
+  Affects: dcmimgle/libsrc/didocu.cc
+
+- Removed double declaration of local variable:
+  Removed double declaration of local variable "status" (introduced with
+  previous commit).
+  Affects: dcmimgle/libsrc/didocu.cc
+
+**** Changes from 2018.03.02 (onken)
+
+- Print error details if conversion fails:
+  Print details of the returned OFCondition object in case pixel data
+  conversion fails.
+  Affects: dcmimgle/libsrc/didocu.cc
+
+- Fixed integer overflow in pixel buffer allocation:
+  This closes DCMTK bug #793.
+  Affects: dcmdata/libsrc/dcvrpobw.cc
+
+- Renamed VM variables for clarity:
+  Renamed some VM-named variables in the context of sequence and items to
+  better names, since the related methods work on the cardinality of items
+  and sequences, not the VM as defined by the DICOM standard.
+  Affects: dcmdata/libsrc/dcitem.cc
+           dcmdata/libsrc/dcsequen.cc
+
+**** Changes from 2018.03.01 (onken)
+
+- Ensure isnan/isinf macro is only defined once.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+
+- Fix cmake error on Linux with DCMTK_ENABLE_CXX11:
+  Configuring on Linux with DCMTK_ENABLE_CXX11 enabled generates an error
+  in the configuration step:
+      CMake Error at CMake/GenerateDCMTKConfigure.cmake:1252 (MESSAGE):
+        ...
+        /path/to/dcmtk/config/tests/../math.cc:88:12: error:
+        '::isnan' has not been declared
+             return ::isnan(f);
+  One way around this is to ensure that the preferred std::isnan()
+  function is used instead. This commit fixes the following error in the check
+  for that function by specifying the double overload:
+      FAILED: CMakeFiles/cmTC_62c88.dir/CheckSymbolExists.cxx.o
+      /path/to/dcmtk-build/CMakeTmp/CheckSymbolExists.cxx:29:11: error:
+  statement cannot resolve address of overloaded function
+       std::isnan;return 0;
+  Thanks to Max Smolens (github user msmolens) for the report and patch.
+  Affects: CMake/GenerateDCMTKConfigure.cmake
+
+**** Changes from 2018.02.28 (eichelberg)
+
+- Include <sys/timeb.h> only if really needed:
+  Include <sys/timeb.h> only if absolutely needed (i.e. when no high
+  resolution timer function other than ftime() is available) since
+  this header file is deprecated on most platforms.
+  Affects: oflog/libsrc/timehelp.cc
+
+- Fixed use of operator delete[], reported by clang.
+  Affects: ofstd/include/dcmtk/ofstd/ofoset.h
+
+**** Changes from 2018.02.28 (riesmeier)
+
+- Fixed reference to outdated macro name:
+  Fixed reference to outdated macro name HAVE_STD_STRING, which has been
+  renamed to HAVE_STL_STRING with commit ef5118e.
+  Affects: config/docs/macros.txt
+
+**** Changes from 2018.02.24 (eichelberg)
+
+- Added line feed at EOF to fix Sun C++ warning.
+  Affects: dcmfg/libsrc/stackinterface.cc
+
+- DcmTagKey comparison operators now return OFBool.
+  Affects: dcmdata/include/dcmtk/dcmdata/dctagkey.h
+
+**** Changes from 2018.02.23 (eichelberg)
+
+- Fixed undefined behavior warning on 32-bit platforms:
+  This closes DCMTK bug #759.
+  Affects: dcmjpeg/libijg16/jccolor.c
+           dcmjpeg/libijg16/jdmerge.c
+
+**** Changes from 2018.02.22 (riesmeier)
+
+- Fixed classification of command line options:
+  Fixed classificaton of command line options into groups and subgroups in
+  order to be more consistent with other DCMTK tools, e.g. moved "encoding
+  options" to the "output options" group and "specific character set" to the
+  new group "processing options". Also made sure that the --help output fits
+  into the 80 characters line length limit.
+  Affects: dcmqrdb/apps/dcmqrscp.cc
+           dcmqrdb/docs/dcmqrscp.man
+
+**** Changes from 2018.02.16 (riesmeier)
+
+- Updated mapping of Body Part Examined to codes:
+  Updated mapping of the Defined Terms for Body Part Examined (0018,0015) to
+  associated CID 4031 (Common Anatomic Regions) codes based on PS3.16 Table L-1
+  (2018a edition of the DICOM standard).
+  Affects: dcmsr/libcmr/cid4031e.cc
+
+- Updated data dictionary for DICOM 2018a:
+  Updated data dictionary for the latest edition of the DICOM standard, which
+  has been released only recently. Please note that the name of one attribute
+  changed due to its retirement. Also the Value Multiplicity (VM) of two "OF"
+  attributes changed from "1-n" to "1" (as defined in PS3.5).
+  Affects: dcmdata/data/dicom.dic
+           dcmdata/include/dcmtk/dcmdata/dcdeftag.h
+           dcmdata/libsrc/dcdictbi.cc
+
+- Removed space character at beginning of a line.
+  Affects: dcmnet/docs/getscu.man
+
+- Fixed typos and removed trailing spaces.
+  Affects: dcmqrdb/docs/dcmqrcnf.txt
+
+**** Changes from 2018.02.15 (riesmeier)
+
+- Minor fix to API documentation.
+  Affects: dcmsr/include/dcmtk/dcmsr/dsrdoctr.h
+
+- Fixed partly wrong API documentation:
+  Removed two sentences from the API documentation of setEnhancedEncodingMode()
+  since they are not appropriate for this method (probably "copy and paste"
+  error).
+  Affects: dcmsr/include/dcmtk/dcmsr/dsrcodvl.h
+
+**** Changes from 2018.02.15 (eichelberg)
+
+- Fixed MSVC x64 type conversion warning.
+  Affects: dcmtls/libsrc/tlslayer.cc
+           dcmtls/libsrc/tlsscu.cc
+           dcmtls/libsrc/tlstrans.cc
+
+- Fixed MSVC x64 type conversion warning.
+  Affects: dcmsign/libsrc/siprivat.cc
+
+- Changed OFSockAddr::size() return type to socklen_t.
+  Affects: ofstd/include/dcmtk/ofstd/ofsockad.h
+           ofstd/libsrc/ofsockad.cc
+
+**** Changes from 2018.02.14 (riesmeier)
+
+- Enhanced code examples for module "dcmsr":
+  Added new and enhanced existing code examples for module "dcmsr".
+  Affects: dcmsr/docs/dcmsr.dox
+
+- Fixed inaccurate name specifier of nested class.
+  Affects: dcmsr/tests/tsrcmr.cc
+
+- Added constructors and assignment operator:
+  Added explicit default and copy constructor as well as assignment operator
+  to class DSRDocumentTreeNodeFilterList since it manages a list of pointers.
+  Affects: dcmsr/include/dcmtk/dcmsr/dsrdnflt.h
+           dcmsr/libsrc/dsrdnflt.cc
+
+- Added check for self-assignment:
+  Added check for self-assignment to assignment operator since this would
+  not work (as expected).
+  Affects: dcmsr/include/dcmtk/dcmsr/dsrtlist.h
+           dcmsr/libsrc/dsrimgvl.cc
+
+- Moved assignment operator to source file.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcpxitem.h
+           dcmdata/libsrc/dcpxitem.cc
+
+**** Changes from 2018.02.14 (eichelberg)
+
+- Fixed heap buffer overflow in dcmpschk:
+  Fixed heap buffer overflow in dcmpschk that could be provoked by an invalid
+  DICOM file.
+  Thanks to GwanYeong Kim <gy741.kim@gmail.com> for the bug report.
+  Affects: dcmpstat/apps/dcmpschk.cc
+
+**** Changes from 2018.02.12 (riesmeier)
+
+- Added PatientRadiationDoseSRStorage to man page:
+  Added missing PatientRadiationDoseSRStorage to "DICOM Conformance" section
+  of the man page. Full support for this new SR SOP Class was already added
+  with commit 5a5a67d.
+  Affects: dcmsr/docs/dsr2html.man
+           dcmsr/docs/dsr2xml.man
+           dcmsr/docs/dsrdump.man
+           dcmsr/docs/xml2dsr.man
+
+- Increased buffer size to avoid possible overflow:
+  Increased size of temporary character buffer in order to avoid a possible
+  overflow, e.g. when there are more that 99,999,999 C-FIND responses.
+  Affects: dcmnet/libsrc/dfindscu.cc
+
+**** Changes from 2018.02.09 (riesmeier)
+
+- Fixed double declaration of local variable:
+  Fixed double declaration of local variable (reported by gcc -Wshadow).
+  Affects: dcmdata/libsrc/dcpixel.cc
+           dcmdata/libsrc/dcvrpobw.cc
+
+- Added reference to documentation of TID 4019.
+  Affects: dcmsr/docs/dcmsr.dox
+
+- Increased buffer size to avoid possible overflow:
+  Increased size of temporary character buffer in order to avoid a possible
+  overflow, e.g. when there are more that 999,999 DICOM objects in a study.
+  Thanks to Gert Wollny <gw.fossdev@gmail.com> for the suggested patch.
+  Affects: dcmnet/apps/storescp.cc
+
+**** Changes from 2018.02.07 (riesmeier)
+
+- Added support for TID 4019 to TID 1419:
+  Added support for included template TID 4019 (Algorithm Identification) to
+  the implementation of TID 1419 (ROI Measurements). This new SR template has
+  been implemented as a separate C++ class so it can also be used in another
+  context where a specific software algorithm should be identified.
+  Added:   dcmsr/include/dcmtk/dcmsr/cmr/tid4019.h
+           dcmsr/libcmr/tid4019.cc
+  Affects: dcmsr/include/dcmtk/dcmsr/cmr/tid1419m.h
+           dcmsr/libcmr/CMakeLists.txt
+           dcmsr/libcmr/Makefile.dep
+           dcmsr/libcmr/Makefile.in
+           dcmsr/libcmr/tid1419m.cc
+           dcmsr/libcmr/tid300.cc
+           dcmsr/tests/Makefile.dep
+           dcmsr/tests/tsrcmr.cc
+
+**** Changes from 2018.02.06 (riesmeier)
+
+- Fixed issue with DSRTree<T>::swap():
+  Fixed issue with swap() method of the base tree class: the inherited node
+  cursor was not swapped, so that the internal cursor became invalid.
+  Affects: dcmsr/include/dcmtk/dcmsr/dsrtncsr.h
+           dcmsr/include/dcmtk/dcmsr/dsrtree.h
+
+- Updated copyright date.
+  Affects: COPYRIGHT
+
+- Removed all references to "CVS":
+  Removed all references to "CVS", a version control system that was used for
+  DCMTK development in the past but has been replaced by "git" some years ago.
+  Affects: config/rootconf
+           dcmdata/libsrc/mkdeftag.cc
+           dcmiod/include/CMakeLists.txt
+           dcmpmap/include/CMakeLists.txt
+           dcmseg/include/CMakeLists.txt
+           dcmtract/include/CMakeLists.txt
+
+- Fixed name of retired Storage SOP Class:
+  Fixed name of retired Storage SOP Class (for reasons of consistency):
+  RETIRED_VLMultiFrameImageStorage => RETIRED_VLMultiframeImageStorage.
+  Affects: dcmdata/include/dcmtk/dcmdata/dcuid.h
+           dcmdata/libsrc/dcuid.cc
+           dcmnet/docs/getscu.man
+           dcmnet/docs/movescu.man
+           dcmnet/docs/storescp.man
+           dcmnet/etc/storescp.cfg
+           dcmqrdb/docs/dcmqrscp.man
+           dcmqrdb/etc/dcmqrprf.cfg
+
+- Use default timeout for first PDU to be read:
+  In DUL_RequestAssociation(), i.e. when requesting an association, use the
+  default timeout, the one that is passed to ASC_initializeNetwork(), for the
+  first PDU to be read (if no other timeout value is defined). That means, the
+  behavior of this function is now consistent with DUL_ReceiveAssociationRQ().
+  For the various command line tools, this timeout value is usually specified
+  by the --acse-timeout option. So, it now also works with echoscu, findscu,
+  storescu, dcmsend, etc.
+  Also added output to TRACE logger when setting the request/receive timeout.
+  Affects: dcmnet/libsrc/dul.cc
+
+- Added comment on unhandled attributes:
+  Added comment with a list of unhandled attributes to checkAndUpdateVR(),
+  i.e. those having multiple value representations according to the DICOM
+  data dictionary (PS3.6).
+  Affects: dcmdata/libsrc/dcitem.cc
+
+- Added comment on missing timer start:
+  Added comment on missing start of ARTIM timer in DICOM Upper Layer Protocol
+  for TCP/IP State Machine Action "AE-8" (according to DICOM PS3.8).
+  Affects: dcmnet/libsrc/dulfsm.cc
+
+- Fixed typos.
+  Affects: dcmnet/libsrc/assoc.cc
+           dcmnet/libsrc/dulfsm.cc
+
+- Enhanced verboseness of getDecompressedColorModel:
+  Enhanced verboseness of the methods getDecompressedColorModel() and
+  determineDecompressedColorModel() by checking whether mandatory data
+  elements such as PhotometricInterpretation are present and have a value.
+  If not, a warning message is reported to the logger and a more appropriate
+  code is returned.
+  This closes DCMTK Bug #568.
+  Affects: dcmdata/libsrc/dcpixel.cc
+           dcmdata/libsrc/dcrleccd.cc
+           dcmjpeg/libsrc/djcodecd.cc
+           dcmjpls/libsrc/djcodecd.cc
+
+**** Changes from 2018.02.06 (schlamelcher)
+
+- Updated version information for 3.6.3+ development:
+  Updated version information marking the start of DCMTK development post minor
+  release 3.6.3.
+  Moved official ANNOUNCE file of the DCMTK release 3.6.3 to the "docs"
+  subfolder and replaced the main ANNOUNCE file with a "dummy".
+  Added:   docs/ANNOUNCE.363
+  Affects: ANNOUNCE
+           CMake/dcmtkPrepare.cmake
+           VERSION
+           config/configure
+           config/configure.in
index 0f53cf1cbe497d54f2d9f6722333992212129a84..dbee9474b10d7177a6ddad46de0715170a6aadd9 100644 (file)
@@ -1,73 +1,73 @@
 # declare project
-PROJECT(doxygen)
+project(doxygen)
 
 # doxygen support
-IF(DCMTK_WITH_DOXYGEN)
+if(DCMTK_WITH_DOXYGEN)
 
-  IF(DOXYGEN_EXECUTABLE)
-    ADD_CUSTOM_TARGET(DOXYGEN)
-    ADD_CUSTOM_TARGET(html "${DOXYGEN_EXECUTABLE}" htmldocs.tmp)
-    ADD_DEPENDENCIES(DOXYGEN html)
-    IF(NOT WIN32) # For Unix systems, also build manpages
-      ADD_CUSTOM_TARGET(man COMMAND "${DOXYGEN_EXECUTABLE}" manpages.tmp
+  if(DOXYGEN_EXECUTABLE)
+    add_custom_target(DOXYGEN)
+    add_custom_target(html "${DOXYGEN_EXECUTABLE}" htmldocs.tmp)
+    add_dependencies(DOXYGEN html)
+    if(NOT WIN32) # For Unix systems, also build manpages
+      add_custom_target(man COMMAND "${DOXYGEN_EXECUTABLE}" manpages.tmp
                             COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/manpages/man1/*.man.1"
                             COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/patchman.sh")
-      ADD_DEPENDENCIES(DOXYGEN man)
-      ADD_CUSTOM_TARGET(man2text COMMAND "${CMAKE_COMMAND}" -E make_directory man2text
+      add_dependencies(DOXYGEN man)
+      add_custom_target(man2text COMMAND "${CMAKE_COMMAND}" -E make_directory man2text
                                  COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/man2text.sh")
-      ADD_DEPENDENCIES(man2text man)
-    ENDIF(NOT WIN32)
-  ENDIF(DOXYGEN_EXECUTABLE)
+      add_dependencies(man2text man)
+    endif()
+  endif()
 
   # generate a tag file in order to link to this documentation from external projects
-  IF(DCMTK_GENERATE_DOXYGEN_TAGFILE)
-    SET(DOXYGEN_TAGFILE "dcmtk.tag")
-  ENDIF(DCMTK_GENERATE_DOXYGEN_TAGFILE)
+  if(DCMTK_GENERATE_DOXYGEN_TAGFILE)
+    set(DOXYGEN_TAGFILE "dcmtk.tag")
+  endif()
 
   # create configuration files (expand variables)
-  SET(DCMTK_VERSION "${DCMTK_PACKAGE_VERSION}${PACKAGE_VERSION_SUFFIX}")
-  SET(DOXYGEN_INPUT_DIR "${CMAKE_SOURCE_DIR}")
-  SET(DOXYGEN_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
-  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/htmldocs.cfg" "${CMAKE_CURRENT_BINARY_DIR}/htmldocs.tmp" ESCAPE_QUOTES @ONLY)
-  IF(NOT WIN32)
-    CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/manpages.cfg" "${CMAKE_CURRENT_BINARY_DIR}/manpages.tmp" ESCAPE_QUOTES @ONLY)
-  ENDIF(NOT WIN32)
+  set(DCMTK_VERSION "${DCMTK_PACKAGE_VERSION}${PACKAGE_VERSION_SUFFIX}")
+  set(DOXYGEN_INPUT_DIR "${CMAKE_SOURCE_DIR}")
+  set(DOXYGEN_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/htmldocs.cfg" "${CMAKE_CURRENT_BINARY_DIR}/htmldocs.tmp" ESCAPE_QUOTES @ONLY)
+  if(NOT WIN32)
+    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/manpages.cfg" "${CMAKE_CURRENT_BINARY_DIR}/manpages.tmp" ESCAPE_QUOTES @ONLY)
+  endif()
 
   # Make sure these directories exist when we try to install them
-  INSTALL(CODE "FILE(MAKE_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/htmldocs\")" COMPONENT html)
-  IF(NOT WIN32)
-    INSTALL(CODE "FILE(MAKE_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/manpages\")" COMPONENT man)
-  ENDIF(NOT WIN32)
+  install(CODE "file(MAKE_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/htmldocs\")" COMPONENT html)
+  if(NOT WIN32)
+    install(CODE "file(MAKE_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/manpages\")" COMPONENT man)
+  endif()
 
   # install html docs and manpages
-  INSTALL(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/htmldocs/" DESTINATION "${CMAKE_INSTALL_DOCDIR}/html" COMPONENT html PATTERN "*.md5" EXCLUDE)
-  IF(DCMTK_GENERATE_DOXYGEN_TAGFILE)
-    INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${DOXYGEN_TAGFILE}" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT html OPTIONAL)
-  ENDIF(DCMTK_GENERATE_DOXYGEN_TAGFILE)
-  IF(NOT WIN32)
-    FILE(GLOB_RECURSE MANPAGES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/manpages/" "${CMAKE_CURRENT_SOURCE_DIR}/manpages/*.1")
-    FOREACH(MANPAGE ${MANPAGES})
-        IF("${CMAKE_CURRENT_SOURCE_DIR}/manpages/${MANPAGE}" IS_NEWER_THAN "${CMAKE_CURRENT_BINARY_DIR}/manpages/${MANPAGE}")
-            GET_FILENAME_COMPONENT(DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/manpages/${MANPAGE}" PATH)
-            FILE(COPY "${CMAKE_CURRENT_SOURCE_DIR}/manpages/${MANPAGE}" DESTINATION "${DESTINATION}")
-        ENDIF()
-    ENDFOREACH()
-    INSTALL(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/manpages/" DESTINATION "${CMAKE_INSTALL_MANDIR}" COMPONENT man PATTERN "*_.1" EXCLUDE)
-  ENDIF(NOT WIN32)
+  install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/htmldocs/" DESTINATION "${CMAKE_INSTALL_DOCDIR}/html" COMPONENT html PATTERN "*.md5" EXCLUDE)
+  if(DCMTK_GENERATE_DOXYGEN_TAGFILE)
+    install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${DOXYGEN_TAGFILE}" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT html OPTIONAL)
+  endif()
+  if(NOT WIN32)
+    file(GLOB_RECURSE MANPAGES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/manpages/" "${CMAKE_CURRENT_SOURCE_DIR}/manpages/*.1")
+    foreach(MANPAGE ${MANPAGES})
+        if("${CMAKE_CURRENT_SOURCE_DIR}/manpages/${MANPAGE}" IS_NEWER_THAN "${CMAKE_CURRENT_BINARY_DIR}/manpages/${MANPAGE}")
+            get_filename_component(DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/manpages/${MANPAGE}" PATH)
+            file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/manpages/${MANPAGE}" DESTINATION "${DESTINATION}")
+        endif()
+    endforeach()
+    install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/manpages/" DESTINATION "${CMAKE_INSTALL_MANDIR}" COMPONENT man PATTERN "*_.1" EXCLUDE)
+  endif()
 
   # the files in manpages/ and htmldocs/ should be removed by "make clean".
-  SET(make_clean_files "${CMAKE_CURRENT_BINARY_DIR}/htmldocs" "${CMAKE_CURRENT_BINARY_DIR}/manpages" "${CMAKE_CURRENT_BINARY_DIR}/man2text")
-  SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")
+  set(make_clean_files "${CMAKE_CURRENT_BINARY_DIR}/htmldocs" "${CMAKE_CURRENT_BINARY_DIR}/manpages" "${CMAKE_CURRENT_BINARY_DIR}/man2text")
+  set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")
 
   # the created files "htmldocs.tmp" and "manpages.tmp" should be removed with "make distclean",
   # which will (hopefully) be introduced in a future version, because they are only created during
   # the configure/generate process
 
-ELSE(DCMTK_WITH_DOXYGEN)
+else()
 
   # by default, install the pre-defined manpages, i.e. the ones shipped with this package
-  IF(NOT WIN32)
-    INSTALL(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/manpages/" DESTINATION "${CMAKE_INSTALL_MANDIR}" COMPONENT man)
-  ENDIF(NOT WIN32)
+  if(NOT WIN32)
+    install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/manpages/" DESTINATION "${CMAKE_INSTALL_MANDIR}" COMPONENT man)
+  endif()
 
-ENDIF(DCMTK_WITH_DOXYGEN)
+endif()
index fbc701735d3340adaf4dec2180199f1a48ef8e1b..5e9f11d299ef50b2d5776a106717ff0df2159011 100644 (file)
@@ -1937,7 +1937,7 @@ ENABLE_PREPROCESSING   = YES
 # The default value is: NO.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
-MACRO_EXPANSION        = NO
+MACRO_EXPANSION        = YES
 
 # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
 # the macro expansion is limited to the macros specified with the PREDEFINED and
@@ -1945,7 +1945,7 @@ MACRO_EXPANSION        = NO
 # The default value is: NO.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
-EXPAND_ONLY_PREDEF     = NO
+EXPAND_ONLY_PREDEF     = YES
 
 # If the SEARCH_INCLUDES tag is set to YES the includes files in the
 # INCLUDE_PATH will be searched if a #include is found.
@@ -1978,14 +1978,20 @@ INCLUDE_FILE_PATTERNS  =
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
 PREDEFINED             = DOXYGEN \
-                         WITH_OPENSSL \
-                         WITH_ZLIB \
-                         WITH_LIBTIFF \
+                         DCMTK_USE_WCHAR_T \
+                         HAVE_GRP_H \
+                         HAVE_PWD_H \
+                         WIDE_CHAR_FILE_IO_FUNCTIONS \
+                         _WIN32 \
+                         WITH_ICU \
+                         WITH_LIBICONV \
                          WITH_LIBPNG \
-                         WITH_LIBXML \
+                         WITH_LIBTIFF \
                          WITH_LIBWRAP \
-                         WITH_LIBICONV \
-                         WITH_THREADS
+                         WITH_LIBXML \
+                         WITH_OPENSSL \
+                         WITH_THREADS \
+                         WITH_ZLIB \
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
 # tag can be used to specify a list of macro names that should be expanded. The
diff --git a/doxygen/manpages/man1/cda2dcm.1 b/doxygen/manpages/man1/cda2dcm.1
new file mode 100644 (file)
index 0000000..934369f
--- /dev/null
@@ -0,0 +1,216 @@
+.TH "cda2dcm" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
+.nh
+.SH NAME
+cda2dcm \- Encapsulate CDA file into DICOM file format
+
+.SH "SYNOPSIS"
+.PP
+.PP
+.nf
+cda2dcm [options] cdafile-in dcmfile-out
+.fi
+.PP
+.SH "DESCRIPTION"
+.PP
+The \fBcda2dcm\fP utility reads a CDA file (\fIcdafile-in\fP), converts it to a DICOM Encapsulated CDA Storage SOP instance and stores the converted data to an output file (\fIdcmfile-out\fP)\&.
+.SH "PARAMETERS"
+.PP
+.PP
+.nf
+cdafile-in   CDA input filename to be encapsulated
+
+dcmfile-out  DICOM output filename
+.fi
+.PP
+.SH "OPTIONS"
+.PP
+.SS "general options"
+.PP
+.nf
+  -h   --help
+         print this help text and exit
+
+       --version
+         print version information and exit
+
+       --arguments
+         print expanded command line arguments
+
+  -q   --quiet
+         quiet mode, print no warnings and errors
+
+  -v   --verbose
+         verbose mode, print processing details
+
+  -d   --debug
+         debug mode, print debug information
+
+  -ll  --log-level  [l]evel: string constant
+         (fatal, error, warn, info, debug, trace)
+         use level l for the logger
+
+  -lc  --log-config  [f]ilename: string
+         use config file f for the logger
+.fi
+.PP
+.SS "DICOM document options"
+.PP
+.nf
+document title:
+
+  +t   --title  [t]itle: string (default: empty)
+         document title
+
+  +cn  --concept-name  [CSD] [CV] [CM]: string (default: empty)
+         coded representation of document title defined by coding
+         scheme designator CSD, code value CV and code meaning CM
+
+patient data:
+
+  +pn  --patient-name  [n]ame: string
+         patient's name in DICOM PN syntax
+
+  +pi  --patient-id  [i]d: string
+         patient identifier
+
+  +pb  --patient-birthdate  [d]ate: string (YYYYMMDD)
+         patient's birth date
+
+  +ps  --patient-sex  [s]ex: string (M, F or O)
+         patient's sex
+
+study and series:
+
+  +sg  --generate
+         generate new study and series UIDs (default)
+
+  +st  --study-from  [f]ilename: string
+         read patient/study data from DICOM file
+
+  +se  --series-from  [f]ilename: string
+         read patient/study/series data from DICOM file
+
+instance number:
+
+  +i1  --instance-one
+         use instance number 1 (default, not with +se)
+
+  +ii  --instance-inc
+         increment instance number (only with +se)
+
+  +is  --instance-set [i]nstance number: integer
+         use instance number i
+
+burned-in annotation:
+
+  +an  --annotation-yes
+         document contains patient identifying data (default)
+
+  -an  --annotation-no
+         document does not contain patient identifying data
+
+override CDA file data:
+
+  -ov  --no-override
+         CDA patient and document data must match study,
+         series or manually entered information (default)
+
+  +ov  --override
+         data obtained from the CDA file will be overwritten
+         by study, series, or manually entered information
+.fi
+.PP
+.SS "processing options"
+.PP
+.nf
+other processing options:
+
+  -k   --key  [k]ey: gggg,eeee="str", path or dictionary name="str"
+         add further attribute
+.fi
+.PP
+.SS "output options"
+.PP
+.nf
+output file format:
+
+  +F   --write-file
+         write file format (default)
+
+  -F   --write-dataset
+         write data set without file meta information
+
+group length encoding:
+
+  +g=  --group-length-recalc
+         recalculate group lengths if present (default)
+
+  +g   --group-length-create
+         always write with group length elements
+
+  -g   --group-length-remove
+         always write without group length elements
+
+length encoding in sequences and items:
+
+  +e   --length-explicit
+         write with explicit lengths (default)
+
+  -e   --length-undefined
+         write with undefined lengths
+
+data set trailing padding (not with --write-dataset):
+
+  -p   --padding-off
+         no padding (implicit if --write-dataset)
+
+  +p   --padding-create  [f]ile-pad [i]tem-pad: integer
+         align file on multiple of f bytes
+         and items on multiple of i bytes
+.fi
+.PP
+.SH "LOGGING"
+.PP
+The level of logging output of the various command line tools and underlying libraries can be specified by the user\&. By default, only errors and warnings are written to the standard error stream\&. Using option \fI--verbose\fP also informational messages like processing details are reported\&. Option \fI--debug\fP can be used to get more details on the internal activity, e\&.g\&. for debugging purposes\&. Other logging levels can be selected using option \fI--log-level\fP\&. In \fI--quiet\fP mode only fatal errors are reported\&. In such very severe error events, the application will usually terminate\&. For more details on the different logging levels, see documentation of module 'oflog'\&.
+.PP
+In case the logging output should be written to file (optionally with logfile rotation), to syslog (Unix) or the event log (Windows) option \fI--log-config\fP can be used\&. This configuration file also allows for directing only certain messages to a particular output stream and for filtering certain messages based on the module or application where they are generated\&. An example configuration file is provided in \fI<etcdir>/logger\&.cfg\fP\&.
+.SH "COMMAND LINE"
+.PP
+All command line tools use the following notation for parameters: square brackets enclose optional values (0-1), three trailing dots indicate that multiple values are allowed (1-n), a combination of both means 0 to n values\&.
+.PP
+Command line options are distinguished from parameters by a leading '+' or '-' sign, respectively\&. Usually, order and position of command line options are arbitrary (i\&.e\&. they can appear anywhere)\&. However, if options are mutually exclusive the rightmost appearance is used\&. This behavior conforms to the standard evaluation rules of common Unix shells\&.
+.PP
+In addition, one or more command files can be specified using an '@' sign as a prefix to the filename (e\&.g\&. \fI@command\&.txt\fP)\&. Such a command argument is replaced by the content of the corresponding text file (multiple whitespaces are treated as a single separator unless they appear between two quotation marks) prior to any further evaluation\&. Please note that a command file cannot contain another command file\&. This simple but effective approach allows one to summarize common combinations of options/parameters and avoids longish and confusing command lines (an example is provided in file \fI<datadir>/dumppat\&.txt\fP)\&.
+.SH "EXIT CODES"
+.PP
+The \fBcda2dcm\fP utility uses the following exit codes when terminating\&. This enables the user to check for the reason why the application terminated\&.
+.SS "general"
+.PP
+.nf
+EXITCODE_NO_ERROR                 0
+EXITCODE_COMMANDLINE_SYNTAX_ERROR 1
+EXITCODE_MEMORY_EXHAUSTED         4
+.fi
+.PP
+.SS "input file errors"
+.PP
+.nf
+EXITCODE_CANNOT_READ_INPUT_FILE   20
+EXITCODE_NO_INPUT_FILES           21
+EXITCODE_INVALID_INPUT_FILE       22
+.fi
+.PP
+.SS "output file errors"
+.PP
+.nf
+EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40
+.fi
+.PP
+.SH "ENVIRONMENT"
+.PP
+The \fBcda2dcm\fP utility will attempt to load DICOM data dictionaries specified in the \fIDCMDICTPATH\fP environment variable\&. By default, i\&.e\&. if the \fIDCMDICTPATH\fP environment variable is not set, the file \fI<datadir>/dicom\&.dic\fP will be loaded unless the dictionary is built into the application (default for Windows)\&.
+.PP
+The default behavior should be preferred and the \fIDCMDICTPATH\fP environment variable only used when alternative data dictionaries are required\&. The \fIDCMDICTPATH\fP environment variable has the same format as the Unix shell \fIPATH\fP variable in that a colon (':') separates entries\&. On Windows systems, a semicolon (';') is used as a separator\&. The data dictionary code will attempt to load each file specified in the \fIDCMDICTPATH\fP environment variable\&. It is an error if no data dictionary can be loaded\&.
+.SH "COPYRIGHT"
+.PP
+Copyright (C) 2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index 83789c7555a00ed92ba8e9b10d3b622ec083afe2..f2c68191ef3532c51d79ae9f568b88d286781306 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcm2json" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcm2json" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcm2json \- Convert DICOM file and data set to JSON
index f3b3e9104cdb9f1b14b0ab6e0e5fce78844a76fd..9c7b13408483746ab22522dd8b315756dfd690cc 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcm2pdf" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcm2pdf" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcm2pdf \- Extract PDF file from DICOM encapsulated PDF
index e8580f39574b22405dcb50faf8eae9e31266d01c..e04388132f5a690335e44b358eea7d0b257fa822 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcm2pnm" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcm2pnm" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcm2pnm \- Convert DICOM images to PGM/PPM, PNG, TIFF or BMP
index 06c78b6d6d526b043dc85bdae870af41adce8165..95d4f5a1f76624708f3e60c84fca161f30a9002f 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcm2xml" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcm2xml" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcm2xml \- Convert DICOM file and data set to XML
index b82bb6d815eabb24e221f09abea04de452709bc6..82d651f48c0529fc3e12485d3e40233aca7fa68b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmcjpeg" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmcjpeg" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmcjpeg \- Encode DICOM file to JPEG transfer syntax
@@ -280,44 +280,76 @@ decompression color space conversion
 
   # Never convert color space during decompression.
 
-standard YCbCr component subsampling (not with +tl):
+decompr. workaround options for incorrect encodings (if input is compressed):
 
-  +s4   --sample-444
-          4:4:4 sampling with YBR_FULL (default)
+  +w6   --workaround-pred6
+          enable workaround for JPEG lossless images
+          with overflow in predictor 6
 
-  # This option disables color component subsampling for compression in
-  # the YCbCr color space. The DICOM photometric interpretation is
-  # encoded as YBR_FULL.
+  # DICOM images with 16 bits/pixel have been observed "in the wild"
+  # that are compressed with lossless JPEG and need special handling
+  # because the encoder produced an 16-bit integer overflow in predictor
+  # 6, which needs to be compensated (reproduced) during decompression.
+  # This flag enables a correct decompression of such faulty images, but
+  # at the same time will cause an incorrect decompression of correctly
+  # compressed images. Use with care.
+
+  +wi   --workaround-incpl
+          enable workaround for incomplete JPEG data
+
+  # This option causes dcmjpeg to ignore incomplete JPEG data
+  # at the end of a compressed fragment and to start decompressing
+  # the next frame from the next fragment (if any). This permits
+  # images with incomplete JPEG data to be decoded.
+
+  +wc   --workaround-cornell
+          enable workaround for 16-bit JPEG lossless
+          Cornell images with Huffman table overflow
+
+  # One of the first open-source implementations of lossless JPEG
+  # compression, the "Cornell" library, has a well-known bug that leads
+  # to invalid values in the Huffmann table when images with 16 bit/sample
+  # are compressed. This flag enables a workaround that permits such
+  # images to be decoded correctly.
+
+YCbCr component subsampling (lossy JPEG only):
 
   +s2   --sample-422
-          4:2:2 subsampling with YBR_FULL_422
+          4:2:2 subsampling with YBR_FULL_422 (default)
 
   # This option enables a 4:2:2 color component subsampling for
   # compression in the YCbCr color space. The DICOM photometric
-  # interpretation is encoded as YBR_FULL.
+  # interpretation is encoded as YBR_FULL_422.
 
 non-standard YCbCr component subsampling (not with +tl):
 
+  +s4   --nonstd-444
+          4:4:4 sampling with YBR_FULL
+
+  # This option disables color component subsampling for compression in
+  # the YCbCr color space. The DICOM photometric interpretation is
+  # encoded as YBR_FULL, which violates DICOM rules for lossy JPEG.
+
   +n2   --nonstd-422-full
           4:2:2 subsampling with YBR_FULL
 
   # This option enables a 4:2:2 color component subsampling for
   # compression in the YCbCr color space. The DICOM photometric
-  # interpretation is encoded as YBR_FULL which violates DICOM rules.
+  # interpretation is encoded as YBR_FULL, which violates DICOM rules.
 
   +n1   --nonstd-411-full
           4:1:1 subsampling with YBR_FULL
 
   # This option enables a 4:1:1 color component subsampling for
   # compression in the YCbCr color space. The DICOM photometric
-  # interpretation is encoded as YBR_FULL which violates DICOM rules.
+  # interpretation is encoded as YBR_FULL, which violates DICOM rules.
 
   +np   --nonstd-411
           4:1:1 subsampling with YBR_FULL_422
 
   # This option enables a 4:1:1 color component subsampling for
   # compression in the YCbCr color space. The DICOM photometric
-  # interpretation is encoded as YBR_FULL_422 which violates DICOM rules.
+  # interpretation is encoded as YBR_FULL_422, which violates DICOM rules.
 .fi
 .PP
 .SS "encapsulated pixel data encoding options:"
@@ -529,7 +561,7 @@ data set trailing padding:
 .PP
 .SH "NOTES"
 .PP
-The \fBdcmcjpeg\fP utility compresses DICOM images of all SOP classes\&. Special handling has been implemented for CT images (where the modality transformation is required to create Hounsfield units) and the XA/RF/Biplane SOP classes (where the modality transformation has 'inversed' semantics)\&. However, \fBdcmcjpeg\fP does not attempt to ensure that the compressed image still complies with all restrictions of the object's IOD\&.
+The \fBdcmcjpeg\fP utility compresses DICOM images of all SOP classes\&. It processes all Pixel Data (7fe0,0010) elements in the dataset, i\&.e\&. compression is also performed on an icon image\&. Special handling has been implemented for CT images (where the modality transformation is required to create Hounsfield units) and the XA/RF/Biplane SOP classes (where the modality transformation has 'inversed' semantics)\&. However, \fBdcmcjpeg\fP does not attempt to ensure that the compressed image still complies with all restrictions of the object's IOD\&.
 .PP
 A few examples:
 .PP
@@ -615,4 +647,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBdcmdjpeg\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2001-2016 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2001-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index 099d46733a4443de1546baa919ba50c0f7e5d0fc..185c00b3ebb9f8ad291b4719d5d8f120b53f7850 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmcjpls" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmcjpls" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmcjpls \- Encode DICOM file to JPEG-LS transfer syntax
@@ -282,7 +282,7 @@ data set trailing padding:
 .PP
 .SH "NOTES"
 .PP
-The \fBdcmcjpls\fP utility compresses DICOM images of all SOP classes\&. However, \fBdcmcjpls\fP does not attempt to ensure that the compressed image still complies with all restrictions of the object's IOD\&.
+The \fBdcmcjpls\fP utility compresses DICOM images of all SOP classes\&. It processes all Pixel Data (7fe0,0010) elements in the dataset, i\&.e\&. compression is also performed on an icon image\&. However, \fBdcmcjpls\fP does not attempt to ensure that the compressed image still complies with all restrictions of the object's IOD\&.
 .PP
 The user is responsible for making sure that the compressed images he creates are compliant with the DICOM standard\&. If in question, the \fBdcmcjpls\fP utility allows one to convert an image to secondary capture - this SOP class does not pose restrictions as the ones mentioned above\&.
 .SH "TRANSFER SYNTAXES"
@@ -330,4 +330,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBdcmdjpls\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2009-2016 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2009-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index bccd11a5f4f9e507f278c6e5f29f738e303fe1c1..7ca68c72b71ea71b362d2f056c53a4e8e938fe03 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmconv" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmconv" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmconv \- Convert DICOM file encoding
index dbb454a704def402412dbf3ace8966eb2129660a..dabab557d31554d2b57186fab0f409d1d06868b6 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmcrle" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmcrle" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmcrle \- Encode DICOM file to RLE transfer syntax
@@ -165,7 +165,9 @@ data set trailing padding:
 .PP
 .SH "NOTES"
 .PP
-Please note that the DICOM standard does not allow for storing the pixel data with multiple fragments per frame (when RLE compression is used)\&. So limiting the fragment size with option \fI--fragment-size\fP (or \fI+fs\fP) may result in a non-standard conformant DICOM image\&.
+The \fBdcmcrle\fP utility compresses DICOM images of all SOP classes\&. It processes all Pixel Data (7fe0,0010) elements in the dataset, i\&.e\&. compression is also performed on an icon image\&.
+.PP
+Please note that the DICOM standard does not allow for storing the pixel data with multiple fragments per frame (when RLE compression is used)\&. So limiting the fragment size with option \fI--fragment-size\fP (or \fI+fs\fP) may result in a non-standard compliant DICOM image\&.
 .SH "TRANSFER SYNTAXES"
 .PP
 \fBdcmcrle\fP supports the following transfer syntaxes for input (\fIdcmfile-in\fP):
@@ -210,4 +212,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBdcmdrle\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2002-2014 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2002-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index d3c6c22e0655c0227522f6825be5f519c14710de..c40547b020a9eb852ef167d4c88148d364c49b2f 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmdjpeg" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmdjpeg" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmdjpeg \- Decode JPEG-compressed DICOM file
@@ -171,7 +171,17 @@ workaround options for incorrect JPEG encodings:
   # This option causes dcmjpeg to ignore incomplete JPEG data
   # at the end of a compressed fragment and to start decompressing
   # the next frame from the next fragment (if any). This permits
-  # images with incomplete JPEG data to be decoded..fi
+  # images with incomplete JPEG data to be decoded.
+
+  +wc   --workaround-cornell
+          enable workaround for 16-bit JPEG lossless
+          Cornell images with Huffman table overflow
+
+  # One of the first open-source implementations of lossless JPEG
+  # compression, the "Cornell" library, has a well-known bug that leads
+  # to invalid values in the Huffmann table when images with 16 bit/sample
+  # are compressed. This flag enables a workaround that permits such
+  # images to be decoded correctly..fi
 .PP
 .SS "output options"
 .PP
@@ -287,4 +297,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBdcmcjpeg\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2001-2016 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2001-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index e5d831681ca42a43c928c72da2d81faab8230ca0..822d22493c00ad598352d48c3690a5e94d8f0f47 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmdjpls" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmdjpls" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmdjpls \- Decode JPEG-LS compressed DICOM file
index e569d24d94834c2e414f3057e1ae4aa261cc6e56..0f49071d01a595bf8442c3a34ac79f2f5f5aac24 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmdrle" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmdrle" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmdrle \- Decode RLE-compressed DICOM file
index 3815358b9c85a00b8a04e878e4d72b5091ccd8ae..4705c273bfc2d504772ead58c4c185e6707ec5ce 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmdspfn" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmdspfn" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmdspfn \- Export standard display curves to a text file
index f05ec7e9706f931e70beb6fa3e3eb6ace0c7a868..07ad0647e44163ad4c51e2315eb37a5491f64069 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmdump" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmdump" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmdump \- Dump DICOM file and data set
index c6cb8c0e34bb1b419d80a460b9d3cd26fbf89bfa..5b96f3ca6712fc72c9d7edd125874f89e0a63451 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmftest" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmftest" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmftest \- Test if file uses DICOM part 10 format
index c21001bce53d80ede846819648ab54174677c22b..83b88eb257a09242161cbb781c136f7d1249ae76 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmgpdir" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmgpdir" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmgpdir \- Create a general purpose DICOMDIR
diff --git a/doxygen/manpages/man1/dcmicmp.1 b/doxygen/manpages/man1/dcmicmp.1
new file mode 100644 (file)
index 0000000..917d885
--- /dev/null
@@ -0,0 +1,303 @@
+.TH "dcmicmp" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
+.nh
+.SH NAME
+dcmicmp \- Compare DICOM images and compute difference metrics
+
+.SH "SYNOPSIS"
+.PP
+.PP
+.nf
+dcmicmp [options] dcmfile-in-1 dcmfile-in-2
+.fi
+.PP
+.SH "DESCRIPTION"
+.PP
+The \fBdcmicmp\fP utility reads two DICOM images, an original 'reference
+image' and a post-processed 'test image', to which some kind of processing such as a lossy image compression, followed by decompression, has been applied\&. This tool requires that both images have the same resolution, the same number of frames and are either both color or monochrome\&. Compressed images are not supported\&.
+.PP
+The \fBdcmicmp\fP utility then compares both images and computes and prints metrics that describe how similar or different both images are:
+.PP
+.IP "\(bu" 2
+the maximum absolute error is the largest difference between an pixel value in the reference image and the corresponding pixel value in the test image\&.
+.IP "\(bu" 2
+the mean absolute error (MAE) is the average difference between original pixel value and test image pixel value
+.IP "\(bu" 2
+the root mean square error (RMSE) is computed by adding the squares of all difference values, then dividing by the number of values added, and then taking the square root\&.
+.IP "\(bu" 2
+The peak signal to noise ratio (PSNR) considers the reference image as a signal and the differences between reference and test image as noise\&. PSNR is the maximum signal strength (i\&.e\&. maximum pixel value in the reference image) divided by the RMSE, expressed on a logarithmic scale in dB\&.
+.IP "\(bu" 2
+The signal to noise ratio (PSNR) also considers the reference image as a signal and the differences between reference and test image as noise\&. SNR is the average signal strength divided by the RMSE, expressed on a logarithmic scale in dB\&.
+.PP
+.PP
+All metrics are computed as defined in R\&.C\&. Gonzalez and R\&.E\&. Woods, 'Digital Image Processing,' Prentice Hall 2008\&.
+.SH "PARAMETERS"
+.PP
+.PP
+.nf
+dcmfile-in-1  Reference DICOM image file for comparison
+
+dcmfile-in-2  Test DICOM image file for comparison
+.fi
+.PP
+.SH "OPTIONS"
+.PP
+.SS "general options"
+.PP
+.nf
+  -h    --help
+          print this help text and exit
+
+        --version
+          print version information and exit
+
+        --arguments
+          print expanded command line arguments
+
+  -q    --quiet
+          quiet mode, print no warnings and errors
+
+  -v    --verbose
+          verbose mode, print processing details
+
+  -d    --debug
+          debug mode, print debug information
+
+  -ll   --log-level  [l]evel: string constant
+          (fatal, error, warn, info, debug, trace)
+          use level l for the logger
+
+  -lc   --log-config  [f]ilename: string
+          use config file f for the logger
+.fi
+.PP
+.SS "input options"
+.PP
+.nf
+input file format:
+
+  +f    --read-file
+          read file format or data set (default)
+
+  +fo   --read-file-only
+          read file format only
+
+  -f    --read-dataset
+          read data set without file meta information
+
+input transfer syntax:
+
+  -t=   --read-xfer-auto
+          use TS recognition (default)
+
+  -td   --read-xfer-detect
+          ignore TS specified in the file meta header
+
+  -te   --read-xfer-little
+          read with explicit VR little endian TS
+
+  -tb   --read-xfer-big
+          read with explicit VR big endian TS
+
+  -ti   --read-xfer-implicit
+          read with implicit VR little endian TS
+.fi
+.PP
+.SS "image processing options"
+.PP
+.nf
+modality LUT transformation:
+
+  +M    --use-modality
+          use modality LUT transformation (default)
+
+  -M    --no-modality
+          ignore stored modality LUT transformation
+
+VOI LUT transformation:
+
+  -W    --no-windowing
+          no VOI windowing (default)
+
+  +Wi   --use-window  [n]umber: integer
+          use the n-th VOI window from image file
+
+  +Wl   --use-voi-lut  [n]umber: integer
+          use the n-th VOI look up table from image file
+
+  +Wm   --min-max-window
+          compute VOI window using min-max algorithm
+          on both images separately
+
+  +Wn   --min-max-window-n
+          compute VOI window using min-max algorithm
+          on both images separately, ignoring extremes
+
+  +Wr   --min-max-ref
+          compute VOI window using min-max algorithm
+          and use same window for the test image
+
+  +Wq   --min-max-n-ref
+          compute VOI window using min-max algorithm,
+          ignoring extreme values
+          and use same window for the test image
+
+  +Ww   --set-window  [c]enter [w]idth: float
+          compute VOI window using center c and width w
+
+  +Wfl  --linear-function
+          set VOI LUT function to LINEAR
+
+  +Wfs  --sigmoid-function
+          set VOI LUT function to SIGMOID
+
+presentation LUT transformation:
+
+  +Pid  --identity-shape
+          set presentation LUT shape to IDENTITY
+
+  +Piv  --inverse-shape
+          set presentation LUT shape to INVERSE
+
+  +Pod  --lin-od-shape
+          set presentation LUT shape to LIN OD
+.fi
+.PP
+.SS "image comparison metrics options"
+.PP
+.nf
+  +ce   --check-error  [l]imit: integer
+          check if max absolute error <= limit
+
+  # Return exit code EXITCODE_LIMIT_EXCEEDED_MAX_ERROR if the computed
+  # maximum absolute error is larger than the given limit.
+
+  +cm   --check-mae  [l]imit: float
+          check if mean absolute error <= limit
+
+  # Return exit code EXITCODE_LIMIT_EXCEEDED_MAE if the computed
+  # mean absolute error is larger than the given limit.
+
+  +cr   --check-rmse  [l]imit: float
+          check if root mean square error <= limit
+
+  # Return exit code EXITCODE_LIMIT_EXCEEDED_RMSE if the computed
+  # root mean square error is larger than the given limit.
+
+  +cp   --check-psnr  [l]imit: float
+          check if PSNR >= limit
+
+  # Return exit code EXITCODE_LIMIT_EXCEEDED_PSNR if the computed
+  # peak signal to noise ratio is smaller than the given limit
+  # (for PSNR, higher values mean better image quality)
+
+  +cs   --check-snr  [l]imit: float
+          check if SNR >= limit
+
+  # Return exit code EXITCODE_LIMIT_EXCEEDED_PSNR if the computed
+  # signal to noise ratio is smaller than the given limit
+  # (for SNR, higher values mean better image quality)
+.fi
+.PP
+.SS "output options"
+.PP
+.nf
+  +sd   --save-diff  [f]ilename: string
+          write secondary capture difference image
+
+  # Create a Multiframe Secondary Capture image that contains a
+  # difference image between reference and test image. For monochrome
+  # images, one difference frame is created for each frame in the reference
+  # image. For color images, three monochrome frames are created for each
+  # frame in the reference image, corresponding to the differences in the
+  # red, green and blue color plane. The difference image will have
+  # BitsStored 8 or 16, depending on the properties of the reference image.
+
+  +a    --amplify  [f]actor: float
+          multiply diff image pixel values by f
+
+  # This option can be used to amplify the grayscale values in the
+  # difference image by multiplying each value with the given factor.
+  # Alternatively, a DICOM VOI LUT window may be used when visualizing
+  # the difference image.
+.fi
+.PP
+.SH "NOTES"
+.PP
+.SS "grayscale display pipeline"
+Monochrome DICOM images require that a multi-stage display pipeline is executed in order to convert the raw pixel values to the so-called presentation values (p-values) that are sent to the (possibly calibrated) display\&. When comparing the similarity of images before and after post-processing, it can be relevant to activate some stages of this display pipeline before calculating the difference image and metrics\&. The image processing options allow the caller to either activate or deactivate the Modality LUT, VOI LUT and Presentation LUT transformations\&. In any case, the same transformation is applied to both images, although possibly with different parameters if for example the 'first VOI LUT window' stored in each image is applied\&. This assumes that the post-processing algorithm (e\&.g\&. compression algorithm) has adapted the values of such windows during compression such that the image display after applying the window is as close as possible to the reference\&. For images with more than 8 bits/sample it may be important to known which VOI LUT transformation will be applied by the user when viewing the image, because this may affect the perceived image quality\&. Therefore, absolute Window parameters can also be given with the --set-window option, which will then be applied to both images\&.
+.SS "suitability of images for diagnostic purposes"
+The user should also note that the metrics computed by this tool cannot predict or estimate the suitability of lossy compressed image for diagnostic purposes\&. Much more complex image processing and an understanding of the image content (e\&.g\&. body part) would be needed for this purpose\&. The metrics computed provide an estimation of the level of distortion caused by the post-processing - no more and no less\&.
+.SH "TRANSFER SYNTAXES"
+.PP
+\fBdcmicmp\fP supports the following transfer syntaxes for input:
+.PP
+.PP
+.nf
+LittleEndianImplicitTransferSyntax             1.2.840.10008.1.2
+LittleEndianExplicitTransferSyntax             1.2.840.10008.1.2.1
+DeflatedExplicitVRLittleEndianTransferSyntax   1.2.840.10008.1.2.1.99 (*)
+BigEndianExplicitTransferSyntax                1.2.840.10008.1.2.2
+.fi
+.PP
+.PP
+The difference image file is always written in Little Endian Implicit Transfer Syntax\&.
+.PP
+(*) if compiled with zlib support enabled
+.SH "LOGGING"
+.PP
+The level of logging output of the various command line tools and underlying libraries can be specified by the user\&. By default, only errors and warnings are written to the standard error stream\&. Using option \fI--verbose\fP also informational messages like processing details are reported\&. Option \fI--debug\fP can be used to get more details on the internal activity, e\&.g\&. for debugging purposes\&. Other logging levels can be selected using option \fI--log-level\fP\&. In \fI--quiet\fP mode only fatal errors are reported\&. In such very severe error events, the application will usually terminate\&. For more details on the different logging levels, see documentation of module 'oflog'\&.
+.PP
+In case the logging output should be written to file (optionally with logfile rotation), to syslog (Unix) or the event log (Windows) option \fI--log-config\fP can be used\&. This configuration file also allows for directing only certain messages to a particular output stream and for filtering certain messages based on the module or application where they are generated\&. An example configuration file is provided in \fI<etcdir>/logger\&.cfg\fP\&.
+.SH "COMMAND LINE"
+.PP
+All command line tools use the following notation for parameters: square brackets enclose optional values (0-1), three trailing dots indicate that multiple values are allowed (1-n), a combination of both means 0 to n values\&.
+.PP
+Command line options are distinguished from parameters by a leading '+' or '-' sign, respectively\&. Usually, order and position of command line options are arbitrary (i\&.e\&. they can appear anywhere)\&. However, if options are mutually exclusive the rightmost appearance is used\&. This behavior conforms to the standard evaluation rules of common Unix shells\&.
+.PP
+In addition, one or more command files can be specified using an '@' sign as a prefix to the filename (e\&.g\&. \fI@command\&.txt\fP)\&. Such a command argument is replaced by the content of the corresponding text file (multiple whitespaces are treated as a single separator unless they appear between two quotation marks) prior to any further evaluation\&. Please note that a command file cannot contain another command file\&.
+.SH "EXIT CODES"
+.PP
+The \fBdcmicmp\fP utility uses the following exit codes when terminating\&. This enables the user to check for the reason why the application terminated\&.
+.SS "general"
+.PP
+.nf
+EXITCODE_NO_ERROR                         0
+EXITCODE_COMMANDLINE_SYNTAX_ERROR         1
+.fi
+.PP
+.SS "input/output file errors"
+.PP
+.nf
+EXITCODE_INVALID_INPUT_FILE              22
+EXITCODE_CANNOT_WRITE_OUTPUT_FILE        40
+.fi
+.PP
+.SS "image processing errors"
+.PP
+.nf
+EXITCODE_INITIALIZE_DIFF_IMAGE           80
+EXITCODE_DISPLAY_PIPELINE                81
+EXITCODE_IMAGE_COMPARISON                82
+.fi
+.PP
+.SS "error codes for exceeded limits"
+.PP
+.nf
+EXITCODE_LIMIT_EXCEEDED_MAX_ERROR        90
+EXITCODE_LIMIT_EXCEEDED_MAE              91
+EXITCODE_LIMIT_EXCEEDED_RMSE             92
+EXITCODE_LIMIT_EXCEEDED_PSNR             93
+EXITCODE_LIMIT_EXCEEDED_SNR              94
+.fi
+.PP
+.SH "ENVIRONMENT"
+.PP
+The \fBdcmicmp\fP utility will attempt to load DICOM data dictionaries specified in the \fIDCMDICTPATH\fP environment variable\&. By default, i\&.e\&. if the \fIDCMDICTPATH\fP environment variable is not set, the file \fI<datadir>/dicom\&.dic\fP will be loaded unless the dictionary is built into the application (default for Windows)\&.
+.PP
+The default behavior should be preferred and the \fIDCMDICTPATH\fP environment variable only used when alternative data dictionaries are required\&. The \fIDCMDICTPATH\fP environment variable has the same format as the Unix shell \fIPATH\fP variable in that a colon (':') separates entries\&. On Windows systems, a semicolon (';') is used as a separator\&. The data dictionary code will attempt to load each file specified in the \fIDCMDICTPATH\fP environment variable\&. It is an error if no data dictionary can be loaded\&.
+.SH "SEE ALSO"
+.PP
+\fBdcm2pnm\fP(1)
+.SH "COPYRIGHT"
+.PP
+Copyright (C) 2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index cd5fd372f26981e26f5c34c72694fe905d28f87c..6d10ccd3578b21e3f6fdfba1fb8b4e371b5e59a4 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmj2pnm" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmj2pnm" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmj2pnm \- Convert DICOM images to PGM/PPM, PNG, TIFF, JPEG or BMP
@@ -150,7 +150,7 @@ scaling:
   +Syv  --scale-y-size  [n]umber: integer
           scale y axis to n pixels, auto-compute x axis
 
-color space conversion (compressed images only):
+color space conversion (JPEG compressed images only):
 
   +cp   --conv-photometric
           convert if YCbCr photometric interpretation (default)
@@ -171,6 +171,38 @@ color space conversion (compressed images only):
   +cn   --conv-never
           never convert color space
 
+workaround options for incorrect encodings (JPEG compressed images only):
+
+  +w6   --workaround-pred6
+          enable workaround for JPEG lossless images
+          with overflow in predictor 6
+
+  # DICOM images with 16 bits/pixel have been observed "in the wild"
+  # that are compressed with lossless JPEG and need special handling
+  # because the encoder produced an 16-bit integer overflow in predictor
+  # 6, which needs to be compensated (reproduced) during decompression.
+  # This flag enables a correct decompression of such faulty images, but
+  # at the same time will cause an incorrect decompression of correctly
+  # compressed images. Use with care.
+
+  +wi   --workaround-incpl
+          enable workaround for incomplete JPEG data
+
+  # This option causes dcmj2pnm to ignore incomplete JPEG data
+  # at the end of a compressed fragment and to start decompressing
+  # the next frame from the next fragment (if any). This permits
+  # images with incomplete JPEG data to be decoded.
+
+  +wc   --workaround-cornell
+          enable workaround for 16-bit JPEG lossless
+          Cornell images with Huffman table overflow
+
+  # One of the first open-source implementations of lossless JPEG
+  # compression, the "Cornell" library, has a well-known bug that leads
+  # to invalid values in the Huffmann table when images with 16 bit/sample
+  # are compressed. This flag enables a workaround that permits such
+  # images to be decoded correctly.
+
 modality LUT transformation:
 
   -M    --no-modality
@@ -498,4 +530,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBdcm2pnm\fP(1), \fBimg2dcm\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2001-2014 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2001-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index 890309ab84bec48283ed7c089730d36825e61669..8226b89c42faf21604a76f39bd9ab7f22bdd8698 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcml2pnm" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcml2pnm" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcml2pnm \- Convert DICOM images to PGM/PPM, PNG, TIFF or BMP
index 692fb1abbbe8878ff6cb7a747cc0aa22ea0d7dee..027dbb6392d1fca249f6e84c69cbf62f216e2f5b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmmkcrv" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmmkcrv" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmmkcrv \- Add 2D curve data to image
index d24f5eba94903f64f25d77d04e098f8195810bc1..e56cbcdd5db07b994b9109f53fd4722fc43a9583 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmmkdir" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmmkdir" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmmkdir \- Create a DICOMDIR file
index b166598e53bd7c36b114c0517a96e1196bb78f26..2fa719da407942b9cdf9790c157aaf271e4ef852 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmmklut" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmmklut" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmmklut \- Create DICOM look-up tables
index e417cf8a2d10946ed6a20543543969281fe5b679..f9b07da4d4345d28839e11e6a995fc526d34cbc8 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmodify" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmodify" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmodify \- Modify DICOM files
index e32e2dac1b4e87400441f43349ab54a5b93c1fd1..1722ef9107de468bbc7b9b134a4c1196032f75e5 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmp2pgm" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmp2pgm" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmp2pgm \- Read DICOM image and presentation state and render bitmap
index 69a259e0f6ab96bec4c56a852a9cd1641efe85cd..3f99960e3cd10263ae1022471236afa8f65c4c0d 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmprscp" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmprscp" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmprscp \- DICOM basic grayscale print management SCP
index 324ee53f9d0803424d9919db7e95fb68936b22bc..b7ae6a501c6586cde7fb4855752402154976aacc 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmprscu" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmprscu" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmprscu \- Print spooler for presentation state viewer
@@ -93,14 +93,14 @@ dcmfile-in  stored print file(s) to be spooled
          dump all DIMSE messages
 .fi
 .PP
-.SS "spooler options (only with --spool)"
+.SS "spooler options (only with &ndash;spool)"
 .PP
 .nf
        --sleep  [d]elay: integer (default: 1)
          sleep d seconds between spooler checks
 .fi
 .PP
-.SS "basic film session options (not with --spool):"
+.SS "basic film session options (not with &ndash;spool):"
 .PP
 .nf
        --copies  [v]alue: integer (1..100, default: 1)
index f5637cf17e8a8e8ba154ca4af954101d62309bd9..6cbc16a5fc62ce872689002ccdeb2f73f28a4a1a 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmpschk" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmpschk" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmpschk \- Checking tool for presentation states
index f8fa8230bc37d883ab2dbeff5b3b8a22d89e5b39..0db523699f9b53394393139a75d999c27e8bcf98 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmpsmk" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmpsmk" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmpsmk \- Create DICOM grayscale softcopy presentation state
index 04afa84c6f795d349672bcd4e31d50adbc323bb8..1bdc27dc05bff58e351ea19872b8c160820c140c 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmpsprt" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmpsprt" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmpsprt \- Read DICOM images and presentation states and render print job
@@ -140,7 +140,7 @@ dcmfile-in  DICOM image file(s) to be printed
          set reflected ambient light to v (in cd/m^2)
 .fi
 .PP
-.SS "basic film session options (only with --spool)"
+.SS "basic film session options (only with &ndash;spool)"
 .PP
 .nf
        --copies  [v]alue: integer (1..100, default: 1)
index 7d4f1644805b6ea66a36422f63121bc1de1f9128..0c6ab6c47c063c0f3b5c59a15100ef0d584824ce 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmpsrcv" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmpsrcv" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmpsrcv \- Network receive for presentation state viewer
index 20da3a006126547d3de5803336248397ab728d13..052ac089fd68fbf9c4ebd391d0c5e52c4c411e25 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmpssnd" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmpssnd" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmpssnd \- Network send for presentation state viewer
index c6eb695d435e5a411759f007d01757acc0ab6c8c..72f736a7dd936c5b4bfd97b71c7adb8fc37e366f 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmqridx" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmqridx" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmqridx \- Register a DICOM image file in an image database index file
index 3d97e49ab945b7071bdbf13bef06d5ba8ed72fbb..811c04923594760814b468223bb1673d8aa3a2ad 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmqrscp" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmqrscp" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmqrscp \- DICOM image archive (central test node)
@@ -370,21 +370,47 @@ other network options:
           silently correct space-padded UIDs
 .fi
 .PP
-.SS "encoding options"
+.SS "processing options"
 .PP
 .nf
-post-1993 value representations:
+specific character set:
 
-  +u    --enable-new-vr
-          enable support for new VRs (UN/UT) (default)
+  # the following options require support from an underlying character
+  # encoding library (see output of --version on which one is available)
 
-  -u    --disable-new-vr
-          disable support for new VRs, convert to OB
+  +Cr   --use-request-charset
+          try to convert all element values that are affected by
+          Specific Character Set (0008,0005) to the one specified
+          in the request data set, fall back to the one specified
+          via --convert-to-xxx if that is not possible
+          (default, unless overridden by config file)
+
+  -Cr   --override-charset
+          convert affected element values to the character set
+          specified via --convert-to-xxx, ignoring the one
+          specified in the request
+
+  +A7   --convert-to-ascii
+          convert affected element values to 7-bit ASCII
+          (default, unless overridden by config file)
 
-  # This option disables generation of new VRs (UN/UT) when writing
-  # DICOM encoded data to a file to the network.  This option can be
-  # used to force compatibility with applications which do not support
-  # these value representations.
+  +U8   --convert-to-utf8
+          convert affected element values to UTF-8
+
+  +L1   --convert-to-latin1
+          convert affected element values to ISO 8859-1
+
+  +C    --convert-to-charset  [c]harset: string
+          convert affected element values to the character set
+          specified by the DICOM defined term c
+
+  -Ct   --transliterate
+          try to approximate characters that cannot be
+          represented through similar looking characters
+
+  -Cd   --discard-illegal
+          discard characters that cannot be represented
+          in destination character set
 .fi
 .PP
 .SS "output options"
@@ -424,6 +450,14 @@ output transfer syntax:
   +td   --write-xfer-deflated
           write with deflated explicit VR little endian TS
 
+post-1993 value representations:
+
+  +u    --enable-new-vr
+          enable support for new VRs (UN/UT) (default)
+
+  -u    --disable-new-vr
+          disable support for new VRs, convert to OB
+
 group length encoding (not with --bit-preserving):
 
   +g=   --group-length-recalc
@@ -457,45 +491,6 @@ deflate compression level (only with --propose-deflated or
 
   +cl   --compression-level  [l]evel: integer (default: 6)
           0=uncompressed, 1=fastest, 9=best compression
-
-specific character set:
-
-  # the following options require support from an underlying character
-  # encoding library (see output of --version on which one is available)
-
-  +Cr   --use-request-charset
-          try to convert all element values that are affected by
-          Specific Character Set (0008,0005) to the one specified
-          in the request data set, fall back to the one specified
-          via --convert-to-xxx if that is not possible
-          (default, unless overridden by config file)
-
-  -Cr   --override-charset
-          convert affected element values to the character
-          set specified via --convert-to-xxx, ignoring
-          the one specified in the request
-
-  +A7   --convert-to-ascii
-          convert affected element values to 7-bit ASCII
-          (default, unless overridden by config file)
-
-  +U8   --convert-to-utf8
-          convert affected element values to UTF-8
-
-  +L1   --convert-to-latin1
-          convert affected element values to ISO 8859-1
-
-  +C    --convert-to-charset  [c]harset: string
-          convert affected element values to the character set
-          specified by the DICOM defined term c
-
-  -Ct   --transliterate
-          try to approximate characters that cannot be
-          represented through similar looking characters
-
-  -Cd   --discard-illegal
-          discard characters that cannot be represented
-          in destination character set
 .fi
 .PP
 .SH "NOTES"
@@ -594,7 +589,7 @@ OphthalmicPhotography16BitImageStorage               1.2.840.10008.5.1.4.1.1.77.
 StereometricRelationshipStorage                      1.2.840.10008.5.1.4.1.1.77.1.5.3
 OphthalmicTomographyImageStorage                     1.2.840.10008.5.1.4.1.1.77.1.5.4
 VLWholeSlideMicroscopyImageStorage                   1.2.840.10008.5.1.4.1.1.77.1.6
-RETIRED_VLMultiFrameImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
+RETIRED_VLMultiframeImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
 LensometryMeasurementsStorage                        1.2.840.10008.5.1.4.1.1.78.1
 AutorefractionMeasurementsStorage                    1.2.840.10008.5.1.4.1.1.78.2
 KeratometryMeasurementsStorage                       1.2.840.10008.5.1.4.1.1.78.3
@@ -790,7 +785,7 @@ WideFieldOphthalmicPhotogr.3DCoordinatesImageStorage 1.2.840.10008.5.1.4.1.1.77.
 OphthalmicOpticalCoherenceTomogr.EnFaceImageStorage  1.2.840.10008.5.1.4.1.1.77.1.5.7
 OphthalmicOpticalCoh.Tomogr.BscanVolumeAnalysisStor. 1.2.840.10008.5.1.4.1.1.77.1.5.8
 VLWholeSlideMicroscopyImageStorage                   1.2.840.10008.5.1.4.1.1.77.1.6
-RETIRED_VLMultiFrameImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
+RETIRED_VLMultiframeImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
 LensometryMeasurementsStorage                        1.2.840.10008.5.1.4.1.1.78.1
 AutorefractionMeasurementsStorage                    1.2.840.10008.5.1.4.1.1.78.2
 KeratometryMeasurementsStorage                       1.2.840.10008.5.1.4.1.1.78.3
@@ -826,6 +821,7 @@ PatientRadiationDoseSRStorage                        1.2.840.10008.5.1.4.1.1.88.
 ContentAssessmentResultsStorage                      1.2.840.10008.5.1.4.1.1.90.1
 EncapsulatedPDFStorage                               1.2.840.10008.5.1.4.1.1.104.1
 EncapsulatedCDAStorage                               1.2.840.10008.5.1.4.1.1.104.2
+EncapsulatedSTLStorage                               1.2.840.10008.5.1.4.1.1.104.3
 PositronEmissionTomographyImageStorage               1.2.840.10008.5.1.4.1.1.128
 LegacyConvertedEnhancedPETImageStorage               1.2.840.10008.5.1.4.1.1.128.1
 RETIRED_StandalonePETCurveStorage                    1.2.840.10008.5.1.4.1.1.129
@@ -994,4 +990,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBdcmqridx\fP(1), \fBdcmqrti\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 1993-2017 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 1993-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index 07e451241a8a445d3530def371fa652cbab02940..2ef941a561b4a16b4c9cbabd6c2bf462ff407aca 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmqrti" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmqrti" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmqrti \- The Terminal Initiator Telnet Client Program
index 240e86bfa5ae1cddf93a6dcfe88c9c0c3bfa0711..f2714f08abf8ee47efb476dbe3ce1725cc7c7cd9 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmquant" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmquant" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmquant \- Convert DICOM color images to palette color
index 0b0f8f8c597ccf8dcb472c1635736be2a4f8ca28..984f2d86ee1936ade9846853171553da6ebb0fcf 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmrecv" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmrecv" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmrecv \- Simple DICOM storage SCP (receiver)
index c62b2f63f58b2fa8df013bc53895cd218057d43d..9048fbdd013b0c8d40ed58aeffaf8e80a77b6d36 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmscale" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmscale" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmscale \- Scale DICOM images
index 735f4620ae74cb4c3e71a49c22606bad645db0fc..00fb79c72b9c04f9d1c356e422867290e36e5088 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmsend" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmsend" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmsend \- Simple DICOM storage SCU (sender)
@@ -254,7 +254,7 @@ Transfer syntaxes supported by decoders:
 .fi
 .PP
 .PP
-Since \fBdcmsend\fP tries to be as simple as possible for the user, by default presentation contexts might be proposed to the SCP that are strictly speaking 'illegal'\&. This is because, according to the DICOM standard, the SCU always has to propose the default transfer syntax in at least one presentation context associated with each abstract syntax (i\&.e\&. SOP class)\&. This requirement is waived when the SCU only has access to the SOP instance in lossy compressed form\&. With option \fI--no-illegal-proposal\fP the strict DICOM-conformant behavior can be enforced, i\&.e\&. no possibly illegal presentation context will be proposed but the corresponding SOP instance will be rejected (if needed)\&.
+Since \fBdcmsend\fP tries to be as simple as possible for the user, by default presentation contexts might be proposed to the SCP that are strictly speaking 'illegal'\&. This is because, according to the DICOM standard, the SCU always has to propose the default transfer syntax in at least one presentation context associated with each abstract syntax (i\&.e\&. SOP class)\&. This requirement is waived if the SCU only has access to the SOP instance in lossy compressed form or if the decompressed pixel data would be too large to be encoded\&. With option \fI--no-illegal-proposal\fP the strict DICOM-conformant behavior can be enforced, i\&.e\&. no possibly illegal presentation context will be proposed but the corresponding SOP instance will be rejected (if needed)\&. Please note, however, that the size of the decompressed pixel data is not checked\&.
 .PP
 Please note, however, that the default transfer syntax for 'Lossless JPEG
 Compression', 'Lossy JPEG Compression' and so on are not always proposed as also required by the DICOM standard\&. The same limitation applies to other compression schemes\&. See DICOM PS 3\&.5 section 10 for details\&.
@@ -317,4 +317,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBdcmrecv\fP(1), \fBstorescu\fP(1), \fBstorescp\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2011-2017 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2011-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index a65307a933afd451626a6b9641d7d212f36d52d6..09fdb93140c508b16005080561e5cd338362be94 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcmsign" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcmsign" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcmsign \- Sign and Verify DICOM Files
@@ -119,7 +119,7 @@ input transfer syntax:
           remove all signatures from data set
 .fi
 .PP
-.SS "signature creation options (only with --sign or --sign-item):"
+.SS "signature creation options (only with &ndash;sign or &ndash;sign-item):"
 .PP
 .nf
 private key password:
index 8256cc9aaacdb1c3c39d15aca22f3d9ad8741086..00b0e2e67751e1c0a3aec537ee41cdfff6593ca8 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dcod2lum" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dcod2lum" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dcod2lum \- Convert hardcopy characteristic curve file to softcopy format
index becefbb3a44353bf77f9928783da3cab8f80f3db..a05b40fd1e359eefea6dcd10420a5390c3575414 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dconvlum" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dconvlum" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dconvlum \- Convert VeriLUM files to DCMTK display files
index d584fa3d16d6426385e98444f217ec2349d13f4a..a3770c5b98636c44cbb6d8cc95b822a80511e917 100644 (file)
@@ -1,4 +1,4 @@
-.TH "drtdump" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "drtdump" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 drtdump \- Dump DICOM RT file and data set
index c298afcaec8b830f9a1d46cec09dd9e9b08df858..fe736cbf7d2db273c89ef4141512e167c8208e32 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dsr2html" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dsr2html" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dsr2html \- Render DICOM SR file and data set to HTML/XHTML
@@ -241,6 +241,7 @@ ColonCADSRStorage                           1.2.840.10008.5.1.4.1.1.88.69
 ImplantationPlanSRDocumentStorage           1.2.840.10008.5.1.4.1.1.88.70
 AcquisitionContextSRStorage                 1.2.840.10008.5.1.4.1.1.88.71
 SimplifiedAdultEchoSRStorage                1.2.840.10008.5.1.4.1.1.88.72
+PatientRadiationDoseSRStorage               1.2.840.10008.5.1.4.1.1.88.73
 .fi
 .PP
 .SS "Character Encoding"
@@ -296,4 +297,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBdcmconv\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2000-2016 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2000-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index aeeaa03b0237cda7a0ec91e5eedafb9201f8a0e4..79e7b74b183f8d4f083c3d982d6a5829954ca1ab 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dsr2xml" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dsr2xml" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dsr2xml \- Convert DICOM SR file and data set to XML
@@ -205,6 +205,7 @@ ColonCADSRStorage                           1.2.840.10008.5.1.4.1.1.88.69
 ImplantationPlanSRDocumentStorage           1.2.840.10008.5.1.4.1.1.88.70
 AcquisitionContextSRStorage                 1.2.840.10008.5.1.4.1.1.88.71
 SimplifiedAdultEchoSRStorage                1.2.840.10008.5.1.4.1.1.88.72
+PatientRadiationDoseSRStorage               1.2.840.10008.5.1.4.1.1.88.73
 .fi
 .PP
 .PP
@@ -266,4 +267,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBxml2dsr\fP(1), \fBdcmconv\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2000-2016 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2000-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index bc2298a45cac58f5198eabcb6d23c13d5029b506..48a74ec56874c3d48a38cfb9e9b605b5a12f4918 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dsrdump" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dsrdump" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dsrdump \- Dump DICOM SR file and data set
@@ -219,6 +219,7 @@ ColonCADSRStorage                           1.2.840.10008.5.1.4.1.1.88.69
 ImplantationPlanSRDocumentStorage           1.2.840.10008.5.1.4.1.1.88.70
 AcquisitionContextSRStorage                 1.2.840.10008.5.1.4.1.1.88.71
 SimplifiedAdultEchoSRStorage                1.2.840.10008.5.1.4.1.1.88.72
+PatientRadiationDoseSRStorage               1.2.840.10008.5.1.4.1.1.88.73
 .fi
 .PP
 .SH "LOGGING"
@@ -243,4 +244,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBdcmconv\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2000-2016 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2000-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index f7f766485e3632f8b07000016c60251ed7ee5de2..50fc9d417ce49f8c57d3e831205cc91febf8275f 100644 (file)
@@ -1,4 +1,4 @@
-.TH "dump2dcm" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "dump2dcm" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 dump2dcm \- Convert ASCII dump to DICOM file
index b07255ac0ccdbfc08c9b8b59bee30e1b1f49e4e0..c260be2e600cc5ce065c5f8275c02cc58c227bca 100644 (file)
@@ -1,4 +1,4 @@
-.TH "echoscu" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "echoscu" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 echoscu \- DICOM verification (C-ECHO) SCU
@@ -137,14 +137,32 @@ certification authority:
   +cd   --add-cert-dir  [c]ertificate directory: string
           add certificates in d to list of certificates
 
+security profile:
+
+  +px   --profile-bcp195
+          BCP 195 TLS Profile (default)
+
+  +py   --profile-bcp195-nd
+          Non-downgrading BCP 195 TLS Profile
+
+  +pb   --profile-basic
+          Basic TLS Secure Transport Connection Profile (retired)
+
+  +pa   --profile-aes
+          AES TLS Secure Transport Connection Profile (retired)
+
+  +pn   --profile-null
+          Authenticated unencrypted communication
+          (retired, was used in IHE ATNA)
+
 ciphersuite:
 
+  +cc   --list-ciphers
+          show list of supported TLS ciphersuites and exit
+
   +cs   --cipher  [c]iphersuite name: string
           add ciphersuite to list of negotiated suites
 
-  +dp   --dhparam  [f]ilename: string
-          read DH parameters for DH/DSS ciphersuites
-
 pseudo random generator:
 
   +rs   --seed  [f]ilename: string
@@ -161,9 +179,6 @@ peer authentication:
   -rc   --require-peer-cert
           verify peer certificate, fail if absent (default)
 
-  -vc   --verify-peer-cert
-          verify peer certificate if present
-
   -ic   --ignore-peer-cert
           don't verify peer certificate
 .fi
@@ -198,6 +213,37 @@ All command line tools use the following notation for parameters: square bracket
 Command line options are distinguished from parameters by a leading '+' or '-' sign, respectively\&. Usually, order and position of command line options are arbitrary (i\&.e\&. they can appear anywhere)\&. However, if options are mutually exclusive the rightmost appearance is used\&. This behavior conforms to the standard evaluation rules of common Unix shells\&.
 .PP
 In addition, one or more command files can be specified using an '@' sign as a prefix to the filename (e\&.g\&. \fI@command\&.txt\fP)\&. Such a command argument is replaced by the content of the corresponding text file (multiple whitespaces are treated as a single separator unless they appear between two quotation marks) prior to any further evaluation\&. Please note that a command file cannot contain another command file\&. This simple but effective approach allows one to summarize common combinations of options/parameters and avoids longish and confusing command lines (an example is provided in file \fI<datadir>/dumppat\&.txt\fP)\&.
+.SH "EXIT CODES"
+.PP
+The \fBechoscu\fP utility uses the following exit codes when terminating\&. This enables the user to check for the reason why the application terminated\&.
+.SS "general"
+.PP
+.nf
+EXITCODE_NO_ERROR                         0
+EXITCODE_COMMANDLINE_SYNTAX_ERROR         1
+.fi
+.PP
+.SS "input file errors"
+.PP
+.nf
+EXITCODE_CANNOT_READ_INPUT_FILE          20 (*)
+.fi
+.PP
+.SS "output file errors"
+.PP
+.nf
+EXITCODE_CANNOT_WRITE_OUTPUT_FILE        40 (*)
+.fi
+.PP
+.SS "network errors"
+.PP
+.nf
+EXITCODE_CANNOT_INITIALIZE_NETWORK       60 (*)
+EXITCODE_ASSOCIATION_ABORTED             70
+.fi
+.PP
+.PP
+(*) Actually, these codes are currently not used by \fBechoscu\fP but serve as a placeholder for the corresponding group of exit codes\&.
 .SH "ENVIRONMENT"
 .PP
 The \fBechoscu\fP utility will attempt to load DICOM data dictionaries specified in the \fIDCMDICTPATH\fP environment variable\&. By default, i\&.e\&. if the \fIDCMDICTPATH\fP environment variable is not set, the file \fI<datadir>/dicom\&.dic\fP will be loaded unless the dictionary is built into the application (default for Windows)\&.
@@ -205,4 +251,4 @@ The \fBechoscu\fP utility will attempt to load DICOM data dictionaries specified
 The default behavior should be preferred and the \fIDCMDICTPATH\fP environment variable only used when alternative data dictionaries are required\&. The \fIDCMDICTPATH\fP environment variable has the same format as the Unix shell \fIPATH\fP variable in that a colon (':') separates entries\&. On Windows systems, a semicolon (';') is used as a separator\&. The data dictionary code will attempt to load each file specified in the \fIDCMDICTPATH\fP environment variable\&. It is an error if no data dictionary can be loaded\&.
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 1994-2017 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 1994-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index 3e1e12a0279c54e13f7eff8b35d13e3320e9ffa4..f9b58c47553b34e4ecb435ee48ed94bcfd1fedad 100644 (file)
@@ -1,4 +1,4 @@
-.TH "findscu" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "findscu" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 findscu \- DICOM query (C-FIND) SCU
@@ -184,14 +184,32 @@ certification authority:
   +cd   --add-cert-dir  [c]ertificate directory: string
           add certificates in d to list of certificates
 
+security profile:
+
+  +px   --profile-bcp195
+          BCP 195 TLS Profile (default)
+
+  +py   --profile-bcp195-nd
+          Non-downgrading BCP 195 TLS Profile
+
+  +pb   --profile-basic
+          Basic TLS Secure Transport Connection Profile (retired)
+
+  +pa   --profile-aes
+          AES TLS Secure Transport Connection Profile (retired)
+
+  +pn   --profile-null
+          Authenticated unencrypted communication
+          (retired, was used in IHE ATNA)
+
 ciphersuite:
 
+  +cc   --list-ciphers
+          show list of supported TLS ciphersuites and exit
+
   +cs   --cipher  [c]iphersuite name: string
           add ciphersuite to list of negotiated suites
 
-  +dp   --dhparam  [f]ilename: string
-          read DH parameters for DH/DSS ciphersuites
-
 pseudo random generator:
 
   +rs   --seed  [f]ilename: string
@@ -208,9 +226,6 @@ peer authentication:
   -rc   --require-peer-cert
           verify peer certificate, fail if absent (default)
 
-  -vc   --verify-peer-cert
-          verify peer certificate if present
-
   -ic   --ignore-peer-cert
           don't verify peer certificate
 .fi
index 4a290d1ba10761b0d5425c7065fdbd4ba79b1bde..e99404f0e3cf472c149ad59dffc8f73226321e6a 100644 (file)
@@ -1,4 +1,4 @@
-.TH "getscu" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "getscu" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 getscu \- DICOM retrieve (C-GET) SCU
@@ -153,7 +153,7 @@ preferred storage transfer syntaxes (incoming associations):
   +xi   --implicit
           accept implicit VR little endian TS only
 
- proposed retrieve transfer syntaxes (outgoing associations):
+proposed retrieve transfer syntaxes (outgoing associations):
 
   -x=   --propose-uncompr
           propose all uncompressed TS, explicit VR
@@ -356,7 +356,7 @@ OphthalmicPhotography16BitImageStorage               1.2.840.10008.5.1.4.1.1.77.
 StereometricRelationshipStorage                      1.2.840.10008.5.1.4.1.1.77.1.5.3
 OphthalmicTomographyImageStorage                     1.2.840.10008.5.1.4.1.1.77.1.5.4
 VLWholeSlideMicroscopyImageStorage                   1.2.840.10008.5.1.4.1.1.77.1.6
-RETIRED_VLMultiFrameImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
+RETIRED_VLMultiframeImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
 LensometryMeasurementsStorage                        1.2.840.10008.5.1.4.1.1.78.1
 AutorefractionMeasurementsStorage                    1.2.840.10008.5.1.4.1.1.78.2
 KeratometryMeasurementsStorage                       1.2.840.10008.5.1.4.1.1.78.3
@@ -473,4 +473,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBfindscu\fP(1), \fBmovescu\fP(1), \fBdump2dcm\fP(1), \fBdcmodify\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2011-2017 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2011-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index d5014676ad8f4538a6e03309c8f22ba796c372ab..a82f9d48d235bc74797df11147317be762a2a53f 100644 (file)
@@ -1,4 +1,4 @@
-.TH "img2dcm" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "img2dcm" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 img2dcm \- Convert standard image formats into DICOM format
index ba937bc52a429615510554854922d9e5d5dd7f94..62dfb82918f57993a0b7d1e1f9f340c5715ed5f7 100644 (file)
@@ -1,4 +1,4 @@
-.TH "movescu" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "movescu" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 movescu \- DICOM retrieve (C-MOVE) SCU
@@ -490,7 +490,7 @@ WideFieldOphthalmicPhotogr.3DCoordinatesImageStorage 1.2.840.10008.5.1.4.1.1.77.
 OphthalmicOpticalCoherenceTomogr.EnFaceImageStorage  1.2.840.10008.5.1.4.1.1.77.1.5.7
 OphthalmicOpticalCoh.Tomogr.BscanVolumeAnalysisStor. 1.2.840.10008.5.1.4.1.1.77.1.5.8
 VLWholeSlideMicroscopyImageStorage                   1.2.840.10008.5.1.4.1.1.77.1.6
-RETIRED_VLMultiFrameImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
+RETIRED_VLMultiframeImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
 LensometryMeasurementsStorage                        1.2.840.10008.5.1.4.1.1.78.1
 AutorefractionMeasurementsStorage                    1.2.840.10008.5.1.4.1.1.78.2
 KeratometryMeasurementsStorage                       1.2.840.10008.5.1.4.1.1.78.3
@@ -526,6 +526,7 @@ PatientRadiationDoseSRStorage                        1.2.840.10008.5.1.4.1.1.88.
 ContentAssessmentResultsStorage                      1.2.840.10008.5.1.4.1.1.90.1
 EncapsulatedPDFStorage                               1.2.840.10008.5.1.4.1.1.104.1
 EncapsulatedCDAStorage                               1.2.840.10008.5.1.4.1.1.104.2
+EncapsulatedSTLStorage                               1.2.840.10008.5.1.4.1.1.104.3
 PositronEmissionTomographyImageStorage               1.2.840.10008.5.1.4.1.1.128
 LegacyConvertedEnhancedPETImageStorage               1.2.840.10008.5.1.4.1.1.128.1
 RETIRED_StandalonePETCurveStorage                    1.2.840.10008.5.1.4.1.1.129
@@ -663,4 +664,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBfindscu\fP(1), \fBstorescp\fP(1), \fBdump2dcm\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 1994-2017 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 1994-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index d3bcb931760f91fecc5a01c0596995db704a6b12..693e663bf66d95a60737bd7ffb7dbedd7ceeb6f7 100644 (file)
@@ -1,7 +1,7 @@
-.TH "pdf2dcm" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "pdf2dcm" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
-pdf2dcm \- Convert PDF file to DICOM
+pdf2dcm \- Encapsulate PDF file into DICOM file format
 
 .SH "SYNOPSIS"
 .PP
@@ -17,7 +17,7 @@ The \fBpdf2dcm\fP utility reads a PDF file (\fIpdffile-in\fP), converts it to a
 .PP
 .PP
 .nf
-pdffile-in   PDF input filename to be converted
+pdffile-in   PDF input filename to be encapsulated
 
 dcmfile-out  DICOM output filename
 .fi
@@ -56,21 +56,13 @@ dcmfile-out  DICOM output filename
 .SS "DICOM document options"
 .PP
 .nf
-burned-in annotation:
-
-  +an  --annotation-yes
-         PDF contains patient identifying data (default)
-
-  -an  --annotation-no
-         PDF does not contain patient identifying data
-
 document title:
 
   +t   --title  [t]itle: string (default: empty)
          document title
 
   +cn  --concept-name  [CSD] [CV] [CM]: string (default: empty)
-         document title as concept name code sequence with coding
+         coded representation of document title defined by coding
          scheme designator CSD, code value CV and code meaning CM
 
 patient data:
@@ -106,8 +98,65 @@ instance number:
   +ii  --instance-inc
          increment instance number (only with +se)
 
-  +is  --instance-set  [i]nstance number: integer
+  +is  --instance-set [i]nstance number: integer
          use instance number i
+
+burned-in annotation:
+
+  +an  --annotation-yes
+         document contains patient identifying data (default)
+
+  -an  --annotation-no
+         document does not contain patient identifying data
+.fi
+.PP
+.SS "processing options"
+.PP
+.nf
+other processing options:
+
+  -k   --key  [k]ey: gggg,eeee="str", path or dictionary name="str"
+         add further attribute
+.fi
+.PP
+.SS "output options"
+.PP
+.nf
+output file format:
+
+  +F   --write-file
+         write file format (default)
+
+  -F   --write-dataset
+         write data set without file meta information
+
+group length encoding:
+
+  +g=  --group-length-recalc
+         recalculate group lengths if present (default)
+
+  +g   --group-length-create
+         always write with group length elements
+
+  -g   --group-length-remove
+         always write without group length elements
+
+length encoding in sequences and items:
+
+  +e   --length-explicit
+         write with explicit lengths (default)
+
+  -e   --length-undefined
+         write with undefined lengths
+
+data set trailing padding (not with --write-dataset):
+
+  -p   --padding-off
+         no padding (implicit if --write-dataset)
+
+  +p   --padding-create  [f]ile-pad [i]tem-pad: integer
+         align file on multiple of f bytes
+         and items on multiple of i bytes
 .fi
 .PP
 .SH "LOGGING"
@@ -122,6 +171,31 @@ All command line tools use the following notation for parameters: square bracket
 Command line options are distinguished from parameters by a leading '+' or '-' sign, respectively\&. Usually, order and position of command line options are arbitrary (i\&.e\&. they can appear anywhere)\&. However, if options are mutually exclusive the rightmost appearance is used\&. This behavior conforms to the standard evaluation rules of common Unix shells\&.
 .PP
 In addition, one or more command files can be specified using an '@' sign as a prefix to the filename (e\&.g\&. \fI@command\&.txt\fP)\&. Such a command argument is replaced by the content of the corresponding text file (multiple whitespaces are treated as a single separator unless they appear between two quotation marks) prior to any further evaluation\&. Please note that a command file cannot contain another command file\&. This simple but effective approach allows one to summarize common combinations of options/parameters and avoids longish and confusing command lines (an example is provided in file \fI<datadir>/dumppat\&.txt\fP)\&.
+.SH "EXIT CODES"
+.PP
+The \fBpdf2dcm\fP utility uses the following exit codes when terminating\&. This enables the user to check for the reason why the application terminated\&.
+.SS "general"
+.PP
+.nf
+EXITCODE_NO_ERROR                 0
+EXITCODE_COMMANDLINE_SYNTAX_ERROR 1
+EXITCODE_MEMORY_EXHAUSTED         4
+.fi
+.PP
+.SS "input file errors"
+.PP
+.nf
+EXITCODE_CANNOT_READ_INPUT_FILE   20
+EXITCODE_NO_INPUT_FILES           21
+EXITCODE_INVALID_INPUT_FILE       22
+.fi
+.PP
+.SS "output file errors"
+.PP
+.nf
+EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40
+.fi
+.PP
 .SH "ENVIRONMENT"
 .PP
 The \fBpdf2dcm\fP utility will attempt to load DICOM data dictionaries specified in the \fIDCMDICTPATH\fP environment variable\&. By default, i\&.e\&. if the \fIDCMDICTPATH\fP environment variable is not set, the file \fI<datadir>/dicom\&.dic\fP will be loaded unless the dictionary is built into the application (default for Windows)\&.
@@ -132,4 +206,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBdcm2pdf\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2005-2014 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2005-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
diff --git a/doxygen/manpages/man1/stl2dcm.1 b/doxygen/manpages/man1/stl2dcm.1
new file mode 100644 (file)
index 0000000..d34fb67
--- /dev/null
@@ -0,0 +1,226 @@
+.TH "stl2dcm" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
+.nh
+.SH NAME
+stl2dcm \- Encapsulate STL file into DICOM file format
+
+.SH "SYNOPSIS"
+.PP
+.PP
+.nf
+stl2dcm [options] stlfile-in dcmfile-out
+.fi
+.PP
+.SH "DESCRIPTION"
+.PP
+The \fBstl2dcm\fP utility reads a STL file (\fIstlfile-in\fP), converts it to a DICOM Encapsulated STL Storage SOP instance and stores the converted data to an output file (\fIdcmfile-out\fP)\&.
+.SH "PARAMETERS"
+.PP
+.PP
+.nf
+stlfile-in   STL input filename to be encapsulated
+
+dcmfile-out  DICOM output filename
+.fi
+.PP
+.SH "OPTIONS"
+.PP
+.SS "general options"
+.PP
+.nf
+  -h   --help
+         print this help text and exit
+
+       --version
+         print version information and exit
+
+       --arguments
+         print expanded command line arguments
+
+  -q   --quiet
+         quiet mode, print no warnings and errors
+
+  -v   --verbose
+         verbose mode, print processing details
+
+  -d   --debug
+         debug mode, print debug information
+
+  -ll  --log-level  [l]evel: string constant
+         (fatal, error, warn, info, debug, trace)
+         use level l for the logger
+
+  -lc  --log-config  [f]ilename: string
+         use config file f for the logger
+.fi
+.PP
+.SS "DICOM document options"
+.PP
+.nf
+document title:
+
+  +t   --title  [t]itle: string (default: empty)
+         document title
+
+  +cn  --concept-name  [CSD] [CV] [CM]: string (default: empty)
+         coded representation of document title defined by coding
+         scheme designator CSD, code value CV and code meaning CM
+
+patient data:
+
+  +pn  --patient-name  [n]ame: string
+         patient's name in DICOM PN syntax
+
+  +pi  --patient-id  [i]d: string
+         patient identifier
+
+  +pb  --patient-birthdate  [d]ate: string (YYYYMMDD)
+         patient's birth date
+
+  +ps  --patient-sex  [s]ex: string (M, F or O)
+         patient's sex
+
+study and series:
+
+  +sg  --generate
+         generate new study and series UIDs (default)
+
+  +st  --study-from  [f]ilename: string
+         read patient/study data from DICOM file
+
+  +se  --series-from  [f]ilename: string
+         read patient/study/series data from DICOM file
+
+instance number:
+
+  +i1  --instance-one
+         use instance number 1 (default, not with +se)
+
+  +ii  --instance-inc
+         increment instance number (only with +se)
+
+  +is  --instance-set [i]nstance number: integer
+         use instance number i
+
+burned-in annotation:
+
+  +an  --annotation-yes
+         document contains patient identifying data (default)
+
+  -an  --annotation-no
+         document does not contain patient identifying data
+
+enhanced general equipment:
+
+  +mn  --manufacturer  [n]ame: string
+         manufacturer's name
+
+  +mm  --manufacturer-model  [n]ame: string
+         manufacturer's model name
+
+  +ds  --device-serial  [n]umber: string
+         device serial number
+
+  +sv  --software-versions  [v]ersions: string
+         software versions
+
+3d model measurement units:
+
+  +mu  --measurement-units  [CSD] [CV] [CM]: string
+         measurement units with coding scheme designator CSD,
+         code value CV and code meaning CM (default: UCUM, um, um)
+.fi
+.PP
+.SS "processing options"
+.PP
+.nf
+other processing options:
+
+  -k   --key  [k]ey: gggg,eeee="str", path or dictionary name="str"
+         add further attribute
+.fi
+.PP
+.SS "output options"
+.PP
+.nf
+output file format:
+
+  +F   --write-file
+         write file format (default)
+
+  -F   --write-dataset
+         write data set without file meta information
+
+group length encoding:
+
+  +g=  --group-length-recalc
+         recalculate group lengths if present (default)
+
+  +g   --group-length-create
+         always write with group length elements
+
+  -g   --group-length-remove
+         always write without group length elements
+
+length encoding in sequences and items:
+
+  +e   --length-explicit
+         write with explicit lengths (default)
+
+  -e   --length-undefined
+         write with undefined lengths
+
+data set trailing padding (not with --write-dataset):
+
+  -p   --padding-off
+         no padding (implicit if --write-dataset)
+
+  +p   --padding-create  [f]ile-pad [i]tem-pad: integer
+         align file on multiple of f bytes
+         and items on multiple of i bytes
+.fi
+.PP
+.SH "LOGGING"
+.PP
+The level of logging output of the various command line tools and underlying libraries can be specified by the user\&. By default, only errors and warnings are written to the standard error stream\&. Using option \fI--verbose\fP also informational messages like processing details are reported\&. Option \fI--debug\fP can be used to get more details on the internal activity, e\&.g\&. for debugging purposes\&. Other logging levels can be selected using option \fI--log-level\fP\&. In \fI--quiet\fP mode only fatal errors are reported\&. In such very severe error events, the application will usually terminate\&. For more details on the different logging levels, see documentation of module 'oflog'\&.
+.PP
+In case the logging output should be written to file (optionally with logfile rotation), to syslog (Unix) or the event log (Windows) option \fI--log-config\fP can be used\&. This configuration file also allows for directing only certain messages to a particular output stream and for filtering certain messages based on the module or application where they are generated\&. An example configuration file is provided in \fI<etcdir>/logger\&.cfg\fP\&.
+.SH "COMMAND LINE"
+.PP
+All command line tools use the following notation for parameters: square brackets enclose optional values (0-1), three trailing dots indicate that multiple values are allowed (1-n), a combination of both means 0 to n values\&.
+.PP
+Command line options are distinguished from parameters by a leading '+' or '-' sign, respectively\&. Usually, order and position of command line options are arbitrary (i\&.e\&. they can appear anywhere)\&. However, if options are mutually exclusive the rightmost appearance is used\&. This behavior conforms to the standard evaluation rules of common Unix shells\&.
+.PP
+In addition, one or more command files can be specified using an '@' sign as a prefix to the filename (e\&.g\&. \fI@command\&.txt\fP)\&. Such a command argument is replaced by the content of the corresponding text file (multiple whitespaces are treated as a single separator unless they appear between two quotation marks) prior to any further evaluation\&. Please note that a command file cannot contain another command file\&. This simple but effective approach allows one to summarize common combinations of options/parameters and avoids longish and confusing command lines (an example is provided in file \fI<datadir>/dumppat\&.txt\fP)\&.
+.SH "EXIT CODES"
+.PP
+The \fBstl2dcm\fP utility uses the following exit codes when terminating\&. This enables the user to check for the reason why the application terminated\&.
+.SS "general"
+.PP
+.nf
+EXITCODE_NO_ERROR                 0
+EXITCODE_COMMANDLINE_SYNTAX_ERROR 1
+EXITCODE_MEMORY_EXHAUSTED         4
+.fi
+.PP
+.SS "input file errors"
+.PP
+.nf
+EXITCODE_CANNOT_READ_INPUT_FILE   20
+EXITCODE_NO_INPUT_FILES           21
+EXITCODE_INVALID_INPUT_FILE       22
+.fi
+.PP
+.SS "output file errors"
+.PP
+.nf
+EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40
+.fi
+.PP
+.SH "ENVIRONMENT"
+.PP
+The \fBstl2dcm\fP utility will attempt to load DICOM data dictionaries specified in the \fIDCMDICTPATH\fP environment variable\&. By default, i\&.e\&. if the \fIDCMDICTPATH\fP environment variable is not set, the file \fI<datadir>/dicom\&.dic\fP will be loaded unless the dictionary is built into the application (default for Windows)\&.
+.PP
+The default behavior should be preferred and the \fIDCMDICTPATH\fP environment variable only used when alternative data dictionaries are required\&. The \fIDCMDICTPATH\fP environment variable has the same format as the Unix shell \fIPATH\fP variable in that a colon (':') separates entries\&. On Windows systems, a semicolon (';') is used as a separator\&. The data dictionary code will attempt to load each file specified in the \fIDCMDICTPATH\fP environment variable\&. It is an error if no data dictionary can be loaded\&.
+.SH "COPYRIGHT"
+.PP
+Copyright (C) 2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index 449d88e98758a32b1f93723933746a1f6db7f07e..880f41ba99610a92cb74db6c480ae54a928e565f 100644 (file)
@@ -1,4 +1,4 @@
-.TH "storescp" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "storescp" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 storescp \- DICOM storage (C-STORE) SCP
@@ -245,8 +245,29 @@ certification authority:
   +cd   --add-cert-dir  [c]ertificate directory: string
           add certificates in d to list of certificates
 
+security profile:
+
+  +px   --profile-bcp195
+          BCP 195 TLS Profile (default)
+
+  +py   --profile-bcp195-nd
+          Non-downgrading BCP 195 TLS Profile
+
+  +pb   --profile-basic
+          Basic TLS Secure Transport Connection Profile (retired)
+
+  +pa   --profile-aes
+          AES TLS Secure Transport Connection Profile (retired)
+
+  +pn   --profile-null
+          Authenticated unencrypted communication
+          (retired, was used in IHE ATNA)
+
 ciphersuite:
 
+  +cc   --list-ciphers
+          show list of supported TLS ciphersuites and exit
+
   +cs   --cipher  [c]iphersuite name: string
           add ciphersuite to list of negotiated suites
 
@@ -589,7 +610,7 @@ WideFieldOphthalmicPhotogr.3DCoordinatesImageStorage 1.2.840.10008.5.1.4.1.1.77.
 OphthalmicOpticalCoherenceTomogr.EnFaceImageStorage  1.2.840.10008.5.1.4.1.1.77.1.5.7
 OphthalmicOpticalCoh.Tomogr.BscanVolumeAnalysisStor. 1.2.840.10008.5.1.4.1.1.77.1.5.8
 VLWholeSlideMicroscopyImageStorage                   1.2.840.10008.5.1.4.1.1.77.1.6
-RETIRED_VLMultiFrameImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
+RETIRED_VLMultiframeImageStorage                     1.2.840.10008.5.1.4.1.1.77.2
 LensometryMeasurementsStorage                        1.2.840.10008.5.1.4.1.1.78.1
 AutorefractionMeasurementsStorage                    1.2.840.10008.5.1.4.1.1.78.2
 KeratometryMeasurementsStorage                       1.2.840.10008.5.1.4.1.1.78.3
@@ -740,4 +761,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBstorescu\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 1996-2017 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 1996-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index e07c3f49bbefb9cb3bd7b07db2034364080e9894..4d23777db6ec010c69319fa30cb2a8c48bfe58c3 100644 (file)
@@ -1,4 +1,4 @@
-.TH "storescu" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "storescu" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 storescu \- DICOM storage (C-STORE) SCU
@@ -187,6 +187,10 @@ proposed transmission transfer syntaxes (not with --config-file):
           propose only required presentation contexts
           (default: propose all supported)
 
+          # This will also work with storage SOP classes that are
+          # supported by DCMTK but are not in the list of SOP classes
+          # proposed by default.
+
   +C    --combine
           combine proposed transfer syntaxes
           (default: separate presentation context for each TS)
@@ -221,6 +225,9 @@ user identity negotiation:
         --saml  [f]ilename: string
           read SAML request from file f
 
+        --jwt  [f]ilename: string
+          read JWT data from file f
+
   -rsp  --pos-response
           expect positive response
 
@@ -314,14 +321,32 @@ certification authority:
   +cd   --add-cert-dir  [c]ertificate directory: string
           add certificates in d to list of certificates
 
+security profile:
+
+  +px   --profile-bcp195
+          BCP 195 TLS Profile (default)
+
+  +py   --profile-bcp195-nd
+          Non-downgrading BCP 195 TLS Profile
+
+  +pb   --profile-basic
+          Basic TLS Secure Transport Connection Profile (retired)
+
+  +pa   --profile-aes
+          AES TLS Secure Transport Connection Profile (retired)
+
+  +pn   --profile-null
+          Authenticated unencrypted communication
+          (retired, was used in IHE ATNA)
+
 ciphersuite:
 
+  +cc   --list-ciphers
+          show list of supported TLS ciphersuites and exit
+
   +cs   --cipher  [c]iphersuite name: string
           add ciphersuite to list of negotiated suites
 
-  +dp   --dhparam  [f]ilename: string
-          read DH parameters for DH/DSS ciphersuites
-
 pseudo random generator:
 
   +rs   --seed  [f]ilename: string
@@ -338,9 +363,6 @@ peer authentication:
   -rc   --require-peer-cert
           verify peer certificate, fail if absent (default)
 
-  -vc   --verify-peer-cert
-          verify peer certificate if present
-
   -ic   --ignore-peer-cert
           don't verify peer certificate
 .fi
@@ -482,4 +504,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBstorescp\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 1996-2017 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 1996-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index 9260fff3960a60249d46f8a50c58f8e567da607a..487f46553ab04b815aa61ca38b16f69c5f9f4640 100644 (file)
@@ -1,4 +1,4 @@
-.TH "termscu" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "termscu" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 termscu \- DICOM termination SCU
index b72bf48a1950d43a31c7a7b4ed31cf7e5ff2ffd2..758e430ea2dd6fb2b838b6be9613209590ceb3d2 100644 (file)
@@ -1,4 +1,4 @@
-.TH "wlmscpfs" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "wlmscpfs" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 wlmscpfs \- DICOM Basic Worklist Management SCP (based on data files)
index 6d27573561b55f97c89a27a7abae4d16ce16680e..3262ed06d9bc452f4e9cb775c2c1a8674813a290 100644 (file)
@@ -1,4 +1,4 @@
-.TH "xml2dcm" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "xml2dcm" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 xml2dcm \- Convert XML document to DICOM file or data set
index 10cf64aa44fc286b239a86dbd6d9d46b3dd404b9..b9fb4c335a0fdba9af3c7d44a2f6efbd9c1333f3 100644 (file)
@@ -1,4 +1,4 @@
-.TH "xml2dsr" 1 "Mon Feb 5 2018" "Version 3.6.3" "OFFIS DCMTK" \" -*- nroff -*-
+.TH "xml2dsr" 1 "Thu Nov 29 2018" "Version 3.6.4" "OFFIS DCMTK" \" -*- nroff -*-
 .nh
 .SH NAME
 xml2dsr \- Convert DICOM SR file and data set to XML
@@ -186,6 +186,7 @@ ColonCADSRStorage                           1.2.840.10008.5.1.4.1.1.88.69
 ImplantationPlanSRDocumentStorage           1.2.840.10008.5.1.4.1.1.88.70
 AcquisitionContextSRStorage                 1.2.840.10008.5.1.4.1.1.88.71
 SimplifiedAdultEchoSRStorage                1.2.840.10008.5.1.4.1.1.88.72
+PatientRadiationDoseSRStorage               1.2.840.10008.5.1.4.1.1.88.73
 .fi
 .PP
 .PP
@@ -245,4 +246,4 @@ The default behavior should be preferred and the \fIDCMDICTPATH\fP environment v
 \fBdsr2xml\fP(1)
 .SH "COPYRIGHT"
 .PP
-Copyright (C) 2003-2016 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
+Copyright (C) 2003-2018 by OFFIS e\&.V\&., Escherweg 2, 26121 Oldenburg, Germany\&.
index 7897e2aa5a717a03147dfd75acb85d4dc9bcb488..e454ac2d174536ba6571f256c7727ad19414c122 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(oflog)
+project(oflog)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${oflog_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include")
+include_directories("${oflog_SOURCE_DIR}/include" "${ofstd_SOURCE_DIR}/include")
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc include etc)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc include etc)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 583631922ede27951ac792aad00f1734582e9bf6..3a4063eb6fc42fa3f6bccb9658e01cdd03400ebc 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(FILES logger.cfg filelog.cfg DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/dcmtk" COMPONENT etc)
+install(FILES logger.cfg filelog.cfg DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/dcmtk" COMPONENT etc)
index b28a84ad8c84d97738a4d68f619c91378705a4b4..5078d18088669a8f8820a61e666a73fb4e78a526 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/oflog DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY dcmtk/oflog DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h")
index e5885fed113193221caf26a9e6a0b558a0249bd0..b34744134877443beceadb5f1cf52055aa21ab1a 100644 (file)
@@ -52,6 +52,8 @@ namespace log4cplus
     * <code>AllocConsole()</code> Win32 function.</dd>
     *
     * </dl>
+    *  @remark This class is only available if DCMTK is compiled on Windows
+    *  Operating Systems (defining _WIN32).
     */
     class DCMTK_LOG4CPLUS_EXPORT Win32ConsoleAppender
         : public Appender
index 59a225178f1bdb5cc22a824f159232cdcab2b0a1..af13e5eafa9d935b92e39e16db1eb5e047136484 100644 (file)
@@ -1,11 +1,11 @@
 # create library from source files
 
-IF(WIN32 AND NOT CYGWIN)
+if(WIN32 AND NOT CYGWIN)
   # clfs needs extra libraries and thus is ignored here
-  SET(OFLOG_PLATFORM_LIBRARIES winsock windebap winconap)
-ELSE(WIN32 AND NOT CYGWIN)
-  SET(OFLOG_PLATFORM_LIBRARIES unixsock)
-ENDIF(WIN32 AND NOT CYGWIN)
+  set(OFLOG_PLATFORM_LIBRARIES winsock windebap winconap)
+else()
+  set(OFLOG_PLATFORM_LIBRARIES unixsock)
+endif()
 
 DCMTK_ADD_LIBRARY(oflog oflog apndimpl appender config consap factory fileap filter globinit hierarchy hierlock layout logger logimpl logevent loglevel loglog lloguser ndc ntelogap nullap objreg patlay pointer property rootlog sleep socketap sockbuff socket strhelp syncprims syslogap threads timehelp clogger env fileinfo lockfile mdc queue snprintf tls version log4judp logmacro asyncap cygwin32 striconv strcloc strccloc ${OFLOG_PLATFORM_LIBRARIES})
 
index 3d699344f4987ff6c3de97e5b7df8d86e8b38a00..fa27a7fe6b9d19914c21557e9c996396fdca0be6 100644 (file)
@@ -961,9 +961,11 @@ oflog.o: oflog.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/oflog/tracelog.h \
  ../../ofstd/include/dcmtk/ofstd/ofconapp.h \
  ../../ofstd/include/dcmtk/ofstd/ofcmdln.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexbl.h \
  ../../ofstd/include/dcmtk/ofstd/ofconsol.h \
  ../../ofstd/include/dcmtk/ofstd/ofthread.h \
  ../../ofstd/include/dcmtk/ofstd/offile.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexit.h \
  ../include/dcmtk/oflog/configrt.h \
  ../include/dcmtk/oflog/helpers/property.h \
  ../../ofstd/include/dcmtk/ofstd/ofmap.h ../include/dcmtk/oflog/consap.h \
@@ -1188,6 +1190,24 @@ sockbuff.o: sockbuff.cc ../include/dcmtk/oflog/helpers/sockbuff.h \
  ../include/dcmtk/oflog/tchar.h ../include/dcmtk/oflog/helpers/loglog.h \
  ../include/dcmtk/oflog/streams.h \
  ../include/dcmtk/oflog/thread/syncprim.h
+socket.o: socket.cc ../include/dcmtk/oflog/helpers/loglog.h \
+ ../include/dcmtk/oflog/config.h \
+ ../../config/include/dcmtk/config/osconfig.h \
+ ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
+ ../../ofstd/include/dcmtk/ofstd/ofcast.h \
+ ../../ofstd/include/dcmtk/ofstd/ofexport.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
+ ../include/dcmtk/oflog/config/defines.h \
+ ../include/dcmtk/oflog/helpers/threadcf.h \
+ ../include/dcmtk/oflog/tstring.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstring.h \
+ ../../ofstd/include/dcmtk/ofstd/oftypes.h \
+ ../../ofstd/include/dcmtk/ofstd/ofstream.h \
+ ../include/dcmtk/oflog/tchar.h ../include/dcmtk/oflog/streams.h \
+ ../include/dcmtk/oflog/thread/syncprim.h \
+ ../include/dcmtk/oflog/internal/socket.h \
+ ../include/dcmtk/oflog/helpers/socket.h \
+ ../include/dcmtk/oflog/helpers/sockbuff.h
 socketap.o: socketap.cc ../include/dcmtk/oflog/socketap.h \
  ../include/dcmtk/oflog/config.h \
  ../../config/include/dcmtk/config/osconfig.h \
@@ -1224,24 +1244,6 @@ socketap.o: socketap.cc ../include/dcmtk/oflog/socketap.h \
  ../include/dcmtk/oflog/helpers/sleep.h \
  ../include/dcmtk/oflog/helpers/property.h \
  ../include/dcmtk/oflog/thread/syncpub.h
-socket.o: socket.cc ../include/dcmtk/oflog/helpers/loglog.h \
- ../include/dcmtk/oflog/config.h \
- ../../config/include/dcmtk/config/osconfig.h \
- ../../ofstd/include/dcmtk/ofstd/ofdefine.h \
- ../../ofstd/include/dcmtk/ofstd/ofcast.h \
- ../../ofstd/include/dcmtk/ofstd/ofexport.h \
- ../../ofstd/include/dcmtk/ofstd/ofstdinc.h \
- ../include/dcmtk/oflog/config/defines.h \
- ../include/dcmtk/oflog/helpers/threadcf.h \
- ../include/dcmtk/oflog/tstring.h \
- ../../ofstd/include/dcmtk/ofstd/ofstring.h \
- ../../ofstd/include/dcmtk/ofstd/oftypes.h \
- ../../ofstd/include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/oflog/tchar.h ../include/dcmtk/oflog/streams.h \
- ../include/dcmtk/oflog/thread/syncprim.h \
- ../include/dcmtk/oflog/internal/socket.h \
- ../include/dcmtk/oflog/helpers/socket.h \
- ../include/dcmtk/oflog/helpers/sockbuff.h
 strccloc.o: strccloc.cc ../include/dcmtk/oflog/helpers/strhelp.h \
  ../include/dcmtk/oflog/config.h \
  ../../config/include/dcmtk/config/osconfig.h \
index 828ad3d1a2ec3864bb6143cf7c332a7dd20f3944..88fd38efa69e6eba27dd7efccd84000ef4cff957 100644 (file)
@@ -45,5 +45,8 @@ get_current_win32_thread_id ()
 
 } } // namespace log4cplus { namespace cygwin {
 } // end namespace dcmtk
+#else
+
+int oflog_cygwin32_cc_dummy_to_keep_linker_from_moaning = 0;
 
 #endif // defined (__CYGWIN__)
index 013a41f31ff812034c07164aea63f10fab85abf5..1e3461590acae6585b67c7d0313b9d99451e2526 100644 (file)
 #include <errno.h>
 #endif
 
+#ifdef MAX
+#undef MAX
+#endif
+
 #define MAX(a, b) ((a) < (b) ? (b) : (a))
 
 namespace dcmtk
index 6ebc7c0075b7fe42c21ae67b308083cb4e11bb79..6d009d5dd1d4541beede022da2debb95b0c1a571 100644 (file)
@@ -347,5 +347,8 @@ NTEventLogAppender::addRegistryInfo()
 } // namespace log4cplus
 } // end namespace dcmtk
 
+#else
+
+int oflog_ntelogap_cc_dummy_to_keep_linker_from_moaning = 0;
 
 #endif // DCMTK_LOG4CPLUS_HAVE_NT_EVENT_LOG
index 32e83f6df83e9671042cc3474e104dce535748b2..bf41a2b5a6301d975c0a1aa2a9ba24a6ec4e79a1 100644 (file)
@@ -224,6 +224,10 @@ tostring(wchar_t const * src)
     return ret;
 }
 
+#else
+
+int oflog_strccloc_cc_dummy_to_keep_linker_from_moaning = 0;
+
 
 #endif // DCMTK_LOG4CPLUS_WORKING_LOCALE
 
index 70ca8bb7cdcc62fcda5e6f9fe9748b15899ab8b7..c36c0848188d918e20db7ee8193d6334ee5e247c 100644 (file)
@@ -41,7 +41,7 @@
 #include <sys/time.h>
 #endif
 
-#if defined (DCMTK_LOG4CPLUS_HAVE_SYS_TIMEB_H)
+#if defined(DCMTK_LOG4CPLUS_HAVE_SYS_TIMEB_H) && defined(DCMTK_LOG4CPLUS_HAVE_FTIME) && !defined (DCMTK_LOG4CPLUS_HAVE_CLOCK_GETTIME) && !defined(DCMTK_LOG4CPLUS_HAVE_GETTIMEOFDAY) && !defined(_WIN32)
 #include <sys/timeb.h>
 #endif
 
 #define DCMTK_LOG4CPLUS_NEED_LOCALTIME_R
 #endif
 
+#ifdef MAX
+#undef MAX
+#endif
+
 #define MAX(a, b) ((a) < (b) ? (b) : (a))
 
 
index fe4ffad0b0cd462058762637990443a845b7603b..e6269a87a50a20f0cca97c068f71398f383c3bf5 100644 (file)
 #include "dcmtk/oflog/streams.h"
 #include <sstream>
 
+#ifdef __MINGW32__
+#include <winerror.h> /* needed for NO_ERROR constant on MinGW */
+#endif
+
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
 
 
index d3ba0dd1bcc4587909aea39da1dd0630ceaf9ace..c69ea2b6533109f73b5c39f6ba6890d4ffd58bec 100644 (file)
@@ -1,10 +1,10 @@
 # declare project
-PROJECT(ofstd)
+project(ofstd)
 
 # declare include directories which hold for all subdirectories
-INCLUDE_DIRECTORIES("${ofstd_SOURCE_DIR}/include" ${LIBICONV_INCDIR})
+include_directories("${ofstd_SOURCE_DIR}/include" ${LIBICONV_INCDIR})
 
 # recurse into subdirectories
-FOREACH(SUBDIR libsrc include tests)
-  ADD_SUBDIRECTORY(${SUBDIR})
-ENDFOREACH(SUBDIR)
+foreach(SUBDIR libsrc include tests)
+  add_subdirectory(${SUBDIR})
+endforeach()
index 6ee0add846c474c4541fcd91b79daa99c68b847f..d6c2ed87b239ba7ca5dd03618adfdf598106a023 100644 (file)
@@ -15,15 +15,24 @@ The main classes are (in alphabetical order):
 \li \b OFString
 \li \b OFVector
 
-Here are some further helper classes that are of interest:
+Here are some further utilities that may be of interest:
 \li \b OFCharacterEncoding
 \li \b OFConsole
 \li \b OFConsoleApplication
 \li \b OFDate
 \li \b OFDateTime
+\li \b OFdirectory_iterator
+\li \b OFerror_code
 \li \b OFMap
+\li \b OFoptional
+\li \b OFpath
+\li \b OFshared_ptr
+\li \b #OFstatic_assert
 \li \b OFThread
 \li \b OFTime
+\li \b OFtuple
+\li \b OFunique_ptr
+\li \b OFvariant
 
 \section Testing
 
index 5b048834619e5ddbac249f469ed098f190b8d952..edd0657597a7f0295e780385dccf92299e9b4de7 100644 (file)
@@ -1,2 +1,2 @@
 # declare installation files
-INSTALL(DIRECTORY dcmtk/ofstd DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h" PATTERN "*.def")
+install(DIRECTORY dcmtk/ofstd DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dcmtk" COMPONENT include FILES_MATCHING PATTERN "*.h" PATTERN "*.def")
diff --git a/ofstd/include/dcmtk/ofstd/ofassert.h b/ofstd/include/dcmtk/ofstd/ofassert.h
new file mode 100644 (file)
index 0000000..6969a54
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  ofstd
+ *
+ *  Author:  Jan Schlamelcher
+ *
+ *  Purpose: Including run time and compile time assertion features and
+ *           implementing fallback implementations for the ones that are not
+ *           available.
+ *
+ */
+
+#ifndef OFASSERT_H
+#define OFASSERT_H
+
+#include "dcmtk/config/osconfig.h"
+
+#define INCLUDE_CASSERT
+#include "dcmtk/ofstd/ofstdinc.h"
+
+/** @file ofassert.h
+ *  Including run time and compile time assertion features and implementing
+ *  fallback implementations for the ones that are not available.
+ */
+
+#ifndef DOXYGEN
+#ifdef HAVE_STATIC_ASSERT
+#define OFstatic_assert static_assert
+#else // HAVE_STATIC_ASSERT
+template<OFBool>
+class OFstatic_assert_t;
+template<>
+struct OFstatic_assert_t<OFTrue> { OFstatic_assert_t( const char* = OFnullptr ) {} };
+#define OFstatic_assert( E, M ) OFstatic_assert_t<E>(M);
+#endif // HAVE_STATIC_ASSERT
+#else // DOXYGEN
+/** Assert a constant expression at compile time.
+ *  @param E an expression that can be evaluated as a boolean constant at
+ *    compile time.
+ *  @param M a message that will be displayed in case the expression evaluates
+ *    to OFFalse.
+ *  @details
+ *  OFstatic_assert will check the expression E at compile time, emitting a
+ *  compiler error if the expression evaluates to OFFalse.
+ *  The statement will be ignored in case E evaluates to OFTrue, i.e. there
+ *  will be no performance impact.
+ *  @remarks OFstatic_assert will simply be defined as 'static_assert' if the
+ *    feature is available and fallback to an implementation based on template
+ *    specialization otherwise. Depending on what compiler is being used, the
+ *    error emitted by the fallback implementation can become rather cryptic,
+ *    e.g. not even containing the message given as 'M'.
+ *  @note OFstatic_assert is a preprocessor macro. If static_assert is
+ *    available, it will simply be another name for that, otherwise it will be
+ *    a macro taking two arguments. This means you will have to put an
+ *    expression containing one or more commas into parentheses '(' and ')',
+ *    since the preprocessor will otherwise break the expression into more
+ *    than one argument (at each ',').
+ *  @details
+ *  <h3>Usage Example</h3>
+ *  @code
+ *  typedef OFintegral_constant<size_t,24000> available_money;
+ *  typedef OFintegral_constant<size_t,36> dependability;
+ *  typedef OFintegral_constant<OFBool,(available_money::value * dependability::value > 25000000)> can_i_have_a_pony;
+ *  OFstatic_assert( can_i_have_a_pony::value, "no, you can't have a pony" );
+ *  @endcode
+ */
+#define OFstatic_assert( E, M )
+#endif // DOXYGEN
+
+#endif // OFASSERT_H
index adb223902510d4139df47e766dce1ae9398718ac..80fa13a3447981f1f2cd412073c158757205a32a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2011-2017, OFFIS e.V.
+ *  Copyright (C) 2011-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -79,6 +79,22 @@ public:
         TransliterateIllegalSequences = 4
     };
 
+    /** determine whether the underlying implementations defines a default
+     *  encoding.
+     *  Most implementations define a default encoding, i.e. one can pass an
+     *  empty string as the toEncoding and/or fromEncoding argument(s) of
+     *  selectEncoding() to select the current locale's encoding.
+     *  However, some iconv implementations inside the C standard library do
+     *  not understand this.
+     *  @warning Using getLocaleEncoding() instead of an empty string argument
+     *    in this case typically won't work, since the implementations that
+     *    don't define a default encoding typically also don't support
+     *    determining the current locale's encoding.
+     *  @return OFTrue if a default encoding is defined and empty strings
+     *    are valid arguments to selectEncoding(), OFFalse otherwise.
+     */
+    static OFBool hasDefaultEncoding();
+
     /** get the character encoding of the currently set global locale.
      *  @remarks Calling this function might be rather exhaustive depending on
      *    employed character set conversion library.  Caching the result might
@@ -248,18 +264,25 @@ public:
      *  and from Windows-specific wide character encoding (UTF-16).
      *  For further code pages, please refer to the MSDN documentation on
      *  "Code Page Identifiers".
+     *  @remark This list of code pages is only available if DCMTK is compiled
+     *  on Windows Operating Systems (defining _WIN32)
      */
     //@{
 
     /// system default Windows ANSI code page.  See Windows function GetACP().
+    /// @remark Only available on Windows Operating Systems (defining _WIN32).
     static const unsigned int CPC_ANSI;
     /// current system OEM code page.  See Windows function GetOEMCP().
+    /// @remark Only available on Windows Operating Systems (defining _WIN32).
     static const unsigned int CPC_OEM;
     /// code page for US-ASCII (7-bit)
+    /// @remark Only available on Windows Operating Systems (defining _WIN32).
     static const unsigned int CPC_ASCII;
     /// code page for ISO 8859-1 (Latin-1)
+    /// @remark Only available on Windows Operating Systems (defining _WIN32).
     static const unsigned int CPC_Latin1;
     /// code page for UTF-8
+    /// @remark Only available on Windows Operating Systems (defining _WIN32).
     static const unsigned int CPC_UTF8;
 
     //@}
@@ -274,6 +297,8 @@ public:
      *  call to the WideCharToMultiByte() function.
      *  Since the length of the input string has to be specified explicitly,
      *  the string can contain more than one NULL character.
+     *  @remark this method is only available if DCMTK is compiled on Windows
+     *  Operating Systems (defining _WIN32)
      *  @param  fromString  input string to be converted (using the UTF-16
      *                      character encoding).  A NULL pointer is regarded
      *                      as an empty string.
@@ -301,6 +326,8 @@ public:
      *  on the other hand it only works on Windows systems.
      *  Please note that no conversion flags are specified for the internal
      *  call to the MultiByteToWideChar() function.
+     *  @remark this method is only available if DCMTK is compiled on Windows
+     *  Operating Systems (defining _WIN32)
      *  @param  fromString  input string to be converted (using character
      *                      encoding specified by 'codePage')
      *  @param  toString    reference to variable in which the pointer to the
@@ -328,6 +355,8 @@ public:
      *  call to the MultiByteToWideChar() function.
      *  Since the length of the input string has to be specified explicitly,
      *  the string can contain more than one NULL byte.
+     *  @remark this method is only available if DCMTK is compiled on Windows
+     *  Operating Systems (defining _WIN32)
      *  @param  fromString  input string to be converted (using the  character
      *                      encoding specified by 'codePage').  A NULL pointer
      *                      is regarded as an empty string.
@@ -393,6 +422,8 @@ public:
     /** create an error condition based on the return value of "getLastError()"
      *  and the given parameters.  The Windows function FormatMessage() is used
      *  to map the numerical value of the error to a textual description.
+     *  @remark this method is only available if DCMTK is compiled on Windows
+     *  Operating Systems (defining _WIN32)
      *  @param  status   reference to variable where the condition is stored
      *  @param  message  message text that is used as a prefix to the error
      *  @param  code     unique status code of the error condition
index af92ba733ae71dbc5e61a586cf1600488d2e6241..e3020bf84d26772b25effb982f5a7d9b561a57c1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2016, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -25,6 +25,7 @@
 
 #include "dcmtk/config/osconfig.h"
 #include "dcmtk/ofstd/oftypes.h"
+#include "dcmtk/ofstd/ofexbl.h"
 #include "dcmtk/ofstd/oflist.h"
 #include "dcmtk/ofstd/ofstring.h"
 #include "dcmtk/ofstd/ofconsol.h"
@@ -124,7 +125,7 @@ struct DCMTK_OFSTD_EXPORT OFCmdParam
 
 private:
 
-    /// private undefined copy assignment operator
+    /// private undefined assignment operator
     OFCmdParam& operator=(const OFCmdParam& arg);
 };
 
@@ -504,7 +505,7 @@ class DCMTK_OFSTD_EXPORT OFCommandLine
     E_ParamValueStatus getParamAndCheckMin(const int pos,
                                            OFCmdSignedInt &value,
                                            const OFCmdSignedInt low,
-                                           const OFBool incl = OFTrue);
+                                           const OFExplicitBool incl = OFTrue);
 
     /** gets value of specified parameter as signed integer and checks for given boundaries
      *
@@ -549,7 +550,7 @@ class DCMTK_OFSTD_EXPORT OFCommandLine
     E_ParamValueStatus getParamAndCheckMin(const int pos,
                                            OFCmdUnsignedInt &value,
                                            const OFCmdUnsignedInt low,
-                                           const OFBool incl = OFTrue);
+                                           const OFExplicitBool incl = OFTrue);
 
     /** gets value of specified parameter as unsigned integer and checks for given boundaries.
      *  NB: If command line argument specifies a negative value the result depends on the
@@ -592,7 +593,7 @@ class DCMTK_OFSTD_EXPORT OFCommandLine
     E_ParamValueStatus getParamAndCheckMin(const int pos,
                                            OFCmdFloat &value,
                                            const OFCmdFloat low,
-                                           const OFBool incl = OFTrue);
+                                           const OFExplicitBool incl = OFTrue);
 
     /** gets value of specified parameter as floating point and checks for given boundaries
      *
@@ -733,7 +734,7 @@ class DCMTK_OFSTD_EXPORT OFCommandLine
      */
     E_ValueStatus getValueAndCheckMin(OFCmdSignedInt &value,
                                       const OFCmdSignedInt low,
-                                      const OFBool incl = OFTrue);
+                                      const OFExplicitBool incl = OFTrue);
 
     /** returns next argument as a signed integer value and checks for given boundaries
      *
@@ -768,7 +769,7 @@ class DCMTK_OFSTD_EXPORT OFCommandLine
      */
     E_ValueStatus getValueAndCheckMin(OFCmdUnsignedInt &value,
                                       const OFCmdUnsignedInt low,
-                                      const OFBool incl = OFTrue);
+                                      const OFExplicitBool incl = OFTrue);
 
     /** returns next argument as an unsigned integer value and checks for given boundaries
      *
@@ -803,7 +804,7 @@ class DCMTK_OFSTD_EXPORT OFCommandLine
      */
     E_ValueStatus getValueAndCheckMin(OFCmdFloat &value,
                                       const OFCmdFloat low,
-                                      const OFBool incl = OFTrue);
+                                      const OFExplicitBool incl = OFTrue);
 
     /** returns next argument as a floating point value and checks for given boundaries
      *
@@ -878,6 +879,8 @@ class DCMTK_OFSTD_EXPORT OFCommandLine
      *  accessing filenames with wide character encoding (UTF-16).
      *  Additionally, create internal structures for evaluation and return status indicating any
      *  errors that occurred during the parse process.
+     *  @remarks this method is only available if OS is windows (not mingw) and
+     *  MSC6 is not used for building.
      *
      ** @param  argCount  number of command line arguments stored in argValue
      *  @param  argValue  array where the command line arguments are stored
@@ -1003,6 +1006,8 @@ class DCMTK_OFSTD_EXPORT OFCommandLine
 
     /** check whether 'argValue' points to command file and parse content if so.
      *  This is a Windows-specific version supporting wide char encoding (UTF-16).
+     *  @remarks this method is only available if OS is windows (not mingw) and
+     *  MSC6 is not used for building.
      */
     E_ParseStatus parseCommandFile(const wchar_t *argValue,
                                    const OFString &strValue,
@@ -1092,6 +1097,8 @@ class DCMTK_OFSTD_EXPORT OFCommandLine
 
  private:
 
+    /// private undefined copy constructor
+    OFCommandLine(const OFCommandLine &obj);
     /// private undefined assignment operator
     OFCommandLine &operator=(const OFCommandLine &obj);
 };
index b89ac94ffb3185f136d1ed3b5dcef7c262b261e4..6aa312b42bfd0a3a65911856a634f9baf36a2cda 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1999-2012, OFFIS e.V.
+ *  Copyright (C) 1999-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -27,7 +27,8 @@
 
 #include "dcmtk/ofstd/oftypes.h"
 #include "dcmtk/ofstd/ofcmdln.h"
-#include "dcmtk/ofstd/ofstring.h" /* for class OFString */
+#include "dcmtk/ofstd/ofexit.h"     /* for common exit codes */
+#include "dcmtk/ofstd/ofstring.h"   /* for class OFString */
 
 
 /*---------------------*
@@ -78,15 +79,17 @@ class DCMTK_OFSTD_EXPORT OFConsoleApplication
                             const int flags = 0,
                             const int startPos = 1);
 
-#ifdef DCMTK_USE_WCHAR_T
+#ifdef DCMTK_USE_WCHAR_T // see see ofcmdln.h
 
     /** parse command line.
+     *
      *  This is a Windows-specific version supporting the wide character encoding (UTF-16).
      *  If the command line has no argument (in case at least one argument is required) and
      *  if the command line has only one argument, namely "--help" or the specified shortcut,
      *  (in all cases) the usage is printed (see printUsage).
-     *
-     ** @param  cmd       reference to the OFCommandLine object.  Should be valid at least as
+     *  @remark This method is only available if DCMTK is compiled on Windows
+     *  Operating Systems with wide chars available.
+     *  @param  cmd       reference to the OFCommandLine object.  Should be valid at least as
      *                    long as this object exists.
      *  @param  argCount  number of arguments (argc)
      *  @param  argValue  pointer to argument array (argv[])
@@ -101,9 +104,10 @@ class DCMTK_OFSTD_EXPORT OFConsoleApplication
                             const int flags = 0,
                             const int startPos = 1);
 
-#endif  // HAVE_WINDOWS_H ...
+#endif  // DCMTK_USE_WCHAR_T (see ofcmdln.h)
 
     /** print header of console application (consisting of identifier, name and description)
+     *
      *
      ** @param  hostInfo  print host information as reported by 'config.guess' if OFTrue.
      *                    If compiled with 'libiconv' support, the current locale's character
@@ -138,7 +142,7 @@ class DCMTK_OFSTD_EXPORT OFConsoleApplication
      *  @param  code  error code to be returned (exit)
      */
     void printError(const char *str,
-                               const int code = 1);
+                    const int code = EXITCODE_COMMANDLINE_SYNTAX_ERROR);
 
     /** print warning message (w/o header) to standard error stream
      *
index c691d18c5c1df04a546bc0dd10ef2b8a4ea27f4d..f711392853c9b6c60cacb720159cacc2f4d4c7f4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2001-2015, OFFIS e.V.
+ *  Copyright (C) 2001-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -312,6 +312,9 @@ public:
   /* Implicit conversion from OFCondition to bool might
    * not always be a good idea since it can hide unwanted constructs.
    * Therefore, we disable this operator by default.
+   * @remark this method is only available if DCMTK is compiled with
+   * implicit conversion from OFCondition to bool being enabled (see macro
+   * OFCONDITION_IMPLICIT_BOOL_CONVERSION)
    */
 
   /** conversion operator to bool.
index 1d51db67432b4957ef2d766f925a96966323af78..03d0ab46c2c5c9ca4946a00da94418a5fea57991 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1999-2011, OFFIS e.V.
+ *  Copyright (C) 1999-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -227,7 +227,10 @@ private:
   int joined;
 
 #ifdef WITH_THREADS
-  /** mutex protecting access to cout */
+  /** mutex protecting access to cout
+   *  @remark This member is only available if DCMTK is compiled with thread
+   *  support enabled.
+   */
   OFMutex coutMutex;
 
   /** mutex protecting access to cerr */
index d7473d8a2b1d53580cda49a6f721c9824ab24fbf..6898aaa2500c8ce7e64cf6b034ee1b6774e2ffc8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, OFFIS e.V.
+ *  Copyright (C) 2017-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -86,6 +86,10 @@ public:
      */
     inline OFerror_category() {}
 
+    /** Virtual destructor, does nothing.
+     */
+    virtual ~OFerror_category() {}
+
     /** Obtains the name of the category, for example "generic".
      *  @return a character pointer that refers to the name of the category.
      */
diff --git a/ofstd/include/dcmtk/ofstd/ofexit.h b/ofstd/include/dcmtk/ofstd/ofexit.h
new file mode 100644 (file)
index 0000000..a315a25
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  ofstd
+ *
+ *  Author:  Joerg Riesmeier
+ *
+ *  Purpose: Common exit codes for command line tools
+ *
+ */
+
+
+#ifndef OFEXIT_H
+#define OFEXIT_H
+
+#include "dcmtk/config/osconfig.h"
+
+
+/* common exit codes for DCMTK command line tools
+ * (EXIT_SUCCESS and EXIT_FAILURE are standard codes
+ *  but their numerical values are not standardized)
+ */
+
+// general (0-19)
+#define EXITCODE_NO_ERROR                         0
+#define EXITCODE_COMMANDLINE_SYNTAX_ERROR         1
+#define EXITCODE_INSUFFICIENT_PRIVILEGES          2
+#define EXITCODE_SETUID_FAILED                    3
+
+// input file errors (20-39)
+#define EXITCODE_CANNOT_READ_INPUT_FILE          20
+#define EXITCODE_NO_INPUT_FILES                  21
+#define EXITCODE_INVALID_INPUT_FILE              22
+#define EXITCODE_NO_VALID_INPUT_FILES            23
+#define EXITCODE_INVALID_INPUT_DIRECTORY         25
+
+// output file errors (40-59)
+#define EXITCODE_CANNOT_WRITE_OUTPUT_FILE        40
+#define EXITCODE_INVALID_OUTPUT_DIRECTORY        45
+
+// network errors (60-79)
+// - defined in the respective modules / tools
+
+// processing errors (80-99)
+// - defined in the respective modules / tools
+
+// user-defined errors (100-119)
+// - defined in the respective modules / tools
+
+// GNU recommends that the codes 128-255 be reserved for serious errors:
+// - https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
+
+#endif
index 656ac7c9e9bdc0e59b12b3e900051be7b61fd9b2..8b366f44af3c867f2a22c9d4c88cb89a3d79fb68 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2006-2017, OFFIS e.V.
+ *  Copyright (C) 2006-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -113,6 +113,9 @@ typedef fpos_t offile_fpos_t;
 typedef int offile_errno_t;
 
 
+// forward declarations
+class OFpath;
+
 /** class for managing filenames consisting either of conventional (8-bit) or
  *  wide (e.g.\ 16-bit) characters.  The wide character support is currently
  *  Windows-specific because most other operating systems use UTF-8, which is
@@ -141,8 +144,18 @@ public:
   OFFilename(const OFString &filename,
              const OFBool convert = OFFalse);
 
+  /** construct an OFFilename from an OFpath.
+   *  @param path the OFpath object referring to a file.
+   *  Effectively OFFilename(path.native(), OFTrue), but potentially more
+   *  efficient.
+   */
+  OFFilename(const OFpath& path);
+
 #if (defined(WIDE_CHAR_FILE_IO_FUNCTIONS) || defined(WIDE_CHAR_MAIN_FUNCTION)) && defined(_WIN32)
   /** constructor expecting a wide character string
+   *  @remark This constructor is only available if DCMTK is compiled on Windows
+   *  Operating Systems with wide chars enabled (defining _WIN32 as well as
+   *  WIDE_CHAR_FILE_IO_FUNCTIONS or WIDE_CHAR_MAIN_FUNCTION).
    *  @param filename filename to be stored (e.g. 16-bit characters)
    *  @param convert  convert given filename to UTF-8 encoding as an
    *    alternative representation.  Only works on Windows systems.
@@ -203,6 +216,9 @@ public:
 
 #if (defined(WIDE_CHAR_FILE_IO_FUNCTIONS) || defined(WIDE_CHAR_MAIN_FUNCTION)) && defined(_WIN32)
   /** get stored filename consisting of wide characters
+   *  @remark This method is only available if DCMTK is compiled on Windows
+   *  Operating Systems with wide chars enabled (defining _WIN32 as well as
+   *  WIDE_CHAR_FILE_IO_FUNCTIONS or WIDE_CHAR_MAIN_FUNCTION).
    *  @return wide char filename (might be NULL if none is stored)
    */
   inline const wchar_t *getWideCharPointer() const
@@ -229,6 +245,9 @@ public:
 
 #if (defined(WIDE_CHAR_FILE_IO_FUNCTIONS) || defined(WIDE_CHAR_MAIN_FUNCTION)) && defined(_WIN32)
   /** replace currently stored filename by given value
+   *  @remark This method is only available if DCMTK is compiled on Windows
+   *  Operating Systems with wide chars enabled (defining _WIN32 as well as
+   *  WIDE_CHAR_FILE_IO_FUNCTIONS or WIDE_CHAR_MAIN_FUNCTION).
    *  @param filename filename to be stored (e.g. 16-bit characters)
    *  @param convert  convert given filename to UTF-8 encoding as an alternative
    *    representation.  Only works on Windows systems.
@@ -238,7 +257,10 @@ public:
 #endif
 
 private:
-  /// filename consisting of conventional characters (8-bit, e.g. UTF-8)
+  /// filename consisting of conventional characters (8-bit, e.g.\ UTF-8)
+  /// @remark This member is only available if DCMTK is compiled on Windows
+  /// Operating Systems with wide chars enabled (defining _WIN32 as well as
+  /// WIDE_CHAR_FILE_IO_FUNCTIONS or WIDE_CHAR_MAIN_FUNCTION).
   char *filename_;
 #if (defined(WIDE_CHAR_FILE_IO_FUNCTIONS) || defined(WIDE_CHAR_MAIN_FUNCTION)) && defined(_WIN32)
   /// filename consisting of wide characters (e.g. 16-bit on Windows)
@@ -317,8 +339,10 @@ public:
 
 #if defined(WIDE_CHAR_FILE_IO_FUNCTIONS) && defined(_WIN32)
   /** opens the file whose name is the wide character string pointed to by path and
-   *  associates a stream with it. This function is Win32 specific and only exists on
-   *  WinNT and newer.
+   *  associates a stream with it.
+   *  @remark This member is only available if DCMTK is compiled on Windows
+   *  Operating Systems with wide chars enabled (defining _WIN32 as well as
+   *  WIDE_CHAR_FILE_IO_FUNCTIONS).
    *  @param filename Unicode filename path to file
    *  @param modes "r", "w" or "a" with possible modifiers "+", "b", as a wide
    *    character string
diff --git a/ofstd/include/dcmtk/ofstd/offilsys.h b/ofstd/include/dcmtk/ofstd/offilsys.h
new file mode 100644 (file)
index 0000000..01bf4e9
--- /dev/null
@@ -0,0 +1,558 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  ofstd
+ *
+ *  Author:  Jan Schlamelcher
+ *
+ *  Purpose: Implementing the currently used subset of C++17' std::filesystem
+ *
+ */
+
+#ifndef OFFILSYS_H
+#define OFFILSYS_H
+
+#include "dcmtk/config/osconfig.h"
+
+#include "dcmtk/ofstd/ofstring.h"
+#include "dcmtk/ofstd/ofmem.h"
+#include "dcmtk/ofstd/ofutil.h"
+
+/** @file offilsys.h
+ *  Implementing the currently used subset of C++17' std::filesystem,
+ *  i.e.\ various classes, free standing functions and global definitions as
+ *  can be found in <filesystem>.
+ */
+
+// forward declarations
+class OFdirectory_entry;
+class OFdirectory_iterator;
+
+/** A class representing paths on a filesystem.
+ *  OFpath implements a subset of the functionality described as
+ *  std::filesystem::path, see http://en.cppreference.com/w/cpp/filesystem/path
+ *  for more information.
+ *  @warning One major difference of the current OFpath implementation and the
+ *    real std::filesystem::path is that std::filesystem::path native string
+ *    type is expected to be std::wstring on Windows, whereas OFpath currently
+ *    always uses OFString, since something like OFWString does currently not
+ *    exist. This will be addressed before making OFpath interchangeable with
+ *    std::filesystem::path.
+ */
+class DCMTK_OFSTD_EXPORT OFpath
+{
+public:
+    /** The path separator used in the native path syntax, i.e.\ '\' on Windows
+     *  and '/' everywhere else.
+     */
+    static const char preferred_separator = PATH_SEPARATOR;
+
+    /** Construct an empty path.
+     *  An empty path refers to the same location as the path "." on most
+     *  systems.
+     */
+    OFpath();
+
+    /** Copy construct a path.
+     *  @param rhs another OFpath object that this one will be constructed
+     *    from.
+     */
+    OFpath( const OFpath& rhs );
+
+    /** Move construct a path.
+     *  @param rhs another OFpath object that this one will be constructed
+     *    from.
+     *  @remarks The current implementation constructs an empty path and swaps
+     *    it with the one provided as rhs in constant time.
+     */
+    OFpath( OFrvalue_ref(OFpath) rhs );
+
+    /** Construct an OFpath from a const char*.
+     *  @param cstr a plain old C character string.
+     *  @warning This constructor does not exists in the real
+     *    std::filesystem::path, where various character strings (e.g. char*
+     *    and wchar_t*) are handled uniformly by one of the template
+     *    constructors.
+     *  @note Automatic path conversion (e.g. replacing all '/' with '\' on
+     *    Windows) is currently not available, which is why this constructor
+     *    lacks the second parameter "format" and instead always expects
+     *    the argument to be given in the native format.
+     */
+    OFpath( const char* const cstr );
+
+    /** Constructs an OFpath from an OFString.
+     *  @param string an OFString.
+     *  @note Automatic path conversion (e.g. replacing all '/' with '\' on
+     *    Windows) is currently not available, which is why this constructor
+     *    lacks the second parameter "format" and instead always expects
+     *    the argument to be given in the native format.
+     */
+    OFpath( const OFString& string );
+
+    /** Copy-assign another OFpath to this one.
+     *  Effectively: this->native() = rhs.native().
+     *  @param rhs another OFpath object.
+     *  @return *this
+     */
+    OFpath& operator=( const OFpath& rhs );
+
+    /** Move-assign another OFpath to this one.
+     *  @param rhs another OFpath object.
+     *  @return *this
+     *  @remarks The current implementation clears the path and then swaps it
+     *    with the one provided as rhs in constant time.
+     */
+    OFpath& operator=( OFrvalue_ref(OFpath) rhs );
+
+    /** Test whether the path is empty.
+     *  @return effectively: native().empty().
+     */
+    OFBool empty() const;
+
+    /** Test whether the path is absolute, i.e.\ refers to a certain location
+     *  unaffected by which directory is set as the current working directory.
+     *  @return OFTrue if the path is absolute, OFFalse otherwise.
+     */
+    OFBool is_absolute() const;
+
+    /** Test whether the path is relative, e.g.\ needs to be concatenated to
+     *  another path before it refers to a filesystem location.
+     *  @return effectively: !is_absolute().
+     */
+    OFBool is_relative() const;
+
+    /** Test whether the path contains a root name.
+     *  @return effectively: !root_name().empty().
+     */
+    OFBool has_root_name() const;
+
+    /** Test whether the path contains a root directory.
+     *  @return effectively: !root_directory().empty().
+     */
+    OFBool has_root_directory() const;
+
+    /** Test whether the path contains a filename.
+     *  @return effectively: !filename().empty().
+     */
+    OFBool has_filename() const;
+
+    /** Test whether the path contains a filename extension.
+     *  @return effectively: !extension().empty().
+     */
+    OFBool has_extension() const;
+
+    /** Retrieve the underlying native string.
+     *  @return a const reference to the underlying OFString.
+     */
+    const OFString& native() const;
+
+    /** Retrieve a native character pointer.
+     *  @return effectively: native().c_str().
+     */
+    const char* c_str() const;
+
+    /** Return the root name contained in the path (if any) or an empty path.
+     *  The root name is a concept used in multi root filesystems (Windows)
+     *  to identify the root (e.g. C:).
+     *  @return an OFpath containing only the root name, e.g given the path
+     *    "C:\" it will return "C:" on Windows and "" everywhere else.
+     */
+    OFrvalue<OFpath> root_name() const;
+
+    /** Return the filename contained in the path (if any) or an empty path.
+     *  The filename is the substring after the last path separator, and,
+     *  for multi root filesystems also after the root name.
+     *  @return an OFpath containing only the filename, e.g. "file" given a
+     *    "/path/to/file" or resp. "C:\path\to\file".
+     *  @note OFpath( "C:" ).filename() is "" on Windows and "C:" everywhere
+     *    else.
+     */
+    OFrvalue<OFpath> filename() const;
+
+    /** Return the filename extension contained in the path (if any) or an
+     *  empty path.
+     *  The filename extension is the part of the filename beginning at (and
+     *  containing) the last '.', e.g. ".txt" for a file named "readme.txt".
+     *  Special filenames like ".", ".." and hidden files like ".hidden" will
+     *  be handled in a special way. The names ".", ".." and ".hidden" will
+     *  give an empty string result, whereas ".hidden.txt" will give ".txt".
+     *  @return an OFpath containing only the extension part of the filename.
+     */
+    OFrvalue<OFpath> extension() const;
+
+    /** Append another path to this one, handling various special cases.
+     *  @param rhs another OFpath object to append to this one.
+     *  @return *this
+     *  @details
+     *  This operator will append another path to the existing one, always
+     *  doing the right thing. There are many special cases it accounts for,
+     *  for details see (http://en.cppreference.com/w/cpp/filesystem/path/append)
+     *  In short: you can trust it to turn "path" / "file" into "path\file"
+     *  on Windows and "path/file" everywhere else, while also ensuring
+     *  "path/" / "file" will become "path/file" and not "path//file" and many
+     *  more.
+     */
+    OFpath& operator/=( const OFpath& rhs );
+
+private:
+#ifndef DOXYGEN
+    // helper functions, common ground for the respective has_XXX() and XXX()
+    // functions.
+    size_t findRootName() const;
+    size_t findFilename() const;
+    size_t findExtension() const;
+    // the actual native string, who would have guessed
+    OFString m_NativeString;
+#endif
+};
+
+/** Append two paths.
+ *  @relates OFpath
+ *  @param lhs the left hand side path for the operation.
+ *  @param rhs the right hand side path for the operation.
+ *  @return effectively: OFpath( lhs ) / rhs.
+ */
+inline OFrvalue<OFpath> operator/( const OFpath& lhs, const OFpath& rhs )
+#ifndef DOXYGEN
+{
+    return OFpath( lhs ) /= rhs;
+}
+#else
+;
+#endif
+
+/** Print a path to an output stream.
+ *  @relates OFpath
+ *  The parameters and return value are as usual for the output stream
+ *  operator, the only thing worth mentioning is that the path will be put
+ *  into double quotes, i.e. it will print "rhs.native()".
+ *  @param out the stream.
+ *  @param rhs the path
+ *  @return out
+ */
+inline STD_NAMESPACE ostream& operator<<( STD_NAMESPACE ostream& out, const OFpath& rhs )
+#ifndef DOXYGEN
+{
+    return out << '"' << rhs.native() << '"';
+}
+#else
+;
+#endif
+
+/** Lexicographically compare two paths.
+ *  @relates OFpath
+ *  @param lhs the left hand side path for the operation.
+ *  @param rhs the right hand side path for the operation.
+ *  @return effectively: lhs.native() < rhs.native()
+ *  @note the comparison is purely lexicographic, i.e. the paths will not be
+ *    normalized in any way prior to comparing their native strings.
+ */
+inline OFBool operator<( const OFpath& lhs, const OFpath& rhs )
+#ifndef DOXYGEN
+{
+    return lhs.native() < rhs.native();
+}
+#else
+;
+#endif
+
+/** Lexicographically compare two paths.
+ *  @relates OFpath
+ *  @param lhs the left hand side path for the operation.
+ *  @param rhs the right hand side path for the operation.
+ *  @return effectively: lhs.native() > rhs.native()
+ *  @note the comparison is purely lexicographic, i.e. the paths will not be
+ *    normalized in any way prior to comparing their native strings.
+ */
+inline OFBool operator>( const OFpath& lhs, const OFpath& rhs )
+#ifndef DOXYGEN
+{
+    return lhs.native() > rhs.native();
+}
+#else
+;
+#endif
+
+/** Lexicographically compare two paths.
+ *  @relates OFpath
+ *  @param lhs the left hand side path for the operation.
+ *  @param rhs the right hand side path for the operation.
+ *  @return effectively: lhs.native() <= rhs.native()
+ *  @note the comparison is purely lexicographic, i.e. the paths will not be
+ *    normalized in any way prior to comparing their native strings.
+ */
+inline OFBool operator<=( const OFpath& lhs, const OFpath& rhs )
+#ifndef DOXYGEN
+{
+    return lhs.native() <= rhs.native();
+}
+#else
+;
+#endif
+
+/** Lexicographically compare two paths.
+ *  @relates OFpath
+ *  @param lhs the left hand side path for the operation.
+ *  @param rhs the right hand side path for the operation.
+ *  @return effectively: lhs.native() >= rhs.native()
+ *  @note the comparison is purely lexicographic, i.e. the paths will not be
+ *    normalized in any way prior to comparing their native strings.
+ */
+inline OFBool operator>=( const OFpath& lhs, const OFpath& rhs )
+#ifndef DOXYGEN
+{
+    return lhs.native() >= rhs.native();
+}
+#else
+;
+#endif
+
+/** Lexicographically compare two paths.
+ *  @relates OFpath
+ *  @param lhs the left hand side path for the operation.
+ *  @param rhs the right hand side path for the operation.
+ *  @return effectively: lhs.native() == rhs.native()
+ *  @note the comparison is purely lexicographic, i.e. the paths will not be
+ *    normalized in any way prior to comparing their native strings.
+ */
+inline OFBool operator==( const OFpath& lhs, const OFpath& rhs )
+#ifndef DOXYGEN
+{
+    return lhs.native() == rhs.native();
+}
+#else
+;
+#endif
+
+/** Lexicographically compare two paths.
+ *  @relates OFpath
+ *  @param lhs the left hand side path for the operation.
+ *  @param rhs the right hand side path for the operation.
+ *  @return effectively: lhs.native() != rhs.native()
+ *  @note the comparison is purely lexicographic, i.e. the paths will not be
+ *    normalized in any way prior to comparing their native strings.
+ */
+inline OFBool operator!=( const OFpath& lhs, const OFpath& rhs )
+#ifndef DOXYGEN
+{
+    return lhs.native() != rhs.native();
+}
+#else
+;
+#endif
+
+/** A class representing an directory entry.
+ *  OFdirectory_entry implements a subset of the functionality described as
+ *  std::filesystem::directory_entry, see
+ *  http://en.cppreference.com/w/cpp/filesystem/directory_entry for more
+ *  information.
+ *  @note currently, OFdirectory_entry only contains a single OFpath object
+ *    (no file meta information as the real std::filesystem::directory_entry
+ *    would). It is currently only a placeholder that exists because
+ *    OFdirectory_iterator is expected to refer to an directory entry instead
+ *    of directly referring to an OFpath object.
+ */
+class DCMTK_OFSTD_EXPORT OFdirectory_entry
+{
+public:
+    /** Access the OFpath object the directory entry applies to.
+     *  @return a const reference to an OFpath object.
+     */
+    const OFpath& path() const;
+
+    /** Automatically convert a directory entry to an OFpath if the context of
+     *  the evaluation allows it, e.g. for printing an OFdirectory_entry on
+     *  an output stream.
+     *  @return effectively: this->path().
+     */
+    operator const OFpath&() const;
+
+private:
+#ifndef DOXYGEN
+    // OFdirectory_iterator needs write access to the path for updating it
+    // during the iteration.
+    friend class OFdirectory_iterator;
+    OFpath m_Path;
+#endif
+};
+
+#ifndef DOXYGEN
+// This is a helper class hidden from the users.
+// It helps implementing the post increment operator of the actual directory
+// iterator, which, since it is an input iterator, cannot return a copy of
+// itself as a forward iterator would do, but instead only copies the 'value'
+// (the OFdirectory_entry part) of the enclosing iterator.
+class DCMTK_OFSTD_EXPORT OFdirectory_iterator_proxy
+{
+public:
+    inline OFdirectory_iterator_proxy(OFrvalue_ref(OFdirectory_iterator_proxy) rhs)
+    : m_Entry( OFmove( OFrvalue_access( rhs ).m_Entry ) ) {}
+    // add operators '->' and '*' to access the 'value', acting like an
+    // iterator would although this already is the actual entry object
+    inline const OFdirectory_entry* operator->() const { return &m_Entry; }
+    inline const OFdirectory_entry& operator*() const { return m_Entry; }
+
+private:
+    // only a directory iterator may create instances of this object, others
+    // shouldn't even know it exists
+    friend class OFdirectory_iterator;
+    OFdirectory_iterator_proxy(const OFdirectory_entry&);
+    OFdirectory_entry m_Entry;
+};
+#endif
+
+/** An iterator for iterating over all the files (and folders) contained in
+ *  a given filesystem location.
+ *  OFdirectory_iterator implements a subset of the functionality described as
+ *  std::filesystem::directory_iterator, see
+ *  http://en.cppreference.com/w/cpp/filesystem/directory_iterator for more
+ *  information.
+ */
+class DCMTK_OFSTD_EXPORT OFdirectory_iterator
+{
+public:
+    /** A valid OFdirectory_iterator refers to an OFdirectory_entry
+     */
+    typedef OFdirectory_entry value_type;
+
+    /** The distance between to OFdirectory_iterators would be measured
+     *  as an std::ptrdiff_t. Well, it cannot be measured since
+     *  OFdirectory_iterator is an input iterator, but some code might
+     *  depend on the type being defined, so we define it anyway.
+     */
+    typedef STD_NAMESPACE ptrdiff_t difference_type;
+
+    /** OFdirectory_iterator's '->' operator will give you a pointer to a
+     *  const OFdirectory_entry.
+     */
+    typedef const OFdirectory_entry* pointer;
+
+    /** OFdirectory_iterator's '*' operator will give you a const reference
+     *  to an OFdirectory_entry.
+     */
+    typedef const OFdirectory_entry& reference;
+
+    // TODO: we probably need a configure test for this, simply writing
+    //       STD_NAMESPACE input_iterator_tag without including anything
+    //       etc. seems prone to errors.
+    // typedef std::input_iterator_tag iterator_category;
+
+    /** Construct a past-the-end OFdirectory_iterator for being used as the
+     *  sentinel when iterating.
+     */
+    OFdirectory_iterator();
+
+    /** Construct an OFdirectory_iterator for iterating over all the files
+     *  (and folders) inside the given location (not recursively).
+     *  @param path the location to search for files in.
+     *  @note the special files "." and ".." will be skipped.
+     */
+    OFdirectory_iterator( const OFpath& path );
+
+    /** Copy construct an OFdirectory_iterator, referring to the same
+     *  directory entry as the given one.
+     *  @param rhs the iterator to copy.
+     *  @remarks OFdirectory_iterator uses an OFshared_ptr for all information
+     *    needed for iterating, copy construction is therefore efficient and
+     *    in constant time.
+     */
+    OFdirectory_iterator( const OFdirectory_iterator& rhs );
+
+    /** Assign a different OFdirectory_iterator to this one.
+     *  @param rhs another iterator that will be copied into this one.
+     *  @return *this
+     *  @remarks OFdirectory_iterator uses an OFshared_ptr for all information
+     *    needed for iterating, copy assignment is therefore efficient and
+     *    in constant time.
+     */
+    OFdirectory_iterator& operator=( const OFdirectory_iterator& rhs );
+
+    /** Destroy an OFdirectory_iterator freeing the data needed for iterating.
+     */
+    ~OFdirectory_iterator();
+
+    /** Compare an OFdirectory_iterator against another one.
+     *  This is primarily used for comparing a potentially valid iterator
+     *  against the past-the-end iterator OFdirectory_iterator() to determine
+     *  whether the iterator refers to an directory entry or not.
+     *  @param rhs another iterator to compare this one against.
+     *  @return OFTrue if both iterators refer to past-the-end, OFFalse
+     *    otherwise unless one of the given iterators was copy constructed
+     *    or copy assigned from the other one.
+     *  @note this operator explicitly does not compare the iterators
+     *    semantically (i.e. whether both refer to the same directory entry).
+     */
+    OFBool operator==( const OFdirectory_iterator& rhs ) const;
+
+    /** Compare an OFdirectory_iterator against another one.
+     *  This is primarily used for comparing a potentially valid iterator
+     *  against the past-the-end iterator OFdirectory_iterator() to determine
+     *  whether the iterator refers to an directory entry or not.
+     *  @param rhs another iterator to compare this one against.
+     *  @return effectively: !( *this == rhs )
+     *  @note this operator explicitly does not compare the iterators
+     *    semantically (i.e. whether both refer to the same directory entry).
+     */
+    OFBool operator!=( const OFdirectory_iterator& rhs ) const;
+
+    /** Increment the iterator.
+     *  Incrementing the iterator will make it refer to the next file in the
+     *  originally given location or to path-the-end in case the current one
+     *  was the last file.
+     *  @pre *this != OFdirectory_iterator()
+     *  @return *this
+     */
+    OFdirectory_iterator& operator++();
+
+#ifndef DOXYGEN
+    OFrvalue<OFdirectory_iterator_proxy> operator++(int);
+#else
+    /** Increment the iterator.
+     *  Incrementing the iterator will make it refer to the next file in the
+     *  originally given location or to path-the-end in case the current one
+     *  was the last file.
+     *  @pre *this != OFdirectory_iterator()
+     *  @return an object that, when dereferenced, refers to the directory
+     *   entry that this iterator referred to before it was incremented.
+     *  @note Since OFdirectory_iterator is an input iterator, the iterator
+     *    value from before incrementing it cannot be restored afterwards,
+     *    such that this post increment operator cannot return an
+     *    OFdirectory_iterator object as a normal post increment operator
+     *    would.
+     */
+    unspecified operator++(int);
+#endif
+
+    /** Dereference the iterator.
+     *  @pre *this != OFdirectory_iterator()
+     *  @return a pointer to the const OFdirectory_entry object this iterator
+     *    refers to.
+     */
+    pointer operator->() const;
+
+    /** Dereference the iterator.
+     *  @pre *this != OFdirectory_iterator()
+     *  @return a const reference the OFdirectory_entry object this iterator
+     *    refers to.
+     */
+    reference operator*() const;
+
+private:
+#ifndef DOXYGEN
+    // PIMPL style actual implementation
+    class NativeDirectoryEntry;
+    OFshared_ptr<NativeDirectoryEntry> m_pEntry;
+#endif
+};
+
+#endif // OFFILSYS_H
index c47d1c3971d2247c0de3a89d63ce4d446cf4fa62..ea26ab6dc9aa71d598fe55071f97367eb1fee356 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2011, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 #include "dcmtk/ofstd/ofstring.h"
 
 /** A class for automatically creating unique pseudo-random filenames.
- */  
+ */
 class DCMTK_OFSTD_EXPORT OFFilenameCreator
 {
 public:
   /// default constructor
   OFFilenameCreator();
-  
+
   /// copy constructor
   OFFilenameCreator(const OFFilenameCreator& copy);
 
@@ -66,7 +66,7 @@ private:
   unsigned long creation_time;
 
    /** appends the lower 32 bit of the given number to the given string.
-    *  Always appends exactly 8 digits (padded with leading zeroes).
+    *  Always appends exactly 8 digits (padded with leading zeros).
     *  @param l number to be appended to string
     *  @param s string to be added to
     */
index 275b6df7a9e7cb9c025816cde7d56b6f0fe35579..feb9205a6b5ca6add2ea5107e15b3dc1bed5612b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2012, OFFIS e.V.
+ *  Copyright (C) 2012-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -53,10 +53,12 @@ END_EXTERN_C
  *  OFGroup object is invalid or not with the overloaded operators
  *  "operator !" and "operator OFBool". Therefore, it behaves quite the same
  *  way as pointers in this regard.
+ *  @remark This class is only available if DCMTK detected a system offering
+ *    support for the the <grp.h> header file.
  *  @note The downside of this non-POD class is that it leads to some
  *    unnecessary string copy operations. The resulting performance penalty
  *    should be insignificant. However, implementing this class based on
- *    auto_ptr / unique_ptr or using c++11 move sematics would prevent that,
+ *    auto_ptr / unique_ptr or using c++11 move semantics would prevent that,
  *    if somebody thinks it is necessary.
  */
 class OFStandard::OFGroup
index 80a1c9520bfade1fbc2ec44d4d3685ad429e5294..f89618b1a8d3d86bd1d10c506dbe69c9c542df03 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2002-2011, OFFIS e.V.
+ *  Copyright (C) 2002-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -36,7 +36,7 @@
  *   - it is allowed to insert identical elements into the set
  *   - if a user requires to remove a certain element and if there are several elements
  *     which are identical to this element, only one element will be removed from the set
- *   - when removing an element, the indeces of the elements behind the removed element will
+ *   - when removing an element, the indices of the elements behind the removed element will
  *     be reduced by one
  *   - the set will be ordered according to the point in time at which an element is inserted
  *     into the set; a new element will always be inserted at the end of the set
@@ -204,7 +204,7 @@ template <class T> class OFOrderedSet : public OFSet<T>
           }
 
           // delete old array
-          delete this->items;
+          delete[] this->items;
 
           // assign new array to member variable
           this->items = tmp;
index 178f399372893cc0c05cd4754af8bdc521c814dd..7c56cdfc8ae3f03d3148f6a656cba1bce8647a8f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2012, OFFIS e.V.
+ *  Copyright (C) 2012-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -51,10 +51,12 @@ END_EXTERN_C
  *  OFPasswd object is invalid or not with the overloaded operators
  *  "operator !" and "operator OFBool". Therefore, it behaves quite the same
  *  way as pointers in this regard.
+ *  @remark This class is only available if DCMTK detected a system offering
+ *    support for the the <grp.h> header file.
  *  @note The downside of this non-POD class is that it leads to some
  *    unnecessary string copy operations. The resulting performance penalty
  *    should be insignificant. However, implementing this class based on
- *    auto_ptr / unique_ptr or using c++11 move sematics would prevent that,
+ *    auto_ptr / unique_ptr or using c++11 move semantics would prevent that,
  *    if somebody thinks it is necessary.
  */
 class OFStandard::OFPasswd
diff --git a/ofstd/include/dcmtk/ofstd/ofrand.h b/ofstd/include/dcmtk/ofstd/ofrand.h
new file mode 100644 (file)
index 0000000..d55a001
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  ofstd
+ *
+ *  Author:  Marco Eichelberg, based on the reference implementation
+ *   of the ISAAC PRNG by Bob Jenkins (Public Domain).
+ *
+ *  Purpose: Cryptographically secure PRNG based on Bob Jenkins's ISAAC algorithm
+ *
+ */
+
+#ifndef OFRAND_H
+#define OFRAND_H
+
+#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
+#include "dcmtk/ofstd/oftypes.h"
+
+#define OFRandom_SIZL   (8)
+#define OFRandom_SIZ    (1<<OFRandom_SIZL)
+
+class DCMTK_OFSTD_EXPORT OFRandom
+{
+public:
+
+  /** default constructor, initializes the PRNG based on time(2) and clock(2).
+   */
+  OFRandom();
+
+  /// destructor
+  virtual ~OFRandom() {}
+
+#ifndef OF_NO_UINT64
+  /** return a random Uint64 value
+   *  @return random unsigned 64-bit number
+   */
+  Uint64 getRND64();
+#endif
+
+  /** return a random Uint32 value
+   *  @return random unsigned 32-bit number
+   */
+  Uint32 getRND32();
+
+  /** return a random Uint16 value
+   *  @return random unsigned 16-bit number
+   */
+  Uint16 getRND16();
+
+  /** Re-seed the PRNG with the given parameter.
+   *  This method should only be used when a reproducible sequence of pseudo-random numbers is desired, e.g. in test routines.
+   *  @param sval seed value
+   */
+  void seed(Uint32 sval);
+
+private:
+  /** generate next round of random numbers. Calling this method will cause
+   *  the algorithm to generate a new set of random numbers in randrsl.
+   */
+  void isaac();
+
+  /** mix the seed values and then generate the first round of random numbers.
+   */
+  void mixSeed();
+
+  /// number of random bytes still available before isaac() needs to called again
+  Uint32 randcnt;
+
+  /// random memory
+  Uint32 randrsl[OFRandom_SIZ];
+
+  ///internal state of the PRNG
+  Uint32 randmem[OFRandom_SIZ];
+
+  /// internal state of the PRNG
+  Uint32 randa;
+
+  /// internal state of the PRNG
+  Uint32 randb;
+
+  /// internal state of the PRNG
+  Uint32 randc;
+};
+#endif
index 71cb24a6dfe707a562d87253702b58f225866303..6fc0432e0dacc8328ccb5f7547802862a991b7c1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2003-2010, OFFIS e.V.
+ *  Copyright (C) 2003-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -36,7 +36,7 @@
  *   - it is possible to iterate from beginning to end or from end to beginning of the underlying set
  *     using Next() or Prev() (see below)
  *   - if an element from the set is removed during the iteration, the iteration process has to be
- *     cancelled and restarted
+ *     canceled and restarted
  *   - two OFSetIterators can be compared through operators == and !=; two iterators are considered
  *     to be identical, if and only if they operate on the exact same set (identical memory addresses)
  *     and they currently refer to the same element
index 4d5118f1c19934dc00b433f164b40ea5a119c799..d27262245141120ce9f3ad83712e429622499bc3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, OFFIS e.V.
+ *  Copyright (C) 2017-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -41,6 +41,7 @@ END_EXTERN_C
 
 #ifdef HAVE_WINDOWS_H
 #include <winsock2.h>
+#include <ws2tcpip.h> /* for socklen_t */
 #endif
 
 /* forward declarations */
@@ -93,7 +94,7 @@ public:
   /** return size of sockaddr struct depending on current protocol family
    *  @return size of sockaddr struct depending on current protocol family
    */
-  size_t size() const;
+  socklen_t size() const;
 
   /** get current protocol family. Returns 0 if uninitialized, AF_INET or AF_INET6 otherwise.
    *  @return current protocol family of the socket address.
index eb0aee034505e6ba75bf554934ec2c6072700314..d65bc8c09d3e57db61f48faf97dff298fc6ceafa 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -37,6 +37,7 @@
 #define INCLUDE_CSTDLIB
 #define INCLUDE_CSTDIO
 #define INCLUDE_CSTRING
+#define INCLUDE_CSTDARG
 #define INCLUDE_UNISTD
 #include "dcmtk/ofstd/ofstdinc.h"
 
@@ -46,6 +47,13 @@ BEGIN_EXTERN_C
 #endif
 END_EXTERN_C
 
+/* Check if we are using glibc in a version where readdir() is known to be
+ * thread-safe and where readdir_r() is deprecated.
+ */
+#if defined(__GLIBC__) && (((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 24)) || (__GLIBC__ >= 3))
+#define READDIR_IS_THREADSAFE
+#endif
+
 /*------------------------*
  *  forward declarations  *
  *------------------------*/
@@ -136,6 +144,42 @@ class DCMTK_OFSTD_EXPORT OFStandard
 #endif
     }
 
+    /* Standard C99 formatted string output function.
+     * This is an implementation of the snprintf(3) function as defined in the
+     * C99 standard. Like all functions of the  printf() family, it produces
+     * output according to a format string. Output is written to the character
+     * array passed as parameter str. The function never writes more than size
+     * bytes and guarantees that the result will be NUL terminated, although
+     * it may be truncated if the buffer provided is too small.
+     * @param str string buffer to write to
+     * @param size size of string buffer, in bytes
+     * @param format printf() format string
+     * @param ... parameters to be formatted
+     * @return number of characters that have been written (if the buffer is
+     *   large enough) or the number of characters that would have been
+     *   written (if the buffer is too small), in both cases not including
+     *   the final NUL character.
+     */
+    static int snprintf(char *str, size_t size, const char *format, ...);
+
+    /* Standard C99 formatted string output function.
+     * This is an implementation of the snprintf(3) function as defined in the
+     * C99 standard. Like all functions of the  printf() family, it produces
+     * output according to a format string. Output is written to the character
+     * array passed as parameter str. The function never writes more than size
+     * bytes and guarantees that the result will be NUL terminated, although
+     * it may be truncated if the buffer provided is too small.
+     * @param str string buffer to write to
+     * @param size size of string buffer, in bytes
+     * @param format printf() format string
+     * @param ap parameters to be formatted
+     * @return number of characters that have been written (if the buffer is
+     *   large enough) or the number of characters that would have been
+     *   written (if the buffer is too small), in both cases not including
+     *   the final NUL character.
+     */
+    static int vsnprintf(char *str, size_t size, const char *format, va_list ap);
+
     /** convert a given error code to a string. This function wraps the various
      *  approaches found on different systems. Internally, the standard function
      *  strerror() or strerror_r() is used.
@@ -855,13 +899,13 @@ class DCMTK_OFSTD_EXPORT OFStandard
     static OFBool
     safeSubtract(T minuend, T subtrahend, T& difference)
     {
-      assert(!OFnumeric_limits<T>::is_signed);
-      if (minuend < subtrahend) {
-        return OFFalse;
-      } else {
-        difference = minuend - subtrahend;
-        return OFTrue;
-      }
+        assert(!OFnumeric_limits<T>::is_signed);
+        if (minuend < subtrahend) {
+            return OFFalse;
+        } else {
+            difference = minuend - subtrahend;
+            return OFTrue;
+        }
     }
 
     /** check whether addition is safe (i.e.\ no overflow occurs) and if so,
@@ -877,13 +921,34 @@ class DCMTK_OFSTD_EXPORT OFStandard
     static OFBool
     safeAdd(T a, T b, T& sum)
     {
-      assert(!OFnumeric_limits<T>::is_signed);
-      if ((OFnumeric_limits<T>::max)() - a < b) {
-        return OFFalse;
-      } else {
-        sum = a + b;
+        assert(!OFnumeric_limits<T>::is_signed);
+        if ((OFnumeric_limits<T>::max)() - a < b) {
+            return OFFalse;
+        } else {
+            sum = a + b;
+            return OFTrue;
+        }
+    }
+
+    /** check whether multiplication is safe (i.e.\ no overflow occurs) and if so,
+     *  perform it (i.e.\ compute a*b=product). Only works for unsigned types.
+     *  @param a first number to multiply
+     *  @param b second number to multiply
+     *  @param product resulting product of both numbers, if multiplication is
+     *    safe, otherwise parameter value is not touched by the function
+     *  @return OFTrue if multiplication is safe and could be performed, OFFalse
+     *    otherwise
+     */
+    template <typename T>
+    static OFBool safeMult(T a, T b, T& product)
+    {
+        assert(!OFnumeric_limits<T>::is_signed);
+        T x = a * b;
+        if (a != 0 && x / a != b) {
+            return OFFalse;
+        }
+        product = x;
         return OFTrue;
-      }
     }
 
 #ifdef DOXYGEN
@@ -972,6 +1037,18 @@ class DCMTK_OFSTD_EXPORT OFStandard
      */
     static void trimString( const char*& pBegin, const char*& pEnd );
 
+    /** An utility function that finds a substring within a string that does
+     *  not contain leading and trailing spaces and null bytes, effectively
+     *  trimming the string without unnecessary copies.
+     *  @param str a reference to a pointer to the beginning of the string.
+     *  @param size a reference to a size_t variable containing the number of
+     *    bytes in the string referenced by str.
+     *  @details
+     *  This overload is implemented using the other overload of the function
+     *  operating on two character pointers.
+     */
+    static void trimString( const char*& str, size_t& size );
+
     /** This function performs a reverse DNS lookup of a hostname.
      *  The parameters are identical to those passed to gethostbyaddr().
      *  If the lookup fails, an empty string is returned.
index 8328ee820bdf13de4c32f55d0a1c1d0ed36b1be2..7399f812311e2f0c19ed5d07ff1ee6c0165f4710 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2002-2014, OFFIS e.V.
+ *  Copyright (C) 2002-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -284,7 +284,20 @@ END_EXTERN_C
 #endif
 #endif
 
-// define INCLUDE_CSTDIO  to include <cstdio> or <stdio.h> if available
+// define INCLUDE_CINTTYPES to include <cinttypes> or <inttypes.h> if available
+#ifdef INCLUDE_CINTTYPES
+// TODO: see DCMTK issues 762, 774 and 778
+//#ifdef USE_STD_CXX_INCLUDES
+//#include <cinttypes>
+//#elif defined(HAVE_INTTYPES_H)
+#ifdef HAVE_INTTYPES_H
+BEGIN_EXTERN_C
+#include <inttypes.h>
+END_EXTERN_C
+#endif
+#endif
+
+// define INCLUDE_CSTDIO to include <cstdio> or <stdio.h> if available
 #ifdef INCLUDE_CSTDIO
 #ifdef USE_STD_CXX_INCLUDES
 #include <cstdio>
index b64c5fe3789296a8ed2f5592c070f3cc7e4a8c69..27c39d28e024c927e45b516aec025fd04b726f19 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2014, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -451,14 +451,23 @@ public:
    */
   int trywrlock();
 
-  /** unlocks the read/write lock. The read/write lock must be locked and
+  /** unlocks the read lock. The read/write lock must be locked and
    *  the calling thread must be the owner of the lock, otherwise the
    *  behaviour is undefined. One of the other threads that is waiting for
    *  the read/write lock to be freed will be unblocked, provided there are
    *  other waiting threads.
    *  @return 0 upon success, an error code otherwise.
    */
-  int unlock();
+  int rdunlock();
+
+  /** unlocks the write lock. The read/write lock must be locked and
+   *  the calling thread must be the owner of the lock, otherwise the
+   *  behaviour is undefined. One of the other threads that is waiting for
+   *  the read/write lock to be freed will be unblocked, provided there are
+   *  other waiting threads.
+   *  @return 0 upon success, an error code otherwise.
+   */
+  int wrunlock();
 
   /** converts any of the error codes returned by the methods of this class
    *  into a textual description, which is written into the string object.
@@ -529,7 +538,7 @@ public:
    */
   int trywrlock();
 
-  /** unlock the lock
+  /** unlock the read/write lock
    *  @return 0 upon success, an error code otherwise
    *  @see OFReadWriteLock::unlock
    */
@@ -542,6 +551,9 @@ private:
   /** did we successfully lock the lock? */
   OFBool locked;
 
+  /** did we acquire a write lock? */
+  OFBool isWriteLock;
+
   /** unimplemented private copy constructor */
   OFReadWriteLocker(const OFReadWriteLocker& arg);
 
index 278f3c635873bd14bb6c6a8d5b69321ed44f5d2c..60b08bd196db20bb56f6f69b8b18edf17a0a0031 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2012, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -36,7 +36,7 @@
  *  - it is allowed to insert identical elements into the set
  *  - if a user requires to remove a certain element and if there are several elements
  *    which are identical to this element, only one element will be removed from the set
- *  - after removing an element of a set, the indeces of the set's elements might have
+ *  - after removing an element of a set, the indices of the set's elements might have
  *    changed; hence, looping over all elements of a set must be restarted if an element
  *    was removed from the set within the loop
  *  - the order of the elements is arbitrary, but it will not be changed unless an element
index b5fb575c087387d39ddacdc53f03199a4dbc1164..871dfabdd54b5c0983af8542841686c1be8d67ee 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2014-2017, OFFIS e.V.
+ *  Copyright (C) 2014-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -115,7 +115,7 @@ public:
 /** A helper class to 'tag' objects as <i>rvalues</i> to help
  *  DCMTK's move emulation employed on pre C++11 compilers.
  *  @tparam T the base type an rvalue should be create of.
- *  @details OFrvalue wrapps the type T inside a zero-overhead
+ *  @details OFrvalue wraps the type T inside a zero-overhead
  *    object employing T's move constructor when possible.
  *  @note When C++11 support is available, OFrvalue<T> will
  *    simply be a type alias for <i>T</i>, since a C++11 compiler
index aeb120d798cdd7bc6ca73ecc08061157159caa05..500a4fd3a0de0276bcd5933a203efdc2b5829f9a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2011-2013, OFFIS e.V.
+ *  Copyright (C) 2011-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -27,6 +27,7 @@
 #include "dcmtk/ofstd/oftypes.h"
 #include "dcmtk/ofstd/ofstring.h"
 #include "dcmtk/ofstd/ofstream.h"
+#include "dcmtk/ofstd/ofrand.h"
 
 /** Helper class for generating and storing UUIDs, as specified in ITU-T X.667.
  *  A UUID is an Universally Unique IDentifier. If UUIDs are generated
@@ -127,7 +128,8 @@ private:
     Uint8 clock_seq_low;
     /** The node value in the form of a MAC address */
     Uint8 node[6];
-
+    /** Pseudo random number generator */
+    OFRandom rnd;
 };
 
 /** Print an UUID to a stream with OFUUID::ER_RepresentationDefault.
index 8f76b9025f73d1ca6eb289b88e1302db34bacbb0..a8bfcee48adc141acd9c171185691d75adb01fab 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2010-2017, OFFIS e.V.
+ *  Copyright (C) 2010-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -190,7 +190,7 @@ public:
      */
     size_type size() const { return size_; }
 
-    /** check wether this OFVector is empty.
+    /** check whether this OFVector is empty.
      *  @return true if this OFVector is empty.
      */
     OFBool empty() const { return size_ == 0; }
index b1d456faf7fd05f9f6c4285479bfe4abf0e360c5..65998e7b2168643e0a6e5af26e6287bd75c4d0a2 100644 (file)
@@ -769,7 +769,7 @@ public:
      * from "inByteBuf". If "formatted" parameter is true, then there will be a carriage-return every 72 chars.
      * The string will be free'd when the XMLParserBase64Tool object is deleted.
      * All returned strings are sharing the same memory space. */
-    XMLSTR encode(unsigned char *inByteBuf, unsigned int inByteLen, char formatted=0); ///< returns a pointer to an internal buffer containing the base64 string containing the binary data encoded from "inByteBuf"
+    XMLSTR encode(const unsigned char *inByteBuf, unsigned int inByteLen, char formatted=0); ///< returns a pointer to an internal buffer containing the base64 string containing the binary data encoded from "inByteBuf"
 
     /// returns the number of bytes which will be decoded from "inString".
     static unsigned int decodeSize(XMLCSTR inString, XMLError *xe=NULL);
index c8a11c229c6a9cdc94c9acc6e4bd9d41f952958b..09b2fb72d57c9c1caa94323e57cb2e48164aca72 100644 (file)
@@ -3,9 +3,9 @@
 ** It was generated automatically by:
 **
 **   User: jan
-**   Host: NBOFFIS99
-**   Date: 2016-07-19 19:01:07
-**   Prog: /home/jan/Desktop/homes/scripts/make_variadic.sh
+**   Host: myhostname
+**   Date: 2018-10-26 09:12:12
+**   Prog: /home/jan/make_variadic.sh
 **
 ** Purpose:
 **   Defining some helper template metafunctions for emulating variadic
@@ -54,7 +54,7 @@ struct OFvariadic_find_type_t<Index,T0,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12
 
 template<size_t Index,typename T>
 struct OFvariadic_find_type_t<Index,T>
-: OFintegral_constant<size_t,-1> {};
+: OFintegral_constant<size_t,~OFstatic_cast(size_t,0)> {};
 
 template<typename T,typename T0=OFvariadic_nil,typename T1=OFvariadic_nil,typename T2=OFvariadic_nil,typename T3=OFvariadic_nil,typename T4=OFvariadic_nil,typename T5=OFvariadic_nil,typename T6=OFvariadic_nil,typename T7=OFvariadic_nil,typename T8=OFvariadic_nil,typename T9=OFvariadic_nil,typename T10=OFvariadic_nil,typename T11=OFvariadic_nil,typename T12=OFvariadic_nil,typename T13=OFvariadic_nil,typename T14=OFvariadic_nil,typename T15=OFvariadic_nil,typename T16=OFvariadic_nil,typename T17=OFvariadic_nil,typename T18=OFvariadic_nil,typename T19=OFvariadic_nil,typename T20=OFvariadic_nil,typename T21=OFvariadic_nil,typename T22=OFvariadic_nil,typename T23=OFvariadic_nil,typename T24=OFvariadic_nil,typename T25=OFvariadic_nil,typename T26=OFvariadic_nil,typename T27=OFvariadic_nil,typename T28=OFvariadic_nil,typename T29=OFvariadic_nil,typename T30=OFvariadic_nil,typename T31=OFvariadic_nil,typename T32=OFvariadic_nil,typename T33=OFvariadic_nil,typename T34=OFvariadic_nil,typename T35=OFvariadic_nil,typename T36=OFvariadic_nil,typename T37=OFvariadic_nil,typename T38=OFvariadic_nil,typename T39=OFvariadic_nil,typename T40=OFvariadic_nil,typename T41=OFvariadic_nil,typename T42=OFvariadic_nil,typename T43=OFvariadic_nil,typename T44=OFvariadic_nil,typename T45=OFvariadic_nil,typename T46=OFvariadic_nil,typename T47=OFvariadic_nil,typename T48=OFvariadic_nil,typename T49=OFvariadic_nil>
 struct OFvariadic_find_type
index b66419ef832b2b8b0c59a20cfd870f58079ed29a..384f5f3dbfc1e90315cfdaae75dc2bcdd4cc804a 100644 (file)
@@ -1,4 +1,4 @@
 # create library from source files
-DCMTK_ADD_LIBRARY(ofstd ofchrenc ofcmdln ofconapp ofcond ofconfig ofconsol ofcrc32 ofdate ofdatime oferror offile offname oflist ofstd ofstring ofthread oftime oftimer oftempf ofxml ofuuid ofmath ofsockad)
+DCMTK_ADD_LIBRARY(ofstd ofchrenc ofcmdln ofconapp ofcond ofconfig ofconsol ofcrc32 ofdate ofdatime oferror offile offilsys offname oflist ofstd ofstring ofthread oftime oftimer oftempf ofxml ofuuid ofmath ofsockad ofrand)
 
 DCMTK_TARGET_LINK_LIBRARIES(ofstd ${CHARSET_CONVERSION_LIBS} ${SOCKET_LIBS} ${THREAD_LIBS} ${WIN32_STD_LIBRARIES})
index 233a671f94136a673352e7ff57f385a0c78c16ad..660d3510768f10e42bdc25705aea7f0fbee644aa 100644 (file)
@@ -18,11 +18,12 @@ ofcmdln.o: ofcmdln.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oftypes.h \
  ../include/dcmtk/ofstd/ofdefine.h ../include/dcmtk/ofstd/ofcast.h \
  ../include/dcmtk/ofstd/ofexport.h ../include/dcmtk/ofstd/ofstdinc.h \
- ../include/dcmtk/ofstd/ofstream.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofstream.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofchrenc.h \
  ../include/dcmtk/ofstd/ofmem.h ../include/dcmtk/ofstd/ofutil.h \
@@ -32,14 +33,15 @@ ofconapp.o: ofconapp.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofdefine.h ../include/dcmtk/ofstd/ofcast.h \
  ../include/dcmtk/ofstd/ofexport.h ../include/dcmtk/ofstd/ofstdinc.h \
  ../include/dcmtk/ofstd/ofstream.h ../include/dcmtk/ofstd/ofcmdln.h \
+ ../include/dcmtk/ofstd/ofexbl.h ../include/dcmtk/ofstd/oftraits.h \
  ../include/dcmtk/ofstd/oflist.h ../include/dcmtk/ofstd/ofstring.h \
  ../include/dcmtk/ofstd/ofconsol.h ../include/dcmtk/ofstd/ofthread.h \
  ../include/dcmtk/ofstd/offile.h ../include/dcmtk/ofstd/ofstd.h \
- ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/ofcond.h \
- ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofchrenc.h \
- ../include/dcmtk/ofstd/ofmem.h ../include/dcmtk/ofstd/ofutil.h \
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/ofchrenc.h ../include/dcmtk/ofstd/ofmem.h \
+ ../include/dcmtk/ofstd/ofutil.h \
  ../include/dcmtk/ofstd/variadic/tuplefwd.h
 ofcond.o: ofcond.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oftypes.h \
@@ -94,7 +96,17 @@ offile.o: offile.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/ofcond.h \
  ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/offilsys.h \
+ ../include/dcmtk/ofstd/ofmem.h ../include/dcmtk/ofstd/ofutil.h \
+ ../include/dcmtk/ofstd/variadic/tuplefwd.h
+offilsys.o: offilsys.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/offilsys.h \
+ ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/oftypes.h \
+ ../include/dcmtk/ofstd/ofdefine.h ../include/dcmtk/ofstd/ofcast.h \
+ ../include/dcmtk/ofstd/ofexport.h ../include/dcmtk/ofstd/ofstream.h \
+ ../include/dcmtk/ofstd/ofmem.h ../include/dcmtk/ofstd/ofutil.h \
+ ../include/dcmtk/ofstd/oftraits.h \
+ ../include/dcmtk/ofstd/variadic/tuplefwd.h
 offname.o: offname.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/offname.h ../include/dcmtk/ofstd/oftypes.h \
  ../include/dcmtk/ofstd/ofdefine.h ../include/dcmtk/ofstd/ofcast.h \
@@ -116,6 +128,16 @@ ofmath.o: ofmath.cc ../../config/math.cc \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofmath.h ../include/dcmtk/ofstd/oftraits.h
+ofrand.o: ofrand.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/ofstd/ofrand.h ../include/dcmtk/ofstd/oftypes.h \
+ ../include/dcmtk/ofstd/ofdefine.h ../include/dcmtk/ofstd/ofcast.h \
+ ../include/dcmtk/ofstd/ofexport.h ../include/dcmtk/ofstd/ofstdinc.h \
+ ../include/dcmtk/ofstd/ofstream.h ../include/dcmtk/ofstd/ofstd.h \
+ ../include/dcmtk/ofstd/oflist.h ../include/dcmtk/ofstd/ofstring.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../include/dcmtk/ofstd/oferror.h
 ofsockad.o: ofsockad.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofsockad.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
@@ -143,7 +165,12 @@ ofstring.o: ofstring.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/oftypes.h \
  ../include/dcmtk/ofstd/ofdefine.h ../include/dcmtk/ofstd/ofcast.h \
  ../include/dcmtk/ofstd/ofexport.h ../include/dcmtk/ofstd/ofstdinc.h \
- ../include/dcmtk/ofstd/ofstream.h ../include/dcmtk/ofstd/ofbmanip.h
+ ../include/dcmtk/ofstd/ofstream.h ../include/dcmtk/ofstd/ofbmanip.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../include/dcmtk/ofstd/oferror.h
 oftempf.o: oftempf.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftempf.h ../include/dcmtk/ofstd/ofcond.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
@@ -183,9 +210,10 @@ ofuuid.o: ofuuid.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofdefine.h ../include/dcmtk/ofstd/ofcast.h \
  ../include/dcmtk/ofstd/ofexport.h ../include/dcmtk/ofstd/ofstdinc.h \
  ../include/dcmtk/ofstd/ofstream.h ../include/dcmtk/ofstd/ofstring.h \
- ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/ofstd.h \
- ../include/dcmtk/ofstd/oflist.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofrand.h ../include/dcmtk/ofstd/ofthread.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../include/dcmtk/ofstd/oferror.h
 ofxml.o: ofxml.cc ../../config/include/dcmtk/config/osconfig.h \
index 71e538630b1060a6d813bbac5cd16d9cd4a165a5..97c2c3c95bf45307c5e01ac4716f3092e3f441f1 100644 (file)
@@ -17,8 +17,8 @@ LOCALDEFS =
 
 objs = oflist.o ofstring.o ofcmdln.o ofconapp.o offname.o ofconsol.o ofthread.o \
        ofcond.o ofstd.o ofcrc32.o ofdate.o oftime.o ofdatime.o oftimer.o \
-       ofconfig.o ofchrenc.o oftempf.o ofxml.o ofuuid.o offile.o ofmath.o \
-       oferror.o ofsockad.o
+       ofconfig.o ofchrenc.o oftempf.o ofxml.o ofuuid.o offile.o offilsys.o \
+       ofmath.o oferror.o ofsockad.o ofrand.o
 
 library = libofstd.$(LIBEXT)
 
index 5fa0d71fdab46f6525487b79f8339fd2e8cb833c..d93ef753c92754c59a63130db18548f5b2af4bdb 100644 (file)
@@ -360,20 +360,15 @@ class OFCharacterEncoding::Implementation
             || flags == TransliterateIllegalSequences
             || flags == (DiscardIllegalSequences | TransliterateIllegalSequences)
         ;
-#else
-        // the iconvctl function is implemented only in GNU libiconv and not in other
-        // iconv implementations. The iconv implementation in the C standard library
-        // therefore does not support different encoding flags.
-#ifdef __FreeBSD__
-        // FreeBSD has a custom mode where illegal sequences are replaced by '?', so
-        // none of the normal modes are supported.
-        return OFFalse;
-#else
-        // All other implementations seem to return an error when encountering
-        // illegal sequences by default, so 'abort' is the only supported mode.
-        return flags == AbortTranscodingOnIllegalSequence;
-#endif
+#elif defined DCMTK_FIXED_ICONV_CONVERSION_FLAGS
+        // the iconvctl function is implemented only in newer versions of the
+        // GNU libiconv and not in other iconv implementations. For instance,
+        // the iconv implementation in the C standard library does not support
+        // different encoding flags and only has a (varying) fixed functionality
+        // that we detect with a configuration test.
+        return flags == DCMTK_FIXED_ICONV_CONVERSION_FLAGS;
 #endif
+        return OFFalse;
     }
 
     unsigned getConversionFlags() const
@@ -391,15 +386,17 @@ class OFCharacterEncoding::Implementation
             result |= DiscardIllegalSequences;
         if (result)
             return result;
-#endif
-#ifdef __FreeBSD__
-        // FreeBSD has a custom mode where illegal sequences are replaced by '?',
-        // which is none of the normal modes and can only be described as
-        // 'unknown' = 0
-        return 0;
-#else
+        // no flags set, so return libiconv default (=abort)
         return AbortTranscodingOnIllegalSequence;
+#elif defined DCMTK_FIXED_ICONV_CONVERSION_FLAGS
+        // the iconvctl function is implemented only in newer versions of the
+        // GNU libiconv and not in other iconv implementations. For instance,
+        // the iconv implementation in the C standard library does not support
+        // different encoding flags and only has a (varying) fixed functionality
+        // that we detect with a configuration test.
+        return DCMTK_FIXED_ICONV_CONVERSION_FLAGS;
 #endif
+        return 0;
     }
 
     OFBool setConversionFlags(const unsigned flags)
@@ -438,18 +435,15 @@ class OFCharacterEncoding::Implementation
             default:
                 return OFFalse;
         }
-#else
-        // the iconvctl function is implemented only in GNU libiconv and not in other
-        // iconv implementations. The iconv implementation in the C standard library
-        // therefore does not support different encoding flags.
-#ifdef __FreeBSD__
-        // FreeBSD has a custom mode where illegal sequences are replaced by '?', so
-        // none of the normal modes are supported.
-        return OFFalse;
-#else
-        return flags == AbortTranscodingOnIllegalSequence;
-#endif
+#elif defined DCMTK_FIXED_ICONV_CONVERSION_FLAGS
+        // the iconvctl function is implemented only in newer versions of the
+        // GNU libiconv and not in other iconv implementations. For instance,
+        // the iconv implementation in the C standard library does not support
+        // different encoding flags and only has a (varying) fixed functionality
+        // that we detect with a configuration test.
+        return flags == DCMTK_FIXED_ICONV_CONVERSION_FLAGS;
 #endif
+        return OFFalse;
     }
 
 
@@ -574,6 +568,19 @@ size_t OFCharacterEncoding::countCharactersInUTF8String(const OFString &utf8Stri
     return count;
 }
 
+OFBool OFCharacterEncoding::hasDefaultEncoding()
+{
+#if defined(DCMTK_ENABLE_CHARSET_CONVERSION) &&\
+    (\
+        DCMTK_ENABLE_CHARSET_CONVERSION != DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV\
+     || DCMTK_STDLIBC_ICONV_HAS_DEFAULT_ENCODING\
+    )
+    return OFTrue;
+#else
+    return OFFalse;
+#endif
+}
+
 OFString OFCharacterEncoding::getLocaleEncoding()
 {
 #ifdef DCMTK_ENABLE_CHARSET_CONVERSION
index c1b650f36791768de894a8ec99c960bfc255f6ab..0838b78e7bcf965e786c2d3a286350fa77dff021 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1998-2016, OFFIS e.V.
+ *  Copyright (C) 1998-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -512,7 +512,7 @@ OFCommandLine::E_ParamValueStatus OFCommandLine::getParam(const int pos,
 OFCommandLine::E_ParamValueStatus OFCommandLine::getParamAndCheckMin(const int pos,
                                                                      OFCmdSignedInt &value,
                                                                      const OFCmdSignedInt low,
-                                                                     const OFBool incl)
+                                                                     const OFExplicitBool incl)
 {
     E_ParamValueStatus status = getParam(pos, value);
     if (status == PVS_Normal)
@@ -557,7 +557,7 @@ OFCommandLine::E_ParamValueStatus OFCommandLine::getParam(const int pos,
 OFCommandLine::E_ParamValueStatus OFCommandLine::getParamAndCheckMin(const int pos,
                                                                      OFCmdUnsignedInt &value,
                                                                      const OFCmdUnsignedInt low,
-                                                                     const OFBool incl)
+                                                                     const OFExplicitBool incl)
 {
     E_ParamValueStatus status = getParam(pos, value);
     if (status == PVS_Normal)
@@ -603,7 +603,7 @@ OFCommandLine::E_ParamValueStatus OFCommandLine::getParam(const int pos,
 OFCommandLine::E_ParamValueStatus OFCommandLine::getParamAndCheckMin(const int pos,
                                                                      OFCmdFloat &value,
                                                                      const OFCmdFloat low,
-                                                                     const OFBool incl)
+                                                                     const OFExplicitBool incl)
 {
     E_ParamValueStatus status = getParam(pos, value);
     if (status == PVS_Normal)
@@ -827,7 +827,7 @@ OFCommandLine::E_ValueStatus OFCommandLine::getValue(OFCmdSignedInt &value)
 
 OFCommandLine::E_ValueStatus OFCommandLine::getValueAndCheckMin(OFCmdSignedInt &value,
                                                                 const OFCmdSignedInt low,
-                                                                const OFBool incl)
+                                                                const OFExplicitBool incl)
 {
     E_ValueStatus status = getValue(value);
     if (status == VS_Normal)
@@ -876,7 +876,7 @@ OFCommandLine::E_ValueStatus OFCommandLine::getValue(OFCmdUnsignedInt &value)
 
 OFCommandLine::E_ValueStatus OFCommandLine::getValueAndCheckMin(OFCmdUnsignedInt &value,
                                                                 const OFCmdUnsignedInt low,
-                                                                const OFBool incl)
+                                                                const OFExplicitBool incl)
 {
     E_ValueStatus status = getValue(value);
     if (status == VS_Normal)
@@ -919,7 +919,7 @@ OFCommandLine::E_ValueStatus OFCommandLine::getValue(OFCmdFloat &value)
 
 OFCommandLine::E_ValueStatus OFCommandLine::getValueAndCheckMin(OFCmdFloat &value,
                                                                 const OFCmdFloat low,
-                                                                const OFBool incl)
+                                                                const OFExplicitBool incl)
 {
     E_ValueStatus status = getValue(value);
     if (status == VS_Normal)
index 18ed53c1ab8760032148b90f2df6ccd0ddda8c42..360ca9b0e8f007b37b8c769b686d583578248028 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1999-2013, OFFIS e.V.
+ *  Copyright (C) 1999-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -202,7 +202,7 @@ void OFConsoleApplication::printUsage(const OFCommandLine *cmd)
     output << OFendl;
     ofConsole.unlockCout();
     /* exit code: no error */
-    exit(0);
+    exit(EXITCODE_NO_ERROR);
 }
 
 
index 8c9add867de90a379f04a9919e47bf64e7098a82..3a8d4f44cc582f69521701770e771d9d96f41b73 100644 (file)
@@ -202,4 +202,8 @@ struct InitErrorCategories
 
 InitErrorCategories InitErrorCategories::Init;
 
+#else
+
+int ofstd_oferror_cc_dummy_to_keep_linker_from_moaning = 0;
+
 #endif // !HAVE_STL_SYSTEM_ERROR OR !HAVE_STL_STRING
index a65b4510e8360fe7f955b64d8214bd534552d560..fb34332f14e43678571d5c958b29c08bdcea3a86 100644 (file)
@@ -24,6 +24,7 @@
 #include "dcmtk/config/osconfig.h"
 
 #include "dcmtk/ofstd/offile.h"
+#include "dcmtk/ofstd/offilsys.h"
 
 #ifdef HAVE_WINDOWS_H
 #include "dcmtk/ofstd/ofchrenc.h"   /* for class OFCharacterEncoding */
@@ -60,6 +61,14 @@ OFFilename::OFFilename(const OFString &filename,
     set(filename, convert);
 }
 
+OFFilename::OFFilename(const OFpath &path)
+  : filename_(NULL)
+#if (defined(WIDE_CHAR_FILE_IO_FUNCTIONS) || defined(WIDE_CHAR_MAIN_FUNCTION)) && defined(_WIN32)
+  , wfilename_(NULL)
+#endif
+{
+    set(path.native(), OFTrue);
+}
 
 #if (defined(WIDE_CHAR_FILE_IO_FUNCTIONS) || defined(WIDE_CHAR_MAIN_FUNCTION)) && defined(_WIN32)
 OFFilename::OFFilename(const wchar_t *filename,
diff --git a/ofstd/libsrc/offilsys.cc b/ofstd/libsrc/offilsys.cc
new file mode 100755 (executable)
index 0000000..e2e6235
--- /dev/null
@@ -0,0 +1,533 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  ofstd
+ *
+ *  Author:  Jan Schlamelcher
+ *
+ *  Purpose: Implementing the currently used subset of C++17' std::filesystem
+ *
+ */
+
+#include "dcmtk/config/osconfig.h"
+
+#define INCLUDE_CLIMITS
+#define INCLUDE_CASSERT
+#include "dcmtk/ofstd/ofstdinc.h"
+#include "dcmtk/ofstd/offilsys.h"
+
+#ifdef _WIN32
+#include <io.h>
+#else // _WIN32
+BEGIN_EXTERN_C
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_FILE_H
+#include <sys/file.h>  // for struct DIR, opendir()
+#endif
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>    // for struct DIR, opendir()
+#endif
+END_EXTERN_C
+/* Check if we are using glibc in a version where readdir() is known to be
+ * thread-safe and where readdir_r() is deprecated.
+ */
+#if defined(__GLIBC__) && (((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 24)) || (__GLIBC__ >= 3))
+#define READDIR_IS_THREADSAFE
+#endif
+#endif // _WIN32
+
+OFpath::OFpath()
+: m_NativeString()
+{
+
+}
+
+OFpath::OFpath( const OFpath& rhs )
+: m_NativeString( rhs.native() )
+{
+
+}
+
+OFpath::OFpath( OFrvalue_ref(OFpath) rhs )
+: m_NativeString()
+{
+    m_NativeString.swap( OFrvalue_access( rhs ).m_NativeString );
+}
+
+OFpath::OFpath( const char* const cstr )
+: m_NativeString( cstr )
+{
+
+}
+
+OFpath::OFpath( const OFString& string )
+: m_NativeString( string )
+{
+
+}
+
+OFpath& OFpath::operator=( const OFpath& rhs )
+{
+    m_NativeString = rhs.native();
+    return *this;
+}
+
+OFpath& OFpath::operator=( OFrvalue_ref(OFpath) rhs )
+{
+    if( this != &OFrvalue_access( rhs ) )
+    {
+        m_NativeString.clear();
+        m_NativeString.swap( OFrvalue_access( rhs ).m_NativeString );
+    }
+    return *this;
+}
+
+OFBool OFpath::empty() const
+{
+    return m_NativeString.empty();
+}
+
+OFBool OFpath::is_absolute() const
+{
+#if _WIN32
+    const std::size_t pos = findRootName();
+    return OFString_npos != pos &&
+    (
+        ( pos + 1 ) == m_NativeString.size() ||
+        preferred_separator == m_NativeString[pos+1]
+    );
+#else
+    return has_root_directory();
+#endif
+}
+
+OFBool OFpath::is_relative() const
+{
+    return !is_absolute();
+}
+
+OFBool OFpath::has_root_name() const
+{
+    return OFString_npos != findRootName();
+}
+
+OFBool OFpath::has_root_directory() const
+{
+#if _WIN32
+    size_t pos = findRootName();
+    pos = ( OFString_npos != pos ? pos + 1 : 0 );
+    return pos < m_NativeString.size() && preferred_separator == m_NativeString[pos];
+#else
+    return !empty() && preferred_separator == *m_NativeString.begin();
+#endif
+}
+
+OFBool OFpath::has_filename() const
+{
+#if _WIN32
+    OFString::const_iterator it = m_NativeString.end();
+    if( it == m_NativeString.begin() )
+        return OFFalse;
+    --it;
+    if( *it == preferred_separator )
+        return OFFalse;
+    if( *it != ':' )
+        return OFTrue;
+    while( it != m_NativeString.begin() )
+        if( *--it == preferred_separator )
+            return OFTrue;
+    return OFFalse;
+#else
+    return !empty() && preferred_separator != *(m_NativeString.end() - 1);
+#endif
+}
+
+
+OFBool OFpath::has_extension() const
+{
+    return OFString_npos != findExtension();
+}
+
+const OFString& OFpath::native() const
+{
+    return m_NativeString;
+}
+
+const char* OFpath::c_str() const
+{
+    return m_NativeString.c_str();
+}
+
+OFrvalue<OFpath> OFpath::root_name() const
+{
+#if _WIN32
+    const size_t pos = findRootName();
+    if( OFString_npos != pos )
+        return OFpath( m_NativeString.substr( 0, pos + 1 ) );
+#endif
+    return OFpath();
+}
+
+OFrvalue<OFpath> OFpath::filename() const
+{
+    const size_t pos = findFilename();
+    if( OFString_npos != pos )
+        return OFpath( m_NativeString.substr( pos ) );
+    return OFpath();
+}
+
+OFrvalue<OFpath> OFpath::extension() const
+{
+    const size_t pos = findExtension();
+    if( OFString_npos != pos )
+        return OFpath( m_NativeString.substr( pos ) );
+    return OFpath();
+}
+
+OFpath& OFpath::operator/=( const OFpath& rhs )
+{
+    // self append
+    if( this == &rhs )
+        return *this /= OFpath( rhs );
+#if _WIN32
+    // Comments are the descriptions from en.cppreference.com, put to whatever code segment handles it:
+    // If p.is_absolute() || (p.has_root_name() && p.root_name() != root_name()),
+    // then replaces the current path with p as if by operator=(p) and finishes.
+    std::size_t pos = rhs.findRootName();
+    if( OFString_npos != pos ) // .. p.has_root_name()
+    {
+        ++pos;
+        if
+        (
+            // .. p.is_absolute()
+            ( pos < rhs.m_NativeString.size() && rhs.m_NativeString[pos] == preferred_separator ) ||
+            // .. p.root_name() != root_name()
+            ( pos > m_NativeString.size() || 0 != m_NativeString.compare( 0, pos - 1, rhs.m_NativeString, 0, pos - 1 ) )
+        )
+        {
+            // then replaces the current path with p as if by operator=(p) and finishes.
+            m_NativeString = rhs.m_NativeString;
+            return *this;
+        }
+    }
+    else pos = 0;
+    // Otherwise, if p.has_root_directory(), then removes any root directory and the
+    // entire relative path from the generic format pathname of *this, then appends the native format
+    // pathname of p, omitting any root-name from its generic format, to the native format of *this.
+    if( pos < rhs.m_NativeString.size() && rhs.m_NativeString[pos] == '\\' ) // .. p.has_root_directory()
+    {
+        // we shall remove ONLY the root directory and relative path, not the root name
+        // so find it and, if it exists, keep it
+        const size_t root = findRootName();
+        if( OFString_npos == root )
+        {
+            // no root name, so replace the entire string
+            m_NativeString = rhs.m_NativeString;
+        }
+        else
+        {
+            // removes any root directory and the entire relative path from the generic format pathname of *this
+            // appends the native format pathname of p, omitting any root-name from its generic format
+            m_NativeString.replace( root + 1, OFString_npos, rhs.m_NativeString, pos, OFString_npos );
+        }
+    }
+    else
+    {
+        // If has_filename() || (!has_root_directory() && is_absolute())
+        if( !empty() && preferred_separator != *(m_NativeString.end() - 1) )
+        {
+            // then appends path::preferred_separator to the generic format of *this
+            m_NativeString.reserve( m_NativeString.size() + rhs.m_NativeString.size() - pos + 1 );
+            m_NativeString += preferred_separator;
+        }
+        // appends the native format pathname of p, omitting any root-name from its generic format
+        m_NativeString += rhs.m_NativeString.substr( pos );
+    }
+#else
+    // version for filesystems without root names, pretty straight forward
+    if( !rhs.is_absolute() )
+    {
+        if( has_filename() )
+        {
+            m_NativeString.reserve( m_NativeString.size() + rhs.m_NativeString.size() + 1 );
+            m_NativeString += preferred_separator;
+        }
+        m_NativeString += rhs.m_NativeString;
+    }
+    else m_NativeString = rhs.m_NativeString;
+#endif
+    return *this;
+}
+
+size_t OFpath::findRootName() const
+{
+#if _WIN32
+    const size_t pos = m_NativeString.find_first_of( ":\\" );
+    if( OFString_npos != pos && m_NativeString[pos] == ':' )
+        return pos;
+#endif
+    return OFString_npos;
+}
+
+size_t OFpath::findFilename() const
+{
+#if _WIN32
+    const size_t pos = m_NativeString.find_last_of( ":\\" );
+#else
+    const size_t pos = m_NativeString.find_last_of( "/" );
+#endif
+    if( pos == OFString_npos )
+        return empty() ? OFString_npos : 0;
+    else
+        return pos < m_NativeString.size() ? pos + 1 : OFString_npos;
+}
+
+size_t OFpath::findExtension() const
+{
+#if _WIN32
+    const size_t pos = m_NativeString.find_last_of( ".:\\" );
+#else
+    const size_t pos = m_NativeString.find_last_of( "./" );
+#endif
+    if
+    (
+        pos && OFString_npos != pos && m_NativeString[pos] == '.'
+    )
+    {
+        switch( m_NativeString[pos-1] )
+        {
+#if _WIN32
+        case '\\':
+        case ':':
+#else
+        case '/':
+#endif
+            return OFString_npos;
+        case '.':
+            if( pos < m_NativeString.size() - 1 )
+                return pos;
+            if( pos == 1 )
+                return OFString_npos;
+            switch( m_NativeString[pos-2] )
+            {
+#if _WIN32
+            case '\\':
+            case ':':
+#else
+            case '/':
+#endif
+                return OFString_npos;
+            default:
+                break;
+            }
+        default:
+            break;
+        }
+        return pos;
+    }
+    return OFString_npos;
+}
+
+const OFpath& OFdirectory_entry::path() const
+{
+    return m_Path;
+}
+
+OFdirectory_entry::operator const OFpath&() const
+{
+    return OFdirectory_entry::path();
+}
+
+OFdirectory_iterator_proxy::OFdirectory_iterator_proxy( const OFdirectory_entry& rhs )
+: m_Entry( rhs )
+{
+
+}
+
+class OFdirectory_iterator::NativeDirectoryEntry : public OFdirectory_entry
+{
+public:
+    NativeDirectoryEntry( const OFpath& path );
+    ~NativeDirectoryEntry();
+    OFBool skipInvalidFiles();
+    OFBool next();
+
+private:
+    OFBool good() const;
+    const char* filename() const;
+    const OFpath m_Parent;
+
+#ifdef HAVE__FINDFIRST // HAVE__FINDFIRST
+    ::_finddata_t m_FileData;
+    OFintptr_t m_hFile;
+#else // HAVE__FINDFIRST
+    ::DIR* m_pDIR;
+    ::dirent* m_pDirent;
+#if defined(HAVE_READDIR_R) && !defined(READDIR_IS_THREADSAFE)
+    Uint8 m_Buffer[sizeof(::dirent) + _POSIX_PATH_MAX + 1];
+#endif
+#endif // HAVE__FINDFIRST
+};
+
+OFdirectory_iterator::NativeDirectoryEntry::NativeDirectoryEntry( const OFpath& path )
+: OFdirectory_entry()
+, m_Parent( path )
+#ifdef HAVE__FINDFIRST
+, m_FileData()
+, m_hFile( _findfirst( OFconst_cast( char*, (path / "*").c_str() ), &m_FileData ) )
+#else // HAVE__FINDFIRST
+, m_pDIR( ::opendir( path.c_str() ) )
+, m_pDirent()
+#if defined(HAVE_READDIR_R) && !defined(READDIR_IS_THREADSAFE)
+, m_Buffer()
+#endif
+#endif // HAVE__FINDFIRST
+{
+#ifndef HAVE__FINDFIRST
+    if( m_pDIR && !next() )
+    {
+        ::closedir( m_pDIR );
+        m_pDIR = OFnullptr;
+    }
+#endif
+}
+
+OFdirectory_iterator::NativeDirectoryEntry::~NativeDirectoryEntry()
+{
+#ifdef HAVE__FINDFIRST
+    ::_findclose( m_hFile );
+#else
+    if( m_pDIR ) ::closedir( m_pDIR );
+#endif
+}
+
+OFBool OFdirectory_iterator::NativeDirectoryEntry::good() const
+{
+#ifdef HAVE__FINDFIRST
+    return -1 != m_hFile;
+#else
+    return m_pDIR;
+#endif
+}
+
+const char* OFdirectory_iterator::NativeDirectoryEntry::filename() const
+{
+#ifdef HAVE__FINDFIRST
+    return m_FileData.name;
+#else
+    return m_pDirent->d_name;
+#endif
+}
+
+OFBool OFdirectory_iterator::NativeDirectoryEntry::next()
+{
+#ifdef HAVE__FINDFIRST // HAVE__FINDFIRST
+    return !::_findnext( m_hFile, &m_FileData );
+#else // HAVE__FINDFIRST
+#if defined(HAVE_READDIR_R) && !defined(READDIR_IS_THREADSAFE)
+#ifdef HAVE_OLD_READDIR_R
+    return (m_pDirent = ::readdir_r( m_pDIR, OFreinterpret_cast(dirent*, m_Buffer ) ) );
+#else // HAVE_OLD_READDIR_R
+    return !::readdir_r( m_pDIR, OFreinterpret_cast(dirent*, m_Buffer ), &m_pDirent ) && m_pDirent;
+#endif // HAVE_OLD_READDIR_R
+#else // HAVE_READDIR_R && !READDIR_IS_THREADSAFE
+    return (m_pDirent = ::readdir( m_pDIR ) );
+#endif // HAVE_READDIR_R && !READDIR_IS_THREADSAFE
+#endif // HAVE__FINDFIRST
+}
+
+OFBool OFdirectory_iterator::NativeDirectoryEntry::skipInvalidFiles()
+{
+    while( good() && ( !::strcmp( filename(), "." ) || !::strcmp( filename(), ".." ) ) )
+    {
+        if( !next() )
+            return OFFalse;
+    }
+    if( good() )
+    {
+        OFdirectory_entry::m_Path = m_Parent / filename();
+        return OFTrue;
+    }
+    return OFFalse;
+}
+
+OFdirectory_iterator::OFdirectory_iterator()
+: m_pEntry()
+{
+
+}
+
+OFdirectory_iterator::OFdirectory_iterator( const OFpath& path )
+: m_pEntry( new NativeDirectoryEntry( path ) )
+{
+    assert( m_pEntry );
+    if( !m_pEntry->skipInvalidFiles() )
+        m_pEntry.reset();
+}
+
+OFdirectory_iterator::OFdirectory_iterator( const OFdirectory_iterator& rhs )
+: m_pEntry( rhs.m_pEntry )
+{
+
+}
+
+OFdirectory_iterator& OFdirectory_iterator::operator=( const OFdirectory_iterator& rhs )
+{
+    m_pEntry = rhs.m_pEntry;
+    return *this;
+}
+
+OFdirectory_iterator::~OFdirectory_iterator()
+{
+
+}
+
+OFBool OFdirectory_iterator::operator==( const OFdirectory_iterator& rhs ) const
+{
+    return m_pEntry == rhs.m_pEntry;
+}
+
+OFBool OFdirectory_iterator::operator!=( const OFdirectory_iterator& rhs ) const
+{
+    return m_pEntry != rhs.m_pEntry;
+}
+
+OFdirectory_iterator& OFdirectory_iterator::operator++()
+{
+    assert( m_pEntry );
+    if( !m_pEntry->next() || !m_pEntry->skipInvalidFiles() )
+        m_pEntry.reset();
+    return *this;
+}
+
+OFrvalue<OFdirectory_iterator_proxy> OFdirectory_iterator::operator++(int)
+{
+    assert( m_pEntry );
+    OFdirectory_iterator_proxy proxy( *m_pEntry );
+    ++(*this);
+    return proxy;
+}
+
+OFdirectory_iterator::pointer OFdirectory_iterator::operator->() const
+{
+    assert( m_pEntry );
+    return m_pEntry.get();
+}
+
+OFdirectory_iterator::reference OFdirectory_iterator::operator*() const
+{
+    assert( m_pEntry );
+    return *m_pEntry;
+}
index 5b6123ed414622d8ee5dc84e74af97f4d0737913..cb6c652a8b1f825bfd450e2724ba689cd97044b1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -112,7 +112,7 @@ void OFFilenameCreator::addLongToString(unsigned long l, OFString &s)
   unsigned long m;
   int idx=7;
   char chr_array[9];
-  strcpy(chr_array, "00000000");
+  OFStandard::strlcpy(chr_array, "00000000", 9);
   while (l)
   {
     m = l & 0x0FL;
diff --git a/ofstd/libsrc/ofrand.cc b/ofstd/libsrc/ofrand.cc
new file mode 100644 (file)
index 0000000..b4ebe21
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module:  ofstd
+ *
+ *  Author:  Marco Eichelberg, based on the reference implementation
+ *   of the ISAAC PRNG by Bob Jenkins (Public Domain).
+ *
+ *  Purpose: Cryptographically secure PRNG based on Bob Jenkins's ISAAC algorithm
+ *
+ */
+
+#include "dcmtk/config/osconfig.h"
+#include "dcmtk/ofstd/ofrand.h"
+#include "dcmtk/ofstd/ofcast.h"
+#include "dcmtk/ofstd/ofstd.h"
+
+#define INCLUDE_CSTDIO
+#define INCLUDE_CSTDDEF
+#define INCLUDE_CTIME
+#include "dcmtk/ofstd/ofstdinc.h"
+
+BEGIN_EXTERN_C
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+END_EXTERN_C
+
+#ifdef HAVE_WINDOWS_H
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+
+#define ind(mm,x)  ((mm)[(x>>2)&(OFRandom_SIZ-1)])
+
+#define rngstep(mix,a,b,mm,m,m2,r,x) \
+{ \
+  x = *m;  \
+  a = ((a^(mix)) + *(m2++)); \
+  *(m++) = y = (ind(mm,x) + a + b); \
+  *(r++) = b = (ind(mm,y>>OFRandom_SIZL) + x) & 0xffffffff; \
+}
+
+#define mix(a,b,c,d,e,f,g,h) \
+{ \
+   a^=b<<11;              d+=a; b+=c; \
+   b^=(c&0xffffffff)>>2;  e+=b; c+=d; \
+   c^=d<<8;               f+=c; d+=e; \
+   d^=(e&0xffffffff)>>16; g+=d; e+=f; \
+   e^=f<<10;              h+=e; f+=g; \
+   f^=(g&0xffffffff)>>4;  a+=f; g+=h; \
+   g^=h<<8;               b+=g; h+=a; \
+   h^=(a&0xffffffff)>>9;  c+=h; a+=b; \
+}
+
+OFRandom::OFRandom()
+: randcnt(OFRandom_SIZ)
+, randrsl()
+, randmem()
+, randa(0)
+, randb(0)
+, randc(0)
+{
+   /* initialize randrsl based on the current time, CPU clock count, and process ID */
+   Uint32 tm = OFstatic_cast(Uint32, time(NULL));
+   Uint32 cl = OFstatic_cast(Uint32, clock());
+   Uint32 pi = OFstatic_cast(Uint32, OFStandard::getProcessID());
+
+#ifdef _WIN32
+    ULARGE_INTEGER wintm;
+    /* tm is number of 100ns ticks since Jan 01 1601.
+     * We only use the lowest 32 bits of this number.
+     */
+    GetSystemTimeAsFileTime(OFreinterpret_cast(FILETIME *, &wintm));
+    Uint32 tm2 = OFstatic_cast(Uint32, wintm.LowPart);
+#else
+    struct timeval posixtm;
+    gettimeofday(&posixtm, NULL);
+    /* sub-second part of current time in microseconds */
+    Uint32 tm2 = OFstatic_cast(Uint32, posixtm.tv_usec);
+#endif
+
+   for (int i=0; i<OFRandom_SIZ; i += 4)  // OFRandom_SIZ is dividable by 4
+   {
+     randrsl[i] = tm++;
+     randrsl[i+1] = cl++;
+     randrsl[i+2] = pi++;
+     randrsl[i+3] = tm2++;
+   }
+
+   mixSeed();
+}
+
+void OFRandom::mixSeed()
+{
+   int i;
+   Uint32 a,b,c,d,e,f,g,h;
+   a=b=c=d=e=f=g=h=0x9e3779b9;  /* the golden ratio */
+
+   for (i=0; i<4; ++i) /* scramble it */
+   {
+     mix(a,b,c,d,e,f,g,h);
+   }
+
+   /* initialize using the contents of randrsl[] as the seed */
+   for (i=0; i<OFRandom_SIZ; i+=8)
+   {
+     a+=randrsl[i  ]; b+=randrsl[i+1];
+     c+=randrsl[i+2]; d+=randrsl[i+3];
+     e+=randrsl[i+4]; f+=randrsl[i+5];
+     g+=randrsl[i+6]; h+=randrsl[i+7];
+     mix(a,b,c,d,e,f,g,h);
+     randmem[i  ]=a; randmem[i+1]=b; randmem[i+2]=c; randmem[i+3]=d;
+     randmem[i+4]=e; randmem[i+5]=f; randmem[i+6]=g; randmem[i+7]=h;
+   }
+   /* do a second pass to make all of the seed affect all of m */
+   for (i=0; i<OFRandom_SIZ; i+=8)
+   {
+     a+=randmem[i  ]; b+=randmem[i+1];
+     c+=randmem[i+2]; d+=randmem[i+3];
+     e+=randmem[i+4]; f+=randmem[i+5];
+     g+=randmem[i+6]; h+=randmem[i+7];
+     mix(a,b,c,d,e,f,g,h);
+     randmem[i  ]=a; randmem[i+1]=b; randmem[i+2]=c; randmem[i+3]=d;
+     randmem[i+4]=e; randmem[i+5]=f; randmem[i+6]=g; randmem[i+7]=h;
+   }
+
+   isaac(); /* fill in the first set of results */}
+
+void OFRandom::seed(Uint32 sval)
+{
+   for (int i=0; i<OFRandom_SIZ; i++)
+   {
+     randrsl[i] = sval;
+   }
+   randa = 0;
+   randb = 0;
+   randc = 0;
+   mixSeed();
+}
+
+void OFRandom::isaac()
+{
+   Uint32 x,y,*m,*m2,*mend;
+   Uint32 *r = randrsl;
+   Uint32 a = randa;
+   Uint32 b = randb + (++randc);
+   for (m = randmem, mend = m2 = m+(OFRandom_SIZ/2); m<mend; )
+   {
+      rngstep( a<<13, a, b, randmem, m, m2, r, x);
+      rngstep( (a & 0xffffffff) >>6 , a, b, randmem, m, m2, r, x);
+      rngstep( a<<2 , a, b, randmem, m, m2, r, x);
+      rngstep( (a & 0xffffffff) >>16, a, b, randmem, m, m2, r, x);
+   }
+   for (m2 = randmem; m2<mend; )
+   {
+      rngstep( a<<13, a, b, randmem, m, m2, r, x);
+      rngstep( (a & 0xffffffff) >>6 , a, b, randmem, m, m2, r, x);
+      rngstep( a<<2 , a, b, randmem, m, m2, r, x);
+      rngstep( (a & 0xffffffff) >>16, a, b, randmem, m, m2, r, x);
+   }
+   randb = b; randa = a;
+   randcnt = OFRandom_SIZ;
+}
+
+Uint32 OFRandom::getRND32()
+{
+  // check if we still have random numbers left
+  if (randcnt == 0) isaac();
+
+  // we use the random numbers from last to first
+  return randrsl[--randcnt];
+}
+
+Uint16 OFRandom::getRND16()
+{
+  // use one 32-bit random number and ignore the extra bits
+  return OFstatic_cast(Uint16, getRND32());
+}
+
+#ifndef OF_NO_UINT64
+Uint64 OFRandom::getRND64()
+{
+  // get a 32-bit random number
+  Uint64 result = getRND32();
+  // shift into upper 32 bits of the 64-bit word
+  result <<= 32;
+  // get a second 32-bit random number
+  result |= getRND32();
+  return result;
+}
+#endif
index c9e8bb78dd53bd0a045020bba6a02af4746ab81d..87ebcd400685d5a17fd356f8ec0ffb8ea80811ea 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, OFFIS e.V.
+ *  Copyright (C) 2017-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -40,7 +40,7 @@ END_EXTERN_C
 #include <ws2tcpip.h>    /* for struct sockaddr_in6 */
 #endif
 
-size_t OFSockAddr::size() const
+socklen_t OFSockAddr::size() const
 {
   switch (sa.ss_family)
   {
index c938151f773997610a4ff66455cca2ce4e489653..1ece8c778615b17876fa7e46a96310c5728e8242 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2001-2017, OFFIS e.V.
+ *  Copyright (C) 2001-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -179,6 +179,9 @@ END_EXTERN_C
 #include "dcmtk/ofstd/ofpwd.h"
 #include "dcmtk/ofstd/ofoption.h"
 
+// maximum number of repetitions for EAI_AGAIN
+#define DCMTK_MAX_EAI_AGAIN_REPETITIONS 5
+
 // --- ftoa() processing flags ---
 
 const unsigned int OFStandard::ftoa_format_e  = 0x01;
@@ -261,6 +264,69 @@ size_t OFStandard::my_strlcat(char *dst, const char *src, size_t siz)
 }
 #endif /* HAVE_STRLCAT */
 
+int OFStandard::snprintf(char *str, size_t size, const char *format, ...)
+{
+    // we emulate snprintf() via vsnprintf().
+    int count;
+    va_list ap;
+    va_start(ap, format);
+    count = OFStandard::vsnprintf(str, size, format, ap);
+    va_end(ap);
+    return count;
+}
+
+int OFStandard::vsnprintf(char *str, size_t size, const char *format, va_list ap)
+{
+#ifdef _MSC_VER
+#if _MSC_VER < 1900
+    // Visual Studio versions 2005 to 2013 do not have a C99 compliant
+    // vsnprintf(), but they have _snprintf(), which can be used to emulate it.
+    int count = -1;
+
+    if (size != 0)
+        count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
+    if (count == -1)
+        count = _vscprintf(format, ap);
+
+    return count;
+#else /* _MSC_VER < 1900 */
+    // Visual Studio 2015 and newer has a C99 compliant vsnprintf().
+    return ::vsnprintf(str, size, format, ap);
+#endif /* _MSC_VER < 1900 */
+#else /* _MSC_VER */
+#ifdef HAVE_VSNPRINTF
+    return ::vsnprintf(str, size, format, ap);
+#else /* HAVE_VSNPRINTF */
+#ifdef DCMTK_ENABLE_UNSAFE_VSNPRINTF
+    // This implementation internally uses sprintf (which is inherently unsafe).
+    // It allocates a buffer that is 1 kByte larger than "size",
+    // formats the string into that buffer, and then uses strlcpy() to
+    // copy the formatted string into the output buffer, truncating if necessary.
+    // This will work in most cases, since few snprintf calls should overrun
+    // the provided buffer by more than 1K, but it can be easily abused by
+    // a malicious attacker to cause a buffer overrun.
+    //
+    // Therefore, this implementation should only be used as a "last resort"
+    // and we strongly advise against using it in production code.
+    // The macro "DCMTK_ENABLE_UNSAFE_VSNPRINTF" must explicitly be defined
+    // by the used to enable this implementation.
+    int count = -1;
+    if (size != 0)
+    {
+      char *buf = new char[size+1024];
+      count = ::vsprintf(buf, format, ap);
+      OFStandard::strlcpy(str, buf, size);
+      delete[] buf;
+    }
+    return count;
+#warning Using unsafe implementation of vsnprintf(3)
+#else /* DCMTK_ENABLE_UNSAFE_VSNPRINTF */
+    return -1;
+#error vsnprintf(3) not found. Use different compiler or compile with DCMTK_ENABLE_UNSAFE_VSNPRINTF (unsafe!)
+#endif /* DCMTK_ENABLE_UNSAFE_VSNPRINTF */
+#endif /* HAVE_VSNPRINTF */
+#endif /* _MSC_VER */
+}
 
 #ifdef HAVE_PROTOTYPE_STRERROR_R
 /*
@@ -801,8 +867,9 @@ OFFilename &OFStandard::combineDirAndFilename(OFFilename &result,
             else {
                 const char *resValue = result.getCharPointer();
                 const size_t resLength = strlen(resValue); /* should never be 0 */
-                char *tmpString = new char[strLength + resLength + 1 + 1];
-                strcpy(tmpString, resValue);
+                const size_t buflen = strLength + resLength + 1 + 1;
+                char *tmpString = new char[buflen];
+                OFStandard::strlcpy(tmpString, resValue, buflen);
                 /* add path separator (if required) ... */
                 if (resValue[resLength - 1] != PATH_SEPARATOR)
                 {
@@ -810,7 +877,7 @@ OFFilename &OFStandard::combineDirAndFilename(OFFilename &result,
                     tmpString[resLength + 1] = '\0';
                 }
                 /* ...and file name */
-                strcat(tmpString, strValue);
+                OFStandard::strlcat(tmpString, strValue, buflen);
                 result.set(tmpString);
                 delete[] tmpString;
             }
@@ -892,9 +959,10 @@ OFCondition OFStandard::removeRootDirFromPathname(OFFilename &result,
             if (strncmp(rootValue, pathValue, rootLength) == 0)
             {
                 /* create temporary buffer for destination string */
-                char *tmpString = new char[pathLength - rootLength + 1];
+                size_t buflen = pathLength - rootLength + 1;
+                char *tmpString = new char[buflen];
                 /* remove root dir prefix from path name */
-                strcpy(tmpString, pathValue + rootLength);
+                OFStandard::strlcpy(tmpString, pathValue + rootLength, buflen);
                 /* remove leading path separator (if present) */
                 if (!allowLeadingPathSeparator && (tmpString[0] == PATH_SEPARATOR))
                     result.set(tmpString + 1);
@@ -944,10 +1012,11 @@ OFFilename &OFStandard::appendFilenameExtension(OFFilename &result,
         size_t namLength = (namValue == NULL) ? 0 : strlen(namValue);
         size_t extLength = (extValue == NULL) ? 0 : strlen(extValue);
         /* create temporary buffer for destination string */
-        char *tmpString = new char[namLength + extLength + 1];
-        strcpy(tmpString, (namValue == NULL) ? "" : namValue);
+        size_t buflen = namLength + extLength + 1;
+        char *tmpString = new char[buflen];
+        OFStandard::strlcpy(tmpString, (namValue == NULL) ? "" : namValue, buflen);
         if (extValue != NULL)
-            strcat(tmpString, extValue);
+            OFStandard::strlcat(tmpString, extValue, buflen);
         result.set(tmpString);
         delete[] tmpString;
     }
@@ -1044,7 +1113,7 @@ size_t OFStandard::searchDirectoryRecursively(const OFFilename &directory,
                 FindClose(handle);
             }
         } else
-#endif
+#endif /* defined(WIDE_CHAR_FILE_IO_FUNCTIONS) && defined(_WIN32) */
         /* otherwise, use the conventional 8-bit characters version */
         {
             HANDLE handle;
@@ -1099,13 +1168,13 @@ size_t OFStandard::searchDirectoryRecursively(const OFFilename &directory,
             }
         }
     }
-#else
+#else /* HAVE_WINDOWS_H */
     /* try to open the directory */
     DIR *dirPtr = opendir(dirName.getCharPointer());
     if (dirPtr != NULL)
     {
         struct dirent *entry = NULL;
-#ifdef HAVE_READDIR_R
+#if defined(HAVE_READDIR_R) && !defined(READDIR_IS_THREADSAFE)
         dirent d = {};
         while (!readdir_r(dirPtr, &d, &entry) && entry)
 #else
@@ -1138,7 +1207,7 @@ size_t OFStandard::searchDirectoryRecursively(const OFFilename &directory,
         }
         closedir(dirPtr);
     }
-#endif
+#endif /* HAVE_WINDOWS_H */
     /* return number of added files */
     return fileList.size() - initialSize;
 }
@@ -2617,6 +2686,13 @@ void OFStandard::trimString(const char*& pBegin, const char*& pEnd)
     --pEnd;
 }
 
+void OFStandard::trimString( const char*& str, size_t& size )
+{
+    const char* end = str + size;
+    trimString( str, end );
+    size = end - str;
+}
+
 #define MAX_NAME 65536
 
 #ifdef HAVE_GETHOSTBYNAME_R
@@ -2668,9 +2744,12 @@ OFString OFStandard::getHostnameByAddress(const char* addr, int len, int type)
   else return result; // unknown network type, not supported by getnameinfo()
 
   int err = EAI_AGAIN;
+  int rep = DCMTK_MAX_EAI_AGAIN_REPETITIONS;
   struct sockaddr *sa = OFreinterpret_cast(struct sockaddr *, &sas);
-  while (EAI_AGAIN == err) err = getnameinfo(sa, sizeof(sas), hostname, 512, NULL, 0, 0);
-  if (hostname[0] != '\0') result = hostname;
+
+  // perform reverse DNS lookup. Repeat while we receive temporary failures.
+  while ((EAI_AGAIN == err) && (rep-- > 0)) err = getnameinfo(sa, sizeof(sas), hostname, 512, NULL, 0, 0);
+  if ((err == 0) && (hostname[0] != '\0')) result = hostname;
 
 #elif defined(HAVE_GETHOSTBYADDR_R)
   // We do not have getaddrinfo(), but we have a thread-safe gethostbyaddr_r()
@@ -2711,20 +2790,25 @@ void OFStandard::getAddressByHostname(const char *name, OFSockAddr& result)
 #ifdef HAVE_GETADDRINFO
   struct addrinfo *result_list = NULL;
   int err = EAI_AGAIN;
+  int rep = DCMTK_MAX_EAI_AGAIN_REPETITIONS;
 
   // filter for the DNS lookup. Since DCMTK does not yet fully support IPv6,
   // we only look for IPv4 addresses.
-  ::addrinfo hint = {0};
+  ::addrinfo hint = {};
   hint.ai_family = AF_INET;
 
   // perform DNS lookup. Repeat while we receive temporary failures.
-  while (EAI_AGAIN == err) err = getaddrinfo(name, NULL, &hint, &result_list);
+  while ((EAI_AGAIN == err) && (rep-- > 0)) err = getaddrinfo(name, NULL, &hint, &result_list);
 
-  if ((0 == err) && result_list && result_list->ai_addr)
+  if (0 == err)
   {
-    // DNS lookup successfully completed.
-    struct sockaddr *result_sa = result.getSockaddr();
-    memcpy(result_sa, result_list->ai_addr, result_list->ai_addrlen);
+    if (result_list && result_list->ai_addr)
+    {
+      // DNS lookup successfully completed.
+      struct sockaddr *result_sa = result.getSockaddr();
+      memcpy(result_sa, result_list->ai_addr, result_list->ai_addrlen);
+    }
+    freeaddrinfo(result_list);
   }
 
 #else // HAVE_GETADDRINFO
index ace7b7ef9d03716a419fca826d7b0175cd299eab..87dcba387092fab3c37a0c514e208fc3dc97567e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 1997-2017, OFFIS e.V.
+ *  Copyright (C) 1997-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -36,6 +36,7 @@
 #include "dcmtk/ofstd/ofcast.h"
 #include "dcmtk/ofstd/ofbmanip.h"
 #include "dcmtk/ofstd/oftypes.h"
+#include "dcmtk/ofstd/ofstd.h"
 
 #define INCLUDE_CCTYPE
 #include "dcmtk/ofstd/ofstdinc.h"
@@ -89,9 +90,11 @@ OFString::OFString (const char* s)
     s = verify_string(s);
     const size_t n = strlen(s);
     reserve(n);
-    // Because we used strlen() to figure out the length we can use strcpy()
+    // Because we used strlen() to figure out the length we can use strlcpy()
     // since there won't be any '\0' bytes in the string.
-    strcpy(this->theCString, s);
+    // The amount of memory allocated is always theCapacity+1
+    // because one extra byte is always allocated for the eos zero byte.
+    OFStandard::strlcpy(this->theCString, s, this->theCapacity+1);
     this->theSize = n;
 }
 
index 5e088eb9737d6882330333fd7fac03d7fb08abab..622248443c429835c0acae1546ff45722f82f392 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2000-2017, OFFIS e.V.
+ *  Copyright (C) 2000-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -735,10 +735,18 @@ void OFMutex::errorstr(OFString& description, int /* code */ )
   return;
 }
 
+/* ------------------------------------------------------------------------- */
+
+// On Windows, use the slim read/write lock interface (SRW locks) if
+// both function and prototype are present (which is not the case for some MinGW versions)
+// and we have not explicitly been instructed to use the old implementation
+#if (defined(WINDOWS_INTERFACE)) && (defined(HAVE_PROTOTYPE_TRYACQUIRESRWLOCKSHARED)) && (! defined(USE_WIN32_READ_WRITE_LOCK_HELPER))
+#define USE_WIN32_SRW_INTERFACE
+#endif
 
 /* ------------------------------------------------------------------------- */
 
-#if defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
+#if (defined(WINDOWS_INTERFACE) && (! defined(USE_WIN32_SRW_INTERFACE))) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
 
 class OFReadWriteLockHelper
 {
@@ -770,7 +778,11 @@ private:
 OFReadWriteLock::OFReadWriteLock()
 : theLock(NULL)
 {
-#if defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
+#ifdef USE_WIN32_SRW_INTERFACE
+   SRWLOCK *srwLock = new SRWLOCK;
+   InitializeSRWLock(srwLock);
+   theLock = srwLock;
+#elif defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
    OFReadWriteLockHelper *rwl = new OFReadWriteLockHelper();
    if ((rwl->accessMutex.initialized()) && (rwl->usageSemaphore.initialized())) theLock=rwl;
    else delete rwl;
@@ -794,7 +806,9 @@ OFReadWriteLock::OFReadWriteLock()
 
 OFReadWriteLock::~OFReadWriteLock()
 {
-#if defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
+#ifdef USE_WIN32_SRW_INTERFACE
+  delete OFthread_cast(SRWLOCK *, theLock);
+#elif defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
   delete OFthread_cast(OFReadWriteLockHelper *, theLock);
 #elif defined(POSIX_INTERFACE)
   if (theLock) pthread_rwlock_destroy(OFthread_cast(pthread_rwlock_t *, theLock));
@@ -818,7 +832,13 @@ OFBool OFReadWriteLock::initialized() const
 
 int OFReadWriteLock::rdlock()
 {
-#if defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
+#ifdef USE_WIN32_SRW_INTERFACE
+  if (theLock)
+  {
+    AcquireSRWLockShared(OFthread_cast(SRWLOCK *, theLock));
+    return 0;
+  } else return EINVAL;
+#elif defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
   if (theLock)
   {
     OFReadWriteLockHelper *rwl = OFthread_cast(OFReadWriteLockHelper *, theLock);
@@ -856,7 +876,13 @@ int OFReadWriteLock::rdlock()
 
 int OFReadWriteLock::wrlock()
 {
-#if defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
+#ifdef USE_WIN32_SRW_INTERFACE
+  if (theLock)
+  {
+    AcquireSRWLockExclusive(OFthread_cast(SRWLOCK *, theLock));
+    return 0;
+  } else return EINVAL;
+#elif defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
   if (theLock)
   {
     OFReadWriteLockHelper *rwl = OFthread_cast(OFReadWriteLockHelper *, theLock);
@@ -893,7 +919,12 @@ int OFReadWriteLock::wrlock()
 
 int OFReadWriteLock::tryrdlock()
 {
-#if defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
+#ifdef USE_WIN32_SRW_INTERFACE
+  if (theLock)
+  {
+    return TryAcquireSRWLockShared(OFthread_cast(SRWLOCK *, theLock)) ? 0 : OFReadWriteLock::busy;
+  } else return EINVAL;
+#elif defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
   if (theLock)
   {
     OFReadWriteLockHelper *rwl = OFthread_cast(OFReadWriteLockHelper *, theLock);
@@ -926,7 +957,12 @@ int OFReadWriteLock::tryrdlock()
 
 int OFReadWriteLock::trywrlock()
 {
-#if defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
+#ifdef USE_WIN32_SRW_INTERFACE
+  if (theLock)
+  {
+    return TryAcquireSRWLockExclusive(OFthread_cast(SRWLOCK *, theLock)) ? 0 : OFReadWriteLock::busy;
+  } else return EINVAL;
+#elif defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
   if (theLock)
   {
     OFReadWriteLockHelper *rwl = OFthread_cast(OFReadWriteLockHelper *, theLock);
@@ -955,9 +991,46 @@ int OFReadWriteLock::trywrlock()
 }
 
 
-int OFReadWriteLock::unlock()
+int OFReadWriteLock::rdunlock()
+{
+#ifdef USE_WIN32_SRW_INTERFACE
+  if (theLock)
+  {
+    ReleaseSRWLockShared(OFthread_cast(SRWLOCK *, theLock));
+    return 0;
+  } else return EINVAL;
+#elif defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
+  if (theLock)
+  {
+    OFReadWriteLockHelper *rwl = OFthread_cast(OFReadWriteLockHelper *, theLock);
+    int result =0;
+    if (0 != (result = rwl->accessMutex.lock())) return result; // lock mutex
+    if (rwl->numReaders == -1) rwl->numReaders = 0; else (rwl->numReaders)--;
+    if ((rwl->numReaders == 0) && (0 != (result = rwl->usageSemaphore.post())))
+    {
+      rwl->accessMutex.unlock();
+      return result;
+    }
+    return rwl->accessMutex.unlock();
+  } else return EINVAL;
+#elif defined(POSIX_INTERFACE)
+  if (theLock) return pthread_rwlock_unlock(OFthread_cast(pthread_rwlock_t *, theLock)); else return EINVAL;
+#elif defined(SOLARIS_INTERFACE)
+  if (theLock) return rw_unlock(OFthread_cast(rwlock_t *, theLock)); else return EINVAL;
+#else
+  return -1;
+#endif
+}
+
+int OFReadWriteLock::wrunlock()
 {
-#if defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
+#ifdef USE_WIN32_SRW_INTERFACE
+  if (theLock)
+  {
+    ReleaseSRWLockExclusive(OFthread_cast(SRWLOCK *, theLock));
+    return 0;
+  } else return EINVAL;
+#elif defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE_WITHOUT_RWLOCK)
   if (theLock)
   {
     OFReadWriteLockHelper *rwl = OFthread_cast(OFReadWriteLockHelper *, theLock);
@@ -1009,14 +1082,18 @@ void OFReadWriteLock::errorstr(OFString& description, int /* code */ )
 
 
 OFReadWriteLocker::OFReadWriteLocker(OFReadWriteLock& lock)
-    : theLock(lock), locked(OFFalse)
+: theLock(lock)
+, locked(OFFalse)
+, isWriteLock(OFFalse)
 {
 }
 
 OFReadWriteLocker::~OFReadWriteLocker()
 {
   if (locked)
-    theLock.unlock();
+  {
+    if (isWriteLock) theLock.wrunlock(); else theLock.rdunlock();
+  }
 }
 
 #ifdef DEBUG
@@ -1030,20 +1107,53 @@ OFReadWriteLocker::~OFReadWriteLocker()
 #define lockWarn(name, locked)
 #endif
 
-#define OFReadWriteLockerFunction(name) \
-int OFReadWriteLocker::name()           \
-{                                       \
-  lockWarn(#name, locked);              \
-  int ret = theLock. name ();           \
-  if (ret == 0)                         \
-    locked = OFTrue;                    \
-  return ret;                           \
+int OFReadWriteLocker::rdlock()
+{
+  lockWarn("rdlock", locked);
+  int ret = theLock.rdlock();
+  if (ret == 0)
+  {
+    locked = OFTrue;
+    isWriteLock = OFFalse;
+  }
+  return ret;
+}
+
+int OFReadWriteLocker::wrlock()
+{
+  lockWarn("wrlock", locked);
+  int ret = theLock.wrlock();
+  if (ret == 0)
+  {
+    locked = OFTrue;
+    isWriteLock = OFTrue;
+  }
+  return ret;
 }
 
-OFReadWriteLockerFunction(rdlock)
-OFReadWriteLockerFunction(wrlock)
-OFReadWriteLockerFunction(tryrdlock)
-OFReadWriteLockerFunction(trywrlock)
+int OFReadWriteLocker::tryrdlock()
+{
+  lockWarn("tryrdlock", locked);
+  int ret = theLock.tryrdlock();
+  if (ret == 0)
+  {
+    locked = OFTrue;
+    isWriteLock = OFFalse;
+  }
+  return ret;
+}
+
+int OFReadWriteLocker::trywrlock()
+{
+  lockWarn("trywrlock", locked);
+  int ret = theLock.trywrlock();
+  if (ret == 0)
+  {
+    locked = OFTrue;
+    isWriteLock = OFTrue;
+  }
+  return ret;
+}
 
 int OFReadWriteLocker::unlock()
 {
@@ -1055,8 +1165,10 @@ int OFReadWriteLocker::unlock()
   }
 #endif
 
-  int ret = theLock.unlock();
+  int ret = 0;
+  if (isWriteLock) ret = theLock.wrunlock(); else ret = theLock.rdunlock();
   if (ret == 0)
     locked = OFFalse;
   return ret;
 }
+
index 1b85301d036ec21d68147ffdc5c9dd6fccd04198..75099d2b9efc1b50b9902a126bc0f5bcaebb756e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2002-2017, OFFIS e.V.
+ *  Copyright (C) 2002-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -606,8 +606,8 @@ OFBool OFTime::getISOFormattedTime(OFString &formattedTime,
                   OFStandard::ftoa_format_f | OFStandard::ftoa_zeropad, 9, 6);
                 /* format: HH:MM:SS.FFFFFF */
                 if (showDelimiter)
-                    strcat(buf, ":");
-                strcat(buf, buf2);
+                    OFStandard::strlcat(buf, ":", sizeof(buf));
+                OFStandard::strlcat(buf, buf2, sizeof(buf));
             } else {
                 /* format: HH:MM:SS*/
                 if (showDelimiter)
index 9a1e43ceae66d0798e549028ab627966acd632a5..98581245694b3aa213ee86b457d329e1a1d8dda7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2011-2016, OFFIS e.V.
+ *  Copyright (C) 2011-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -23,7 +23,6 @@
 #include "dcmtk/config/osconfig.h"
 
 #include "dcmtk/ofstd/ofuuid.h"
-
 #include "dcmtk/ofstd/ofdefine.h"
 #include "dcmtk/ofstd/ofthread.h"
 #include "dcmtk/ofstd/ofstd.h"
@@ -51,27 +50,22 @@ static Uint8 last_node[6];
 static OFBool initialized = OFFalse;
 
 
-static void get_random(void *dest, size_t num)
+static void get_random(OFRandom &rnd, void *dest, size_t num)
 {
-    /* FIXME: We are supposed to use a cryptographic-quality random number
-     * generator. However, finding a portable one is a little hard, so
-     * rand() will do for now.
-     */
     Uint8* ptr = OFreinterpret_cast(Uint8*, dest);
     while (num > 0) {
-        *ptr = OFstatic_cast(Uint8, rand());
+        *ptr++ = OFstatic_cast(Uint8, rnd.getRND16());
         num--;
-        ptr++;
     }
 }
 
-static void get_node()
+static void get_node(OFRandom &rnd)
 {
     /* FIXME: This is supposed to be a MAC address and we are supposed to
      * re-check the MAC address each time we generate a UUID and do some stuff
      * if the MAC changes.
      */
-    get_random(&last_node[0], sizeof(last_node));
+    get_random(rnd, &last_node[0], sizeof(last_node));
 }
 
 #ifdef _WIN32
@@ -163,8 +157,8 @@ void OFUUID::generate()
     UUIDMutex.lock();
 
     if (!initialized) {
-        get_node();
-        get_random(&last_clock_sequence, sizeof(last_clock_sequence));
+        get_node(rnd);
+        get_random(rnd, &last_clock_sequence, sizeof(last_clock_sequence));
         initialized = OFTrue;
     }
 
@@ -204,7 +198,8 @@ OFUUID::OFUUID()
   version_and_time_high(0),
   variant_and_clock_seq_high(0),
   clock_seq_low(0),
-  node()
+  node(),
+  rnd()
 {
     generate();
 }
index 01e6fdb72dafd538da04be9231810acee33713e3..8cc9108aa47fd3bf5c5bf4f5b2bebe1fd23366a0 100644 (file)
@@ -2892,7 +2892,7 @@ int XMLParserBase64Tool::encodeLength(int inlen, char formatted)
     return i;
 }
 
-XMLSTR XMLParserBase64Tool::encode(unsigned char *inbuf, unsigned int inlen, char formatted)
+XMLSTR XMLParserBase64Tool::encode(const unsigned char *inbuf, unsigned int inlen, char formatted)
 {
     int i=encodeLength(inlen,formatted),k=17,eLen=inlen/3,j;
     alloc(OFstatic_cast(int, i*sizeof(XMLCHAR)));
index 775ecdb91458e703ca7da287b434b73fbfc04d02..09de5a31c53ba846b6e06f2de929d738a1619838 100644 (file)
@@ -1,5 +1,5 @@
 # declare executables
-DCMTK_ADD_EXECUTABLE(ofstd_tests tests tatof terror tmap tvec tftoa tthread tbase64 tstring tlist tstack tofdatim tofstd tmarkup tchrenc txml tuuid toffile tmem toption ttuple tlimits tvariant)
+DCMTK_ADD_EXECUTABLE(ofstd_tests tests tatof terror tmap tvec tfilsys tftoa tthread tbase64 tstring tlist tstack tofdatim tofstd tmarkup tchrenc txml tuuid toffile tmem toption ttuple tlimits tvariant)
 
 # make sure executables are linked to the corresponding libraries
 DCMTK_TARGET_LINK_MODULES(ofstd_tests ofstd)
@@ -8,6 +8,6 @@ DCMTK_TARGET_LINK_MODULES(ofstd_tests ofstd)
 DCMTK_ADD_TESTS(ofstd)
 
 # Cleanup testfile.$$$ generated by the ofstd_OFFile exhaustive testcase.
-SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
+set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
   "${CMAKE_CURRENT_BINARY_DIR}/testfile.$$$"
 )
index ad5bb066a467a79689235f74fb9cde9317042cf9..50b08f88a33c389a6da8144d52c93e53289f234d 100644 (file)
@@ -8,83 +8,109 @@ tatof.o: tatof.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../config/include/dcmtk/config/arith.h \
  ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/oftest.h \
  ../include/dcmtk/ofstd/ofconapp.h ../include/dcmtk/ofstd/ofcmdln.h \
- ../include/dcmtk/ofstd/ofconsol.h ../include/dcmtk/ofstd/ofthread.h \
- ../include/dcmtk/ofstd/offile.h
+ ../include/dcmtk/ofstd/ofexbl.h ../include/dcmtk/ofstd/ofconsol.h \
+ ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
+ ../include/dcmtk/ofstd/ofexit.h
 tbase64.o: tbase64.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h
 tchrenc.o: tchrenc.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofchrenc.h \
- ../include/dcmtk/ofstd/ofmem.h ../include/dcmtk/ofstd/ofutil.h \
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/ofchrenc.h ../include/dcmtk/ofstd/ofmem.h \
+ ../include/dcmtk/ofstd/ofutil.h \
  ../include/dcmtk/ofstd/variadic/tuplefwd.h
 terror.o: terror.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h
 tests.o: tests.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
+ ../../config/include/dcmtk/config/arith.h \
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h
+tfilsys.o: tfilsys.cc ../../config/include/dcmtk/config/osconfig.h \
+ ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
+ ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
+ ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
+ ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
+ ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/offilsys.h ../include/dcmtk/ofstd/ofmem.h \
+ ../include/dcmtk/ofstd/ofutil.h \
+ ../include/dcmtk/ofstd/variadic/tuplefwd.h \
+ ../include/dcmtk/ofstd/ofvector.h ../include/dcmtk/ofstd/ofassert.h
 tftoa.o: tftoa.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h
 tlimits.o: tlimits.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofdiag.h \
- ../include/dcmtk/ofstd/ofmath.h ../include/dcmtk/ofstd/diag/push.def \
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/ofdiag.h ../include/dcmtk/ofstd/ofmath.h \
+ ../include/dcmtk/ofstd/diag/push.def \
  ../include/dcmtk/ofstd/diag/overflow.def \
  ../include/dcmtk/ofstd/diag/cnvrsn.def \
  ../include/dcmtk/ofstd/diag/pop.def
@@ -94,52 +120,55 @@ tlist.o: tlist.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofexport.h ../include/dcmtk/ofstd/ofstdinc.h \
  ../include/dcmtk/ofstd/ofstream.h ../include/dcmtk/ofstd/ofalgo.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofstring.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/ofstring.h \
  ../include/dcmtk/ofstd/ofconsol.h ../include/dcmtk/ofstd/ofthread.h \
  ../include/dcmtk/ofstd/offile.h ../include/dcmtk/ofstd/ofstd.h \
- ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/ofcond.h \
- ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h
 tmap.o: tmap.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofmap.h \
- ../include/dcmtk/ofstd/ofutil.h \
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/ofmap.h ../include/dcmtk/ofstd/ofutil.h \
  ../include/dcmtk/ofstd/variadic/tuplefwd.h
 tmarkup.o: tmarkup.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h
 tmem.o: tmem.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofmem.h \
- ../include/dcmtk/ofstd/ofutil.h \
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/ofmem.h ../include/dcmtk/ofstd/ofutil.h \
  ../include/dcmtk/ofstd/variadic/tuplefwd.h
 tofdatim.o: tofdatim.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofdate.h ../include/dcmtk/ofstd/ofstring.h \
@@ -148,13 +177,13 @@ tofdatim.o: tofdatim.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
  ../include/dcmtk/ofstd/oftime.h ../include/dcmtk/ofstd/ofdatime.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofconsol.h ../include/dcmtk/ofstd/ofthread.h \
  ../include/dcmtk/ofstd/offile.h ../include/dcmtk/ofstd/ofstd.h \
- ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/ofcond.h \
- ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h
 toffile.o: toffile.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/offile.h ../include/dcmtk/ofstd/oftypes.h \
  ../include/dcmtk/ofstd/ofdefine.h ../include/dcmtk/ofstd/ofcast.h \
@@ -165,8 +194,10 @@ toffile.o: toffile.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
  ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofconsol.h \
- ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/oftest.h \
- ../include/dcmtk/ofstd/ofconapp.h ../include/dcmtk/ofstd/ofcmdln.h
+ ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/ofrand.h \
+ ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/ofexit.h
 tofstd.o: tofstd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
@@ -177,21 +208,23 @@ tofstd.o: tofstd.cc ../../config/include/dcmtk/config/osconfig.h \
  ../../config/include/dcmtk/config/arith.h \
  ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/oftest.h \
  ../include/dcmtk/ofstd/ofconapp.h ../include/dcmtk/ofstd/ofcmdln.h \
- ../include/dcmtk/ofstd/ofconsol.h ../include/dcmtk/ofstd/ofthread.h \
- ../include/dcmtk/ofstd/offile.h
+ ../include/dcmtk/ofstd/ofexbl.h ../include/dcmtk/ofstd/ofconsol.h \
+ ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
+ ../include/dcmtk/ofstd/ofexit.h
 toption.o: toption.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofoption.h \
- ../include/dcmtk/ofstd/ofutil.h \
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/ofoption.h ../include/dcmtk/ofstd/ofutil.h \
  ../include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../include/dcmtk/ofstd/ofalign.h
 tstack.o: tstack.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -200,38 +233,40 @@ tstack.o: tstack.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofexport.h ../include/dcmtk/ofstd/ofstdinc.h \
  ../include/dcmtk/ofstd/ofstream.h ../include/dcmtk/ofstd/oftest.h \
  ../include/dcmtk/ofstd/ofconapp.h ../include/dcmtk/ofstd/ofcmdln.h \
+ ../include/dcmtk/ofstd/ofexbl.h ../include/dcmtk/ofstd/oftraits.h \
  ../include/dcmtk/ofstd/oflist.h ../include/dcmtk/ofstd/ofstring.h \
  ../include/dcmtk/ofstd/ofconsol.h ../include/dcmtk/ofstd/ofthread.h \
  ../include/dcmtk/ofstd/offile.h ../include/dcmtk/ofstd/ofstd.h \
- ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/ofcond.h \
- ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h
 tstring.o: tstring.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/oftypes.h \
  ../include/dcmtk/ofstd/ofdefine.h ../include/dcmtk/ofstd/ofcast.h \
  ../include/dcmtk/ofstd/ofexport.h ../include/dcmtk/ofstd/ofstdinc.h \
  ../include/dcmtk/ofstd/ofstream.h ../include/dcmtk/ofstd/oftest.h \
  ../include/dcmtk/ofstd/ofconapp.h ../include/dcmtk/ofstd/ofcmdln.h \
+ ../include/dcmtk/ofstd/ofexbl.h ../include/dcmtk/ofstd/oftraits.h \
  ../include/dcmtk/ofstd/oflist.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h
 tthread.o: tthread.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofdiag.h \
- ../include/dcmtk/ofstd/diag/push.def \
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/ofdiag.h ../include/dcmtk/ofstd/diag/push.def \
  ../include/dcmtk/ofstd/diag/shadow.def \
  ../include/dcmtk/ofstd/diag/pop.def
 ttuple.o: ttuple.cc ../../config/include/dcmtk/config/osconfig.h \
@@ -239,14 +274,15 @@ ttuple.o: ttuple.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/oftuple.h \
- ../include/dcmtk/ofstd/ofutil.h \
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/oftuple.h ../include/dcmtk/ofstd/ofutil.h \
  ../include/dcmtk/ofstd/variadic/tuplefwd.h \
  ../include/dcmtk/ofstd/ofdiag.h ../include/dcmtk/ofstd/diag/push.def \
  ../include/dcmtk/ofstd/diag/mmtag.def \
@@ -258,25 +294,29 @@ tuuid.o: tuuid.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofuuid.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/ofuuid.h ../include/dcmtk/ofstd/ofrand.h
 tvariant.o: tvariant.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofvriant.h \
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/ofvriant.h \
  ../include/dcmtk/ofstd/variadic/variant.h \
  ../include/dcmtk/ofstd/variadic/helpers.h \
  ../include/dcmtk/ofstd/ofalign.h ../include/dcmtk/ofstd/ofutil.h \
@@ -290,22 +330,26 @@ tvec.o: tvec.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofvector.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/ofvector.h
 txml.o: txml.cc ../../config/include/dcmtk/config/osconfig.h \
  ../include/dcmtk/ofstd/oftest.h ../include/dcmtk/ofstd/ofconapp.h \
  ../include/dcmtk/ofstd/oftypes.h ../include/dcmtk/ofstd/ofdefine.h \
  ../include/dcmtk/ofstd/ofcast.h ../include/dcmtk/ofstd/ofexport.h \
  ../include/dcmtk/ofstd/ofstdinc.h ../include/dcmtk/ofstd/ofstream.h \
- ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/oflist.h \
+ ../include/dcmtk/ofstd/ofcmdln.h ../include/dcmtk/ofstd/ofexbl.h \
+ ../include/dcmtk/ofstd/oftraits.h ../include/dcmtk/ofstd/oflist.h \
  ../include/dcmtk/ofstd/ofstring.h ../include/dcmtk/ofstd/ofconsol.h \
  ../include/dcmtk/ofstd/ofthread.h ../include/dcmtk/ofstd/offile.h \
- ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/oftraits.h \
- ../include/dcmtk/ofstd/ofcond.h ../include/dcmtk/ofstd/oflimits.h \
+ ../include/dcmtk/ofstd/ofstd.h ../include/dcmtk/ofstd/ofcond.h \
+ ../include/dcmtk/ofstd/oflimits.h \
  ../../config/include/dcmtk/config/arith.h \
- ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofxml.h
+ ../include/dcmtk/ofstd/oferror.h ../include/dcmtk/ofstd/ofexit.h \
+ ../include/dcmtk/ofstd/ofxml.h
index 57ff6d4ac2863cb99492048b529f70d4f251ca5e..f8a72972c715a5cd1ff8eb459f8e39bf8b6c58a7 100644 (file)
@@ -17,10 +17,10 @@ LIBDIRS = -L$(top_srcdir)/libsrc
 LOCALLIBS = -lofstd $(CHARCONVLIBS) $(MATHLIBS)
 LOCALTRASH = *.out testfile.\$$\$$\$$
 
-test_objs = tests.o tatof.o tmap.o tvec.o tftoa.o tthread.o tbase64.o \
-            tstring.o tlist.o tstack.o tofdatim.o tofstd.o tmarkup.o \
-            tchrenc.o txml.o tuuid.o toffile.o tmem.o toption.o ttuple.o \
-            tlimits.o tvariant.o terror.o
+test_objs = tests.o tatof.o tmap.o tvec.o tfilsys.o tftoa.o tthread.o \
+            tbase64.o tstring.o tlist.o tstack.o tofdatim.o tofstd.o \
+            tmarkup.o tchrenc.o txml.o tuuid.o toffile.o tmem.o toption.o \
+            ttuple.o tlimits.o tvariant.o terror.o
 objs = $(test_objs)
 progs = tests
 
index aa44c9ee6c9e19edd4f24b4e20c48cf9dfdb3351..701fe139c77df06ee992d0da92a12979b511e286 100644 (file)
 #include "dcmtk/ofstd/ofchrenc.h"
 
 
-static void checkConversionFlags(OFCharacterEncoding& charEnc,
-                                 const unsigned flags)
-{
-    if (OFCharacterEncoding::supportsConversionFlags(flags))
-    {
-        OFCHECK(charEnc.setConversionFlags(flags).good());
-        OFCHECK_EQUAL(charEnc.getConversionFlags(), flags);
+#define checkConversionFlags(flags)\
+    if (OFCharacterEncoding::supportsConversionFlags(flags))\
+    {\
+        OFCHECK(charEnc.setConversionFlags(flags).good());\
+        OFCHECK_EQUAL(charEnc.getConversionFlags(), flags);\
     }
-}
 
 
 OFTEST(ofstd_OFCharacterEncoding_1)
@@ -64,14 +61,23 @@ OFTEST(ofstd_OFCharacterEncoding_1)
         OFCHECK_EQUAL(resultStr, OFString(" \0 ", 3));
         OFCHECK(charEnc.selectEncoding("ASCII", "DCMTK").bad());
         OFCHECK(charEnc.selectEncoding("DCMTK", "ASCII").bad());
-        OFCHECK(charEnc.selectEncoding("", "ASCII").good());
-        OFCHECK(charEnc.selectEncoding("ASCII", "").good());
-        OFCHECK(charEnc.selectEncoding("ASCII", charEnc.getLocaleEncoding()).good());
-        checkConversionFlags(charEnc, OFCharacterEncoding::AbortTranscodingOnIllegalSequence);
-        checkConversionFlags(charEnc, OFCharacterEncoding::DiscardIllegalSequences);
-        checkConversionFlags(charEnc, OFCharacterEncoding::TransliterateIllegalSequences);
-        checkConversionFlags(charEnc, OFCharacterEncoding::TransliterateIllegalSequences
-                                    | OFCharacterEncoding::DiscardIllegalSequences);
+        // some implementations of iconv_open() in the C standard library do
+        // not understand the "" argument
+        if (OFCharacterEncoding::hasDefaultEncoding())
+        {
+            OFCHECK(charEnc.selectEncoding("", "ASCII").good());
+            OFCHECK(charEnc.selectEncoding("ASCII", "").good());
+            OFCHECK(charEnc.selectEncoding("ASCII", charEnc.getLocaleEncoding()).good());
+        }
+        else
+        {
+            OFCHECK(charEnc.selectEncoding("ASCII", "UTF-8").good());
+        }
+        checkConversionFlags(OFCharacterEncoding::AbortTranscodingOnIllegalSequence);
+        checkConversionFlags(OFCharacterEncoding::DiscardIllegalSequences);
+        checkConversionFlags(OFCharacterEncoding::TransliterateIllegalSequences);
+        checkConversionFlags(OFCharacterEncoding::TransliterateIllegalSequences
+                             | OFCharacterEncoding::DiscardIllegalSequences);
         charEnc.clear();
         OFCHECK(charEnc.convertString("Simple Text", resultStr).bad());
     }
index dca53cfc98906d805dfc2cfdfb4acfa581330dce..4a3b081526d1026fc3b06186fb3762dc89403fd3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2017, OFFIS e.V.
+ *  Copyright (C) 2017-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -83,7 +83,7 @@ OFTEST(ofstd_error)
 #ifdef _WIN32
     ec_error.assign(WSA_IO_INCOMPLETE, OFsystem_category());
     WSASetLastError(WSA_IO_INCOMPLETE);
-#elif __OpenBSD__
+#elif defined(__OpenBSD__)
     ec_error.assign(EPROTOTYPE, OFsystem_category());
     errno = EPROTOTYPE;
 #else
index f27f9b296a15c80d935252500355424008f399d3..a2e8f9d8ccc65f83ba7f8b930257dbbd27d7f68f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2011-2014, OFFIS e.V.
+ *  Copyright (C) 2011-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -77,7 +77,10 @@ OFTEST_REGISTER(ofstd_memory);
 OFTEST_REGISTER(ofstd_optional);
 OFTEST_REGISTER(ofstd_tuple);
 OFTEST_REGISTER(ofstd_limits);
-OFTEST_REGISTER(ofstd_safeSubtractAndAdd);
+OFTEST_REGISTER(ofstd_safeSubtractAddMult);
 OFTEST_REGISTER(ofstd_variant);
 OFTEST_REGISTER(ofstd_error);
+OFTEST_REGISTER(ofstd_filesystem);
+OFTEST_REGISTER(ofstd_snprintf);
+
 OFTEST_MAIN("ofstd")
diff --git a/ofstd/tests/tfilsys.cc b/ofstd/tests/tfilsys.cc
new file mode 100644 (file)
index 0000000..234e1e7
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ *
+ *  Copyright (C) 2018, OFFIS e.V.
+ *  All rights reserved.  See COPYRIGHT file for details.
+ *
+ *  This software and supporting documentation were developed by
+ *
+ *    OFFIS e.V.
+ *    R&D Division Health
+ *    Escherweg 2
+ *    D-26121 Oldenburg, Germany
+ *
+ *
+ *  Module: ofstd
+ *
+ *  Author: Jan Schlamelcher
+ *
+ *  Purpose: test program for OFpath and related stuff.
+ *
+ */
+
+
+#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
+
+#define OFTEST_OFSTD_ONLY
+#include "dcmtk/ofstd/oftest.h"
+#include "dcmtk/ofstd/offilsys.h"
+#include "dcmtk/ofstd/ofstd.h"
+#include "dcmtk/ofstd/ofvector.h"
+#include "dcmtk/ofstd/oftraits.h"
+#include "dcmtk/ofstd/ofassert.h"
+
+OFTEST(ofstd_filesystem)
+{
+    OFstatic_assert( (OFis_same<OFdirectory_iterator::difference_type,STD_NAMESPACE ptrdiff_t>::value), "OFdirectory_iterator has correctly defined difference type" );
+    OFstatic_assert( (OFis_same<OFdirectory_iterator::value_type,OFdirectory_entry>::value), "OFdirectory_iterator has correctly defined value type" );
+    OFstatic_assert( (OFis_same<OFdirectory_iterator::pointer,const OFdirectory_entry*>::value), "OFdirectory_iterator has correctly defined pointer type" );
+    OFstatic_assert( (OFis_same<OFdirectory_iterator::reference,const OFdirectory_entry&>::value), "OFdirectory_iterator has correctly defined reference type" );
+#if _WIN32
+    const OFBool onWindows = OFTrue;
+    OFCHECK_EQUAL( OFpath::preferred_separator, '\\' );
+#else
+    const OFBool onWindows = OFFalse;
+    OFCHECK_EQUAL( OFpath::preferred_separator, '/' );
+#endif
+    OFCHECK( OFpath().empty() );
+    OFCHECK_EQUAL( OFpath( "C:" ).is_absolute(), onWindows );
+    OFCHECK_EQUAL( OFpath( OFString( 1, OFpath::preferred_separator ) ).is_absolute(), !onWindows );
+    // root name checks
+#if _WIN32
+    OFCHECK_EQUAL( OFpath( "C:\\test" ).root_name(), "C:" );
+    OFCHECK_EQUAL( OFpath( "C:\\test" ) / "\\good", "C:\\good" );
+    OFCHECK_EQUAL( OFpath( "C:\\test" ) / "C:\\good", "C:\\good" );
+    OFCHECK_EQUAL( OFpath( "C:\\test" ) / "Y:\\good", "Y:\\good" );
+    OFCHECK_EQUAL( OFpath( "C:\\test" ) / "Y:good", "Y:good" );
+    OFCHECK_EQUAL( OFpath( "C:\\test" ) / "C:good", "C:\\test\\good" );
+    OFCHECK_EQUAL( OFpath( "\\test" ) / "Y:good", "Y:good" );
+#else
+    OFCHECK( !OFpath( "C:\\test" ).has_root_name() );
+    OFCHECK_EQUAL( OFpath( "/test" ) / "/good", "/good" );
+#endif
+    OFString expected = OFString( "path" ) + OFpath::preferred_separator + "to" + OFpath::preferred_separator + "file";
+    OFCHECK_EQUAL( "path" / ( OFString( "to" ) + OFpath::preferred_separator ) / "file", expected );
+    OFCHECK_EQUAL( OFpath() / "path" / ( OFString( "to" ) + OFpath::preferred_separator ) / "file", expected );
+    OFCHECK( OFpath( "bla.txt" ).has_extension() );
+    OFCHECK( OFpath( "bla." ).has_extension() );
+    OFCHECK( !OFpath( "bla" ).has_extension() );
+    OFCHECK( !OFpath( ".bla" ).has_extension() );
+    OFCHECK( !OFpath( "." ).has_extension() );
+    OFCHECK( !OFpath( ".." ).has_extension() );
+    OFCHECK( OFpath( "..." ).has_extension() );
+    OFCHECK( OFpath( "..a" ).has_extension() );
+    OFCHECK( OFpath( ":..a" ).has_extension() );
+    OFCHECK_EQUAL( OFpath( "c:.bla" ).has_extension(), !onWindows );
+    OFCHECK_EQUAL( OFpath( "c:.." ).has_extension(), !onWindows );
+    OFCHECK_EQUAL( ( OFpath( "test" ) / ".." / "bla.txt" ).extension(), ".txt" );
+    OFCHECK_EQUAL( ( OFpath( "test" ) / ".." / "bla." ).extension(), "." );
+    OFCHECK_EQUAL( ( OFpath( "test" ) / "." / ".bla" ).extension(), "" );
+    OFCHECK_EQUAL( ( OFpath( "test" ) / "..bla" ).extension(), ".bla" );
+    OFCHECK_EQUAL( ( OFpath( "test" ) / ".." ).extension(), "" );
+    OFCHECK_EQUAL( ( OFpath( "test" ) / "..." ).extension(), "." );
+    // self append
+    OFpath p( OFString( "my" ) + OFpath::preferred_separator + "path" );
+    expected = OFString( "my" )
+             + OFpath::preferred_separator + "path"
+             + OFpath::preferred_separator + "my"
+             + OFpath::preferred_separator + "path";
+    p /= p;
+    OFCHECK_EQUAL( p, expected );
+#ifdef _WIN32
+    p = ( OFString( "C:" ) + OFpath::preferred_separator ) / p;
+    expected = OFString( "C:" ) + OFpath::preferred_separator + expected;
+#else
+    p = OFString( 1, OFpath::preferred_separator ) / p;
+    expected = OFpath::preferred_separator + expected;
+#endif
+    OFCHECK_EQUAL( p, expected );
+    p /= p;
+    OFCHECK_EQUAL( p, expected );
+    // directory iterator stuff
+    OFCHECK( OFdirectory_iterator() == OFdirectory_iterator() );
+    OFCHECK( OFdirectory_iterator( "./#$aninvalidpathihope--~~~" ) == OFdirectory_iterator() );
+    OFCHECK( OFdirectory_iterator( "." ) != OFdirectory_iterator() );
+    OFCHECK( OFStandard::createDirectory( "tehtestdire", "" ).good() );
+    OFVector<OFString> files;
+    files.push_back( "tesfile" );
+    files.push_back( "anotherone" );
+    files.push_back( "bites" );
+    files.push_back( "the" );
+    files.push_back( "heh" );
+    files.push_back( "guess you didnt expect that huh" );
+    OFFile f;
+    for( OFVector<OFString>::const_iterator it = files.begin(); it != files.end(); ++it )
+        OFCHECK( f.fopen( ( "tehtestdire" / *it ).native(), "w" ) );
+    for( OFdirectory_iterator it( "tehtestdire" ); it != OFdirectory_iterator(); ++it )
+    {
+        OFBool found = OFFalse;
+        for( OFVector<OFString>::iterator jt = files.begin(); jt != files.end(); ++jt )
+        {
+            if( "tehtestdire" / *jt == *it && *jt == it->path().filename() )
+            {
+                found = OFTrue;
+                files.erase( jt );
+                break;
+            }
+        }
+        OFCHECK( found );
+    }
+    OFCHECK( files.empty() );
+}
index 8a7161b9fe456017f149fcdb35871ae7755e7e0e..9d7745ebc2ed082d2b4edf8f2bb509881604e65d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2014-2017, OFFIS e.V.
+ *  Copyright (C) 2014-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
 #include "dcmtk/ofstd/oftraits.h"
 #include "dcmtk/ofstd/ofmath.h"   // for isinf and isnan
 
+// On some platforms, such as OpenIndiana, isinf is defined as a macro,
+// and that inteferes with the OFMath function of the same name.
+#ifdef isinf
+#undef isinf
+#endif
+
 #include DCMTK_DIAGNOSTIC_PUSH
 #include DCMTK_DIAGNOSTIC_IGNORE_OVERFLOW
 #include DCMTK_DIAGNOSTIC_IGNORE_IMPLICIT_CONVERSION
index dc4b2e993cb2b4dfcba8b78da1f639efae135c8a..a3a6f481a7779c03b02057b598d1d37a64c6949e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2002-2017, OFFIS e.V.
+ *  Copyright (C) 2002-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -25,6 +25,7 @@
 #include "dcmtk/ofstd/ofstream.h"
 #include "dcmtk/ofstd/ofconsol.h"
 #include "dcmtk/ofstd/ofstd.h"
+#include "dcmtk/ofstd/ofrand.h"
 
 #define OFTEST_OFSTD_ONLY
 #include "dcmtk/ofstd/oftest.h"
@@ -76,9 +77,11 @@ static OFBool fillFile(OFFile& file)
   return OFTrue;
 }
 
-static Uint32 myRand(Uint32 max)
+static Uint32 myRand(OFRandom& rnd, Uint32 max)
 {
-   return OFstatic_cast(Uint32, (OFstatic_cast(double, max) * rand() / RAND_MAX)); // 0.. max * RAND_MAX
+   Uint32 result = OFstatic_cast(Uint32, (OFstatic_cast(double, max) * rnd.getRND32() / OFstatic_cast(Uint32, -1))); 
+   if (result > max) result = max;
+   return result;
 }
 
 static OFBool seekFile(OFFile &file)
@@ -90,6 +93,7 @@ static OFBool seekFile(OFFile &file)
   Uint32 v;
   Uint32 block;
   Uint32 offset;
+  OFRandom rnd;
 
   COUT << "Seeking to start of blocks using SEEK_SET\n"
        << "[0%------------25%-------------50%--------------75%----------100%]\n[" << STD_NAMESPACE flush;
@@ -138,8 +142,8 @@ static OFBool seekFile(OFFile &file)
   // fseek to random blocks using SEEK_SET
   for (i = 0; i < 1024; ++i)
   {
-    block = myRand(FILESIZE - 1);
-    offset = myRand(BLOCKSIZE - 1);
+    block = myRand(rnd, FILESIZE - 1);
+    offset = myRand(rnd, BLOCKSIZE - 1);
     pos = block * BLOCKSIZE * sizeof(Uint32) + offset * sizeof(Uint32);
     result = file.fseek(pos, SEEK_SET);
     if (result)
@@ -216,8 +220,8 @@ static OFBool seekFile(OFFile &file)
   // fseek to random blocks using SEEK_END
   for (i = 0; i < 1024; ++i)
   {
-    block = myRand(FILESIZE - 2); // this avoids that pos can ever be 0, which would cause us to read after the end of file.
-    offset = myRand(BLOCKSIZE - 1);
+    block = myRand(rnd, FILESIZE - 2); // this avoids that pos can ever be 0, which would cause us to read after the end of file.
+    offset = myRand(rnd, BLOCKSIZE - 1);
     pos = OFstatic_cast(offile_off_t, -1) * (FILESIZE - block - 1) * BLOCKSIZE * sizeof(Uint32) + offset * sizeof(Uint32);
     result = file.fseek(pos, SEEK_END);
     if (result)
@@ -297,8 +301,8 @@ static OFBool seekFile(OFFile &file)
   lastpos = 0;
   for (i = 0; i < 1024; ++i)
   {
-    block = myRand(FILESIZE - 1);
-    offset = myRand(BLOCKSIZE - 1);
+    block = myRand(rnd, FILESIZE - 1);
+    offset = myRand(rnd, BLOCKSIZE - 1);
     pos = block * BLOCKSIZE * sizeof(Uint32) + offset * sizeof(Uint32);
     result = file.fseek((pos-lastpos), SEEK_CUR);
     if (result)
@@ -334,9 +338,6 @@ OFTEST_FLAGS(ofstd_OFFile, EF_Slow)
 {
   COUT << "Test program for LFS support in DCMTK class OFFile\n" << OFendl;
 
-  // initialize random generator
-  srand(OFstatic_cast(unsigned int, time(NULL)));
-
   // check if typedefs are large enough
   COUT << "Checking typedefs.\n"
        << "- size of offile_off_t: " << sizeof(offile_off_t);
index d8382c2901a32edfc4ca85be640712f276274184..96ef044560ef4db47eb5dacb758f65ad42640463 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2002-2016, OFFIS e.V.
+ *  Copyright (C) 2002-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
@@ -257,7 +257,7 @@ OFTEST(ofstd_OFStandard_removeRootDirFromPathname)
     OFCHECK(OFStandard::removeRootDirFromPathname(result, nullPtr, nullPtr).good());
 }
 
-OFTEST(ofstd_safeSubtractAndAdd)
+OFTEST(ofstd_safeSubtractAddMult)
 {
   // --------------- Subtraction ----------------
 
@@ -291,4 +291,69 @@ OFTEST(ofstd_safeSubtractAndAdd)
   // dividing and then multiplying by 2 is required since max may be an
   // odd number so that max/2 is rounded to the floor number.
   OFCHECK_EQUAL(a, OFnumeric_limits<unsigned int>::max());
+
+  // --------------- Multiplication ----------------
+  a = OFnumeric_limits<unsigned int>::max() / 2;
+  // check whether overflow occurred (it should)
+  OFCHECK( OFStandard::safeMult(a, OFstatic_cast(unsigned int, 3), a) == OFFalse);
+  // check whether no overflow occurred (it shouldn't)
+  OFCHECK_EQUAL(a, OFnumeric_limits<unsigned int>::max() / 2);
+
+  b = 2; // a still equals max / 2
+  OFCHECK( OFStandard::safeMult(a, b, a) == OFTrue);
+  if ( (OFnumeric_limits<unsigned int>::max() %2 == 1) )
+      OFCHECK_EQUAL(a+1, OFnumeric_limits<unsigned int>::max());
+  else
+      OFCHECK_EQUAL(a, OFnumeric_limits<unsigned int>::max());
+}
+
+OFTEST(ofstd_snprintf)
+{
+  // This test tests whether OFStandard::snprintf() properly "cuts"
+  // the formatted output string based on the given buffer size
+  // and whether it returns the correct return value, i.e.
+  // the number of characters that SHOULD have been written.
+  // We only exercise this for a formatted integer and not
+  // for all other possible types of arguments
+
+  char buf[10]; // a buffer for 10 characters (including terminating NUL)
+  const char *s = "987654321"; // a 10 character string (including terminating NUL)
+  int i = 12345;
+  int count = 0;
+  OFString zero;
+  OFString one = "1";
+  OFString two = "12";
+  OFString three = "123";
+  OFString four = "1234";
+  OFString five = "12345";
+
+  // initialize buffer with a zero terminated string
+  // that is definitely not what we expect
+  memcpy(buf, s, 10);
+
+  // snprintf() into the buffer, check result and return value
+  count = OFStandard::snprintf(buf, 1, "%i", i);
+  OFCHECK((count == 5) && (zero ==  buf));
+
+  // repeat the same with increasing buffer size...
+  memcpy(buf, s, 10);
+  count = OFStandard::snprintf(buf, 2, "%i", i);
+  OFCHECK((count == 5) && (one ==  buf));
+
+  memcpy(buf, s, 10);
+  count = OFStandard::snprintf(buf, 3, "%i", i);
+  OFCHECK((count == 5) && (two ==  buf));
+
+  memcpy(buf, s, 10);
+  count = OFStandard::snprintf(buf, 4, "%i", i);
+  OFCHECK((count == 5) && (three ==  buf));
+
+  memcpy(buf, s, 10);
+  count = OFStandard::snprintf(buf, 5, "%i", i);
+  OFCHECK((count == 5) && (four ==  buf));
+
+  // ...until finally the formatted string fits completely into the buffer.
+  memcpy(buf, s, 10);
+  count = OFStandard::snprintf(buf, 10, "%i", i);
+  OFCHECK((count == 5) && (five ==  buf));
 }
index 6af95e574f4b2cc6c8e4be34757d5aa5de4c7723..38f01e92e795e59d04c316350eb5adbcad963e13 100644 (file)
@@ -236,7 +236,7 @@ public:
       rw_cond6=1;
       mutex2->unlock();
       OFStandard::milliSleep(wait_timeout);
-      if (0==rwlock->unlock()) rw_cond7=1;
+      if (0==rwlock->wrunlock()) rw_cond7=1;
     }
     return;
   }
@@ -261,11 +261,11 @@ public:
       rw_cond1 = 1; // acquired read lock
       mutex->lock();
       mutex->unlock();
-      if (0== rwlock->unlock()) rw_cond2=1;
+      if (0== rwlock->rdunlock()) rw_cond2=1;
       mutex2->lock();
       mutex2->unlock();
       if (OFReadWriteLock::busy == rwlock->tryrdlock()) rw_cond3=1;
-      if ((0 == rwlock->rdlock())&&(0==rwlock->unlock())) rw_cond4=1;
+      if ((0 == rwlock->rdlock())&&(0==rwlock->rdunlock())) rw_cond4=1;
     }
     return;
   }
@@ -306,7 +306,7 @@ static void rwlock_test()
   while ((i++<5) && ((!rw_cond1)||(!rw_cond5))) OFStandard::milliSleep(wait_timeout);
 
   if ((!rw_cond1)||(!rw_cond5)) BAILOUT("read/write lock/unlock test failed");
-  condition = rwlock->unlock();
+  condition = rwlock->rdunlock();
   if (condition)
   {
     rwlock->errorstr(errmsg, condition);
index 29a51ac9e62df9d0cc5d6fa3b7458e4862f3cb5d..cfa44e1c2e0aaf45637b208087cff65499d0e5f5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *  Copyright (C) 2011-2012, OFFIS e.V.
+ *  Copyright (C) 2011-2018, OFFIS e.V.
  *  All rights reserved.  See COPYRIGHT file for details.
  *
  *  This software and supporting documentation were developed by
  *
  */
 
-
 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
 
 #define OFTEST_OFSTD_ONLY
 #include "dcmtk/ofstd/oftest.h"
 #include "dcmtk/ofstd/ofxml.h"
 
-
 #define XML_TEST_DATA "<?xml version=\"1.0\"?>"                         \
     "<root>"                                                            \
       "<element attribute=\"value\">some text</element>"                \
@@ -39,7 +37,6 @@
       "</parent>"                                                       \
     "</root>"
 
-
 OFTEST(ofstd_xmlParser)
 {
     int i = 0;
@@ -79,4 +76,5 @@ OFTEST(ofstd_xmlParser)
 
     OFCHECK(!rootNode.getChildNode("parent").getChildNode("child", 1).isEmpty());
     OFCHECK(rootNode.getChildNode("parent").getChildNode("child" ,2).isEmpty());
+    OFCHECK(rootNode.getChildNode("element").isAttributeSet("attribute"));
 }